Skip to content

Commit

Permalink
check-by-name: Don't use -I in shebang
Browse files Browse the repository at this point in the history
Original commit from NixOS/nixpkgs#282226,
message:

Running CI locally is broken becauses the `-I` argument:

- Clobbers $NIX_PATH
- Is wrong for two reasons:
  - Has too many `..` elements, relative to the script's location
  - Isn't relative to the script's location (as with *.nix files),
    since shell scripts and POSIX in general interpret paths
    relative to the current working directory, not the canonical
    path of argv[0]
- Is inconsistent, since this script has symlinks pointing at it
  from different depths in the repository

There is no way to set this flag statically in a way that will work
everywhere.  The caller needs to use $NIX_PATH, or the script needs
to take the `-I` value as an argument.

This commit deletes the static `-I` flag.
  • Loading branch information
infinisil committed Jan 29, 2024
1 parent c6f4ce0 commit 1bc20fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/run-local.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p jq -I nixpkgs=../../../..
#!nix-shell -i bash -p jq

set -o pipefail -o errexit -o nounset

Expand Down
2 changes: 1 addition & 1 deletion scripts/update-pinned-tool.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p jq -I nixpkgs=../../../..
#!nix-shell -i bash -p jq

set -o pipefail -o errexit -o nounset

Expand Down

0 comments on commit 1bc20fb

Please sign in to comment.