Skip to content
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-wrapper should use runtimeShell, not $SHELL, for cross-compilation #50244

Merged
merged 1 commit into from Nov 13, 2018

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?

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants