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
nix build vs nix develop --build inconsistency #4578
Comments
I don't think the two commands could possibly have different scoping rules because they both use the exact same function for doing the evaluation. However, the correct scoping is that |
Just digged a wee-bit deeper because I was curious, and it turns out that |
Indeed, the issue is then that Is this how it's supposed to work or is this a bug? The scoping is indeed correct and the Thanks for checking! |
I marked this as stale due to inactivity. → More info |
This is not stale, and still a problem. It seems that, in |
Describe the bug
nix build
&nix develop --build
behaves differently in case of dune packages that appears to be counter-intuitive.With this flake.nix,
nix build
succeeds whilenix develop --build
fails due to missing dependencies.In this example
blip
&urps
are both the names of flake inputs, and are also package names inprevOcamlPackages
, which is brought into scope on line 35.When they are referenced on line 59-60, they mean different things in
nix build
&nix develop
:nix build
they refer to packages fromprevOcamlPackages
nix develop
they refer to the flake inputsUpdate: the issue is due to
nix develop --build
runsmake
(which in turn runsdune build
, building all packages),while
nix build
runsdune build -p p2p
which doesn't require these inputsExpected behavior
The same behaviour is expected in both cases.
Steps To Reproduce
Run
nix build
&nix develop --build
nix (Nix) 2.4pre20201205_a5d85d0
The text was updated successfully, but these errors were encountered: