1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-17 22:41:08 +01:00

Merge pull request #14778 from agucova/fix-macos-shebang-flakiness

test: add shebangs to shell.nix test scripts
This commit is contained in:
Sergei Zimmerman 2025-12-13 03:41:30 +00:00 committed by GitHub
commit bb718d20a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -106,14 +106,16 @@ let
foo = runCommand "foo" { } '' foo = runCommand "foo" { } ''
mkdir -p $out/bin mkdir -p $out/bin
echo 'echo ${fooContents}' > $out/bin/foo echo '#!${shell}' > $out/bin/foo
echo 'echo ${fooContents}' >> $out/bin/foo
chmod a+rx $out/bin/foo chmod a+rx $out/bin/foo
ln -s ${shell} $out/bin/bash ln -s ${shell} $out/bin/bash
''; '';
bar = runCommand "bar" { } '' bar = runCommand "bar" { } ''
mkdir -p $out/bin mkdir -p $out/bin
echo 'echo bar' > $out/bin/bar echo '#!${shell}' > $out/bin/bar
echo 'echo bar' >> $out/bin/bar
chmod a+rx $out/bin/bar chmod a+rx $out/bin/bar
''; '';
@ -126,7 +128,8 @@ let
# ruby "interpreter" that outputs "$@" # ruby "interpreter" that outputs "$@"
ruby = runCommand "ruby" { } '' ruby = runCommand "ruby" { } ''
mkdir -p $out/bin mkdir -p $out/bin
echo 'printf %s "$*"' > $out/bin/ruby echo '#!${shell}' > $out/bin/ruby
echo 'printf %s "$*"' >> $out/bin/ruby
chmod a+rx $out/bin/ruby chmod a+rx $out/bin/ruby
''; '';