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 commented Feb 26, 2019

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

@FRidh
Copy link
Member

FRidh commented Feb 26, 2019

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

@tobim
Copy link
Contributor

tobim commented Feb 26, 2019

Could probably also be done for ccls and cquery.

@Mic92
Copy link
Member Author

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 Ericson2314 added the 9.needs: port to stable A PR needs a backport to the stable release. label Feb 26, 2019
@Ericson2314
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: golang 6.topic: haskell 6.topic: pantheon The Pantheon desktop environment 6.topic: printing 6.topic: python 6.topic: steam Steam game store/launcher (store.steampowered.com) 6.topic: vim 8.has: documentation This PR adds or changes documentation 9.needs: port to stable A PR needs a backport to the stable release. 10.rebuild-darwin: 1-10 10.rebuild-linux: 11-100
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants