Skip to content

make-wrapper should use runtimeShell, not $SHELL, for cross-compilation#50244

Merged
matthewbauer merged 1 commit intoNixOS:stagingfrom
tathougies:travis/wrap-correctly
Nov 13, 2018
Merged

make-wrapper should use runtimeShell, not $SHELL, for cross-compilation#50244
matthewbauer merged 1 commit intoNixOS:stagingfrom
tathougies:travis/wrap-correctly

Conversation

@tathougies
Copy link
Contributor

Motivation for this change

make-wrapper.sh is used to wrap python programs (and others perhaps). Write now it uses the value of $SHELL to get the shell it should use to build its wrapper. However, this only works if the shell being used is the same one as the shell the script will be executed under. This assumption does not hold for cross-compilation. Without this patch, cross-compiled python scripts get a shebang asking to be executed using the build architecture's shell.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@tathougies tathougies changed the title make-wrapper should use runtimeShell, not bash, for cross-compilation make-wrapper should use runtimeShell, not $SHELL, for cross-compilation Nov 11, 2018
@grahamc
Copy link
Member

grahamc commented Nov 11, 2018

Seems too vague to be true: wrappers may be executed in the build context too. No?

@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels Nov 11, 2018
@tathougies
Copy link
Contributor Author

@grahamc sure, but you should be using buildPackages for wrappers that will be used in build context, in which case runtimeShell would be the build machine runtime shell.

Copy link
Member

@Ericson2314 Ericson2314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@Ericson2314 Ericson2314 changed the base branch from master to staging November 11, 2018 22:05
@Ericson2314
Copy link
Member

Switched to staging

@GrahamcOfBorg GrahamcOfBorg added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python Python is a high-level, general-purpose programming language. 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package labels Nov 11, 2018
@matthewbauer matthewbauer changed the base branch from staging to master November 13, 2018 19:54
@matthewbauer matthewbauer changed the base branch from master to staging November 13, 2018 19:54
@matthewbauer matthewbauer merged commit f9a6963 into NixOS:staging Nov 13, 2018
@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. and removed 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python Python is a high-level, general-purpose programming language. 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels Nov 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants