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

treewide: use runtimeShell instead of stdenv.shell whenever possible #56408

Merged
merged 1 commit into from Feb 26, 2019

Conversation

@Mic92
Copy link
Member

@Mic92 Mic92 commented Feb 26, 2019

Whenever we create scripts that are installed to $out, we must use runtimeShell
in order to get the shell that can be executed on the machine we create the
package for. This is relevant for cross-compiling. The only use case for
stdenv.shell are scripts that are executed as part of the build system.
Usages in checkPhase are borderline however to decrease the likelyhood
of people copying the wrong examples, I decided to use runtimeShell as well.

Motivation for this change
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"

    Only vessel and worldofgoo cannot be tested since they require files that I do not have.

  • 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)

  • Assured whether relevant documentation is up to date

  • Fits CONTRIBUTING.md.


@FRidh
Copy link
Member

@FRidh FRidh commented Feb 26, 2019

This is in line with a1a5ea5 where checkInputs were made native.

@FRidh
Copy link
Member

@FRidh FRidh commented Feb 26, 2019

By the way, how come this is not an attribute of stdenv?

@tobim
Copy link
Contributor

@tobim tobim commented Feb 26, 2019

Could probably also be done for ccls and cquery.

@Mic92
Copy link
Member Author

@Mic92 Mic92 commented Feb 26, 2019

@FRidh from my understanding only packages needed for build are in stdenv like coreutils, the build shell and the compiler.

Whenever we create scripts that are installed to $out, we must use runtimeShell
in order to get the shell that can be executed on the machine we create the
package for. This is relevant for cross-compiling. The only use case for
stdenv.shell are scripts that are executed as part of the build system.
Usages in checkPhase are borderline however to decrease the likelyhood
of people copying the wrong examples, I decided to use runtimeShell as well.
@Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Feb 26, 2019

Woo! Marked that this should definitely go to 19.03 too.

@Ericson2314 Ericson2314 merged commit 8293ab8 into NixOS:master Feb 26, 2019
10 checks passed
@Mic92 Mic92 deleted the runtime-shell branch Feb 27, 2019
dotlambda added a commit that referenced this issue Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment