-
-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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: replace stdenv.is
with stdenv.hostPlatform.is
#341407
base: master
Are you sure you want to change the base?
Conversation
Undrafting to get reviews from probably all the To keep the emails to a minimum either approve or thumbs up the PR if the idea is okay, or if it needs changes then let's discuss in https://matrix.to/#/#stdenv:nixos.org |
Idea is OK, list of merge conflicts is scary. Maybe do this stepwise? |
@@ -32,7 +32,7 @@ pkgs.runCommand "nixpkgs-lib-tests-nix-${nix.version}" { | |||
nativeBuildInputs = [ | |||
nix | |||
pkgs.gitMinimal | |||
] ++ lib.optional pkgs.stdenv.isLinux pkgs.inotify-tools; | |||
] ++ lib.optional pkgs.stdenv.hostPlatform.isLinux pkgs.inotify-tools; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
] ++ lib.optional pkgs.stdenv.hostPlatform.isLinux pkgs.inotify-tools; | |
] ++ lib.optional pkgs.stdenv.buildPlatform.isLinux pkgs.inotify-tools; |
This probably applies to most conditionals for any nativeBuildInputs
.
Approve or thumbs up to show that you approve of the idea, or request changes on the first file to discuss why you don't think it's a good idea.
Join https://matrix.to/#/#stdenv:nixos.org to discuss
I'll reset to master and rerun the commands before merge.
Further replacements can be done in the PR where the warnings are added.
The commits can be added to
.git-blame-ignore-revs
in a separate PRtreewide: replace
stdenv.is
withstdenv.hostPlatform.is
In preparation for the deprecation of
stdenv.isX
.These shorthands are not conducive to cross-compilation because they
hide the platforms.
Darwin might get cross-compilation for which the continued usage of
stdenv.isDarwin
will get in the wayOne example of why this is bad and especially affects compiler packages
#343059
There are too many files to go through manually but a treewide should
get users thinking when they see a
hostPlatform.isX
in a place where itdoesn't make sense.
The rebuilds are due to
src ./.
or similarhttps://gist.github.com/Artturin/4cc1e73fc612cb7a79459a9bb6bc27a3