Commit 14292229 authored by Silvan Mosberger's avatar Silvan Mosberger
Browse files

check-by-name: Don't use -I in shebang

Original commit from https://github.com/NixOS/nixpkgs/pull/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.
parent 9c149d28
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
#!/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

+1 −1
Original line number Diff line number Diff line
#!/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