-
-
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
Make #!nix-shell
arguments and options relative to script
#11058
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When writing a shebang script, you expect your path to be relative to the script, not the cwd. We previously handled this correctly for relative file paths, but not for expressions. This handles both -p & -E args. My understanding is this should be what we want in any cases I can think of - people run scripts from many different working directories. @edolstra is there any reason to handle -p args differently in this case? Fixes NixOS#4232
…' into more-nix-shell
github-actions
bot
added
documentation
with-tests
Issues related to testing. PRs with tests have some priority
labels
Jul 6, 2024
roberth
added
bug
breaking
Changes we can't make without breaking old expressions, changing hashes, etc
labels
Jul 6, 2024
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.
roberth
changed the title
More nix shell
Make nix shell shebang arguments and options relative to script
Jul 10, 2024
roberth
changed the title
Make nix shell shebang arguments and options relative to script
Make Jul 10, 2024
#!nix-shell
arguments and options relative to script
fricklerhandwerk
approved these changes
Jul 11, 2024
src/libcmd/compatibility-settings.hh
Outdated
// Added in Nix 2.24, July 2024. | ||
Setting<bool> nixShellShebangArgumentsRelativeToScript{ | ||
this, true, "nix-shell-shebang-arguments-relative-to-script", R"( | ||
Before Nix 2.24, the arguments in a `nix-shell` shebang - as well as `--arg` - were relative to working directory. |
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.
Suggested change
Before Nix 2.24, the arguments in a `nix-shell` shebang - as well as `--arg` - were relative to working directory. | |
Before Nix 2.24, arguments in a `nix-shell` shebang - as well as `--arg` - referring to file system locations were relative to working directory. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-07-17-nix-team-meeting-minutes-162/49255/1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
breaking
Changes we can't make without breaking old expressions, changing hashes, etc
bug
cli
The old and/or new command line interface
documentation
with-tests
Issues related to testing. PRs with tests have some priority
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Fix and finish #5088.
Add an opt out similar to #11057.
Context
This is a merge of
nix-shell
: look upshell.nix
when argument is a directory #11057Priorities and Process
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.