-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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-derivation.nix: warn that meta.available is deprecated #227342
Conversation
pkg.meta.available is deprecated (see subsequent commit which adds a warning) and does not distinguish between the buildPlatform and the hostPlatform.
pkg.meta.available is deprecated (see subsequent commit which adds a warning) and does not distinguish between the buildPlatform and the hostPlatform.
pkg.meta.available is deprecated (see subsequent commit which adds a warning) and does not distinguish between the buildPlatform and the hostPlatform.
Deprecate `meta.available` and recommend `lib.meta.availableOn stdenv.hostPlatform` instead. `meta.available` is affected by impure environment variables like NIXPKGS_ALLOW_NONSOURCE. It's okay for environment variables like that to cause a build to fail, but if we start switching dependencies in and out based on meta.available we can get builds that succeed differently when you flip those on. This actually happened to me shortly after I started using allowNonSource=false, and it was a total nightmare to debug: #179648 Despite the similar-sounding name, lib.meta.availableOn doesn't have this problem. It is unaffected by impure environment variables and config.allowXYZ preferences. #227120 (comment)
Can you figure out why ofborg and Hydra evaluate I think this change is best to have in after branch-off to give downstream and us a bit of time to deal with any unforeseen consequences. A changelog entry is also a good idea. |
I think it's this line in Line 263 in b75b059
Another alternative that I came up with after writing this would be for |
Yes definitely. This is a candidate for the "okay to break stuff" window right after the release. |
As far as I can tell, |
Description of changes
Deprecate
meta.available
and recommendlib.meta.availableOn stdenv.hostPlatform
instead.meta.available
is affected by impure environment variables likeNIXPKGS_ALLOW_NONSOURCE
. It's okay for environment variables like that to cause a build to fail, but if we start switching dependencies in and out based onmeta.available
we can get builds that succeed differently when you flip those on.This actually happened to me shortly after I started using
allowNonSource=false
, and it was a total nightmare to debug: #179648Despite the similar-sounding name,
lib.meta.availableOn
doesn't have this problem. It is unaffected by impure environment variables andconfig.allowXYZ
preferences. It only checksmeta.{platforms,badPlatforms}
.#227120 (comment)
Also adds three commits which change the (only) three uses of
meta.available
in nixpkgs to uselib.meta.availableOn
instead.Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)