-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a matrix of stdenvs to the flake #4996
Conversation
cd656ea
to
1dcb30e
Compare
flake.nix
Outdated
|
||
defaultPackage = forAllSystems (system: self.packages.${system}.nix); | ||
|
||
devShell = forAllSystems (system: | ||
devShell = forAllSystemsAndStdenvs (system: stdenv: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should make devShell
an attrset of derivations/shells. It's assumed to be a single derivation, like defaultPackage
. So e.g. nix flake check
won't check these. Maybe to enforce uniformity we should disallow attributes deeper than the expected level in the CLI...
Instead we probably should add a devShells
flake output (and maybe rename devShell
to defaultDevShell
). That would also be less verbose since it can be searched by default, so instead of
nix develop .#devShell.x86_64-linux.clang11StdenvPackages
you could do
nix develop .#clang11StdenvPackages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh indeed, devShells
is much nicer. I’ve changed that in 6378f36, and I’ll probably open another PR shortly to make nix develop
and the various nix flake
commands aware of it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to use nix develop .#clang11StdenvPackages
with this PR, and I get an error:
nix --experimental-features "nix-command flakes" develop .#clang11StdenvPackages
warning: Git tree '/src/nix' is dirty
error: flake 'git+file:///src/nix?shallow=1' does not provide attribute 'devShells.x86_64-linuxclang11StdenvPackages', 'packages.x86_64-linux.clang11StdenvPackages', 'legacyPackages.x86_64-linux.clang11StdenvPackages' or 'clang11StdenvPackages'
nix --version
nix (Nix) 2.4pre20210805_d64f967
Also, completion gives other attributes:
.#defaultPackage .#checks .#
.#hydraJobs .#devShells .#devShell
.#nix-armv7l-linux .#nix-armv6l-linux .#nix
.#nix-clang11Stdenv .#nix-clangStdenv .#nix-gccStdenv
.#nix-stdenv .#nix-static .#overlay
It should be nix develop .#nix-clang11Stdenv
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do like this. I will build on this to duplicate the cross / static stuff.
(It was only ever the is only the way it use because there used to be an issue with nix
being overridden in https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/static.nix, but it no longer is overridden there.)
6378f36
to
e7fa154
Compare
or if you have a flake-enabled nix: | ||
|
||
```console | ||
$ nix develop .#devShell.x86_64-linux.clang11StdenvPackages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be .#clang11StdenvPackages
now right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, thanks. And actually the flake search path was broken (was missing a trailing .
), so I fixed it.
I’ve also fixed the command above to use devShells
and not devShell
e7fa154
to
2b1d251
Compare
Squash commit of all the commits of NixOS#4996 . Signed-off-by: Pamplemousse <xav.maso@gmail.com>
Squash commit of all the commits of NixOS#4996 . Signed-off-by: Pamplemousse <xav.maso@gmail.com>
Squash commit of all the commits of NixOS#4996 . Signed-off-by: Pamplemousse <xav.maso@gmail.com>
Also, it seems that the Example: $ nix develop .#nix-clang11Stdenv
warning: Git tree '/home/pamplemousse/Workspace/tools/nix' is dirty
$ echo $MANPATH
$ nix develop
warning: Git tree '/home/pamplemousse/Workspace/tools/nix' is dirty
$ echo $MANPATH
/home/pamplemousse/Workspace/tools/nix/outputs/out/share/man: |
Squash commit of all the commits of NixOS#4996 . Signed-off-by: Pamplemousse <xav.maso@gmail.com>
Squash commit of all the commits of NixOS#4996 . Signed-off-by: Pamplemousse <xav.maso@gmail.com>
Ah, nevermind! Now, I use |
Squash commit of all the commits of NixOS#4996 . Signed-off-by: Pamplemousse <xav.maso@gmail.com>
This is blocking for google/oss-fuzz#6317, as they require good upstream integration (they won't merge as long as I use my fork of Is there anything blocking the merge? |
Squash commit of all the commits of NixOS#4996 . Signed-off-by: Pamplemousse <xav.maso@gmail.com>
Squash commit of all the commits of NixOS#4996 . Signed-off-by: Pamplemousse <xav.maso@gmail.com>
Can we get this in before 2.4? I think it is decently important, and I would like to delete the duplicate |
We would make something like |
2b1d251
to
c28c9d9
Compare
For a (currently hardcoded and limited) list of stdenvs, make `.#$nix-${stdenvName}` correspond to a Nix built with the corresponding stdenv. For example, `.#nix-${clang11Stdenv}` is Nix built with clang11. Likewise, `devShells.x86_64-linux.clang11StdenvPackages` is a development shell for Nix with clang11, that can be used with ```shell nix develop .#clang11StdenvPackages ``` Fix #4129 /cc @Pamplemousse
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
c28c9d9
to
288c252
Compare
Rebased on top of latest master. @edolstra care to have a look? |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/tweag-nix-dev-update-23/16631/1 |
For a (currently hardcoded and limited) list of stdenvs,
make
.#$nix-${stdenvName}
correspond to a Nix built with thecorresponding stdenv.
For example,
.#nix-${clang11Stdenv}
is Nix built with clang11.Likewise,
devShell.x86_64-linux.clang11StdenvPackages
is a development shell for Nix with clang11Fix #4129
/cc @Pamplemousse