-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
buildRustPackage: refactor to support finalAttrs pattern #354999
base: master
Are you sure you want to change the base?
Conversation
12b63e7
to
bba2752
Compare
a9bea81
to
639e245
Compare
cfe8797
to
7552eb6
Compare
4b14c19
to
dd7fb2e
Compare
16d8715
to
3b3a29b
Compare
3a08c15
to
975a1c1
Compare
975a1c1
to
c5634bc
Compare
7241897
to
3bc378a
Compare
3bc378a
to
94fe111
Compare
I'm not sure why you believe this. PRs to Check the closed PRs for many, many more examples: https://github.com/NixOS/nixpkgs/issues?q=label%3A%2210.rebuild-linux%3A+5001%2B%22+is%3Aclosed The
We should assume that it's on a case-by-case basis, and that 5001+ rebuilds is definitely not too many. |
94fe111
to
c306e6f
Compare
I was not planning on splitting this up. But also, I was not planning on pointing this at master, since it's unnecessary load on the builders. And also, many people would not be able to use the cache for a time on master because of this. Merging into master is understandable in case of important security fixes, which this is not. |
Also, this is a duplicate of #194475, which has at least been reviewed to some extent. |
Yes, see the first line of this PR. This PR is slightly better in the sense that it allows overriding the There were a few things I disliked about that PR: First, is the way it first passes and "invalid" attrset (still has Second, (this is mostly just an issue I had with the current builder), it still had the many "unnecesary" defaults. These are present to be able to pass something to the fetchers. I used the custom |
c306e6f
to
892378f
Compare
892378f
to
cab083b
Compare
Oops, sorry, my bad 🤦♀️ |
Quoting the contributing guide:
And while the definition of mass rebuilds is not "formally defined", the guide does give us a marker for it by saying:
So while yes, this is on a case-by case (such as in the Regarding this patch specifically, it is causing rebuilds of every Rust package and it's dependents -- totaling up to over 31k packages -- for something that doesn't actually change the behavior of binaries. I think Toma was correct in targeting staging here |
Context: The rules are not applied strictly, to allow security sensitive prs go to master directly. The linked pr was fixing High Severity security issues (that allowed RCE). I assume that there everyone would agree that it should not merged to staging to receive the update in 2-3 weeks. non security sensitive mass rebuilds in general should target staging, in the past such prs also have been reverted in the past (when merged directly to master) to not let hydra eat full rebuilds |
I'll rebase onto staging once this PR is reviewed.
Supersedes #194475
Supersedes #288430
Supersedes #340798
Related:
finalAttrs
support #331398 (not perfect, IMO).overridePythonAttrs
to also worry about...)This PR refactors the
buildRustPackage
wrapper aroundmkDerivation
to support thefinalAttrs
pattern better.A non-goal was having 0 rebuilds.
The rebuilds are because of more attrs actually being passed to
mkDerivation
, improving overridability without having to add an extra.overrideRustAttrs
utility, which would complicate things a lot.Other than just being able to do something like
you'll also be able to override derivations much easier:
cargoLock
is something that can only be insidepassthru
, since it can't be converted to a string.Because of this, the input
cargoLock
is moved topassthru.cargoLock
.This means overriding is a bit painful, but at least it's possible.
This means that to override a package that uses
cargoLock
to usecargoHash
, you will need to setpassthru.cargoLock
to null:You may also just override
cargoDeps
directly, like you would have done before this PRNote:
I dislike the following function pattern:
{ name ? "default", ... }@attrs: args // { inherit name; } // modifiedAttrs
I used the following instead:
attrs: defaultValues // lib.removeAttrs attrs namesToDelete // modifiedAttrs
This means that we lose the
functionArgs
information, but I think the current version is more readable.Also
functionArgs
only makes sense if the input tobuildRustPackage
is not a function-recursive attrset.Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.