-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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-shell
: look up shell.nix
when argument is a directory
#11057
nix-shell
: look up shell.nix
when argument is a directory
#11057
Conversation
afbe7c3
to
6959ac1
Compare
6959ac1
to
d5e16f6
Compare
d5e16f6
to
c4a20a4
Compare
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 is a great fix! I've ran into the problem a couple of times, it's one of the thousand paper cuts.
It is unclear to me why this worked when not in a VM test, but the explanation would be in the part of nix-shell we're getting rid of with the devShell attribute.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-07-08-nix-team-meeting-minutes/49099/1 |
@@ -317,7 +338,8 @@ static void main_nix_build(int argc, char * * argv) | |||
|
|||
auto sourcePath = lookupFileArg(*state, | |||
baseDir); | |||
auto resolvedPath = resolveExprPath(sourcePath); | |||
auto resolvedPath = | |||
isNixShell ? resolveShellExprPath(sourcePath) : resolveExprPath(sourcePath); |
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.
Maybe the condition should be: isNixShell
and no -A
was passed?
Motivation
Solve a long standing bug responsibly; see release note.
Users who have complicated
shell.nix
/default.nix
setups can opt out by settingnix-shell-always-looks-for-shell-nix
tofalse
.If they do, they'll be warned when the new behavior would be triggered.
Context
nix-shell .
behaves differently thannix-shell
#496shell.nix
from url #4529shell.nix
file #5431Priorities and Process
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.