-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Respect global config.cudaSupport #224068
Respect global config.cudaSupport #224068
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Woohoo! Yeah there's really no excuse for packages not to be using the |
862e963
to
4dd5676
Compare
@samuela @ConnorBaker here goes the more controversial one: should we make a |
Maybe let's save that for a future PR? Is there not a situation in which someone might want |
Then they'd explicitly set |
Now, this time I don't understand what ofborg is saying. How do I reproduce this error? |
f9701be
to
941117e
Compare
Result of |
misclick |
Result of 188 packages failed to build:
284 packages built:
|
…espect global defaults
'cudaSupport ? false' -> 'cudaSupport ? config.cudaSupport or false' to respect global defaults Packages expressions that take `cudaSupport ? false` are likely to ignore `config.cudaSupport`. Instead, we want them to make `cudaSupport` a required argument, or to explicitly refer to `config`
941117e
to
a17baa5
Compare
Eliminate uses of `config.cudaSupport or false` and alike, since the option is now declared in config.nix with a default value fd .nix -t f -x sed 's/config\.cudaSupport or false, cudaPackages [?] [{][}]/config.cudaSupport, cudaPackages ? { }/' '{}' -i fd .nix -t f -x sed 's/config\.cudaSupport or false/config.cudaSupport/' '{}' -i fd .nix -t f -x sed 's/cudaSupport = pkgs.config.cudaSupport/inherit (pkgs.config) cudaSupport/' '{}' -i fd .nix -t f -x sed 's/cudaSupport = config.cudaSupport/inherit (config) cudaSupport/' '{}' -i
Revisiting this PR after a while:
Only a few changes in this PR were manual. These include the option declaration, and the ucx fix (#239182) which wasn't required until we made ucx respect This PR does not introduce anything like |
I'm not sure I understand... we already have |
An option definition in |
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.
diff LGTM
Result of |
Great work @SomeoneSerge! Merging. |
Result of 85 packages marked as broken and skipped:
160 packages failed to build:
430 packages built:
|
Description of changes
Make nixpkgs respect
config.cudaSupport
to reduce divergence in outPaths caused by out-of-tree overlays.Also proposing a new practice: require derivations to consume
config
and writecudaSupport ? config.cudaSupport
, instead of checkingconfig
outside inall-packages.nix
or such.Rationale: we had quite a few packages not respecting
config.cudaSupport
, resulting in people (including me) adopting overlays that "fix" them. Overlays mean diverging hashes, which means we can't share cache. The easiest way to check if there are packages that don't respectconfig.cudaSupport
is to grep:❯ ag 'enableCuda \? false'
. Checkingconfig
inall-packages.nix
means grep produces false-positivesTBD: add links to example overlays, but some are SomeoneSerge/nixpkgs-unfree, and there are more in NixOS-QChem, and
numtide/nixpkgs-unfree
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/
)CC @NixOS/cuda-maintainers