buildRustPackage: use cargoHash from finalAttrs#472287
buildRustPackage: use cargoHash from finalAttrs#472287Prince213 wants to merge 1 commit intoNixOS:masterfrom
Conversation
|
This is a significant change as it shapes the |
|
It is not very productive to just say "there are things to consider." Of course there, but what are the alternatives? What are you preferred alternatives? Use your words rather than just saying "we need consensus." That is why I closed my last PR you commented on as I am very tired of Nixpkgs reviewers with unhelpful, unproductive comments. Please, inform us what the alternatives are. |
|
@RossSmyth You are right; I should provide alternatives to make the review constructive. Thank you for sharing the reason behind your closing PR and help me improve my reviewing. @Prince213 I apologize for blocking this PR with non-informative review. Here are some options I could think of:
|
|
Ideally we'd allow overriding both |
9918f7f to
2073159
Compare
So we are limiting the overrideAttrs interface to |
|
From my perspective, if the attr is passed to mkDerivation, then I'd default to reading it from In effect, the attr is already overridable. We're just asking whether other parts of the package should read the original value or the final value. |
I'm rather new to this field so please take my words with a grain of salt. My anticipation is that we do the following:
|
Please use
The problem is, if we reference |
I think that also works. But it will be under
I don't think I quite understand this. The definition we have here for
Please elaborate. |
|
The GitHub UI refuses to let me comment on some non-changing code sections, so I'll explain it here: Here is the initial definition of nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix Lines 104 to 130 in cdb722f The expresions after each It is totally fine to reference Since the choice (and switching) of candidates happens before the overriding (tricky, but it's how |
More discussion needed. Still approve of the concept.
| else if cargoLock != null then | ||
| importCargoLock cargoLock | ||
| else if args.cargoHash or null == null then | ||
| else if finalAttrs.cargoHash == null then |
There was a problem hiding this comment.
The closest solution to override cargoHash at the main package and override the rest of cargoDeps attributes at cargoDeps is to
- Select the candidate using the initial attribute
- Define the cargo vendor candidate with
finalAttrs.cargoHash.
| else if finalAttrs.cargoHash == null then | |
| else if cargoHash == null then |
There was a problem hiding this comment.
@Prince213 What do you think? Some people seems to be asking for this feature on Discord again.
https://discourse.nixos.org/t/overriding-version-cant-find-new-cargohash/31502/10
There was a problem hiding this comment.
I'll look into this later in the day.
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Related to #415397.
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.