buildRustPackage: factor out setting up .cargo/config to cargoSetupHook#112500
buildRustPackage: factor out setting up .cargo/config to cargoSetupHook#112500Mic92 merged 4 commits intoNixOS:stagingfrom
Conversation
FRidh
left a comment
There was a problem hiding this comment.
The hook is cargo/rust version dependent, not? Maybe then keep it as a part of rustPlatform so we don't mix rust/cargo versions in a build.
It should be, the hook is defined in |
Both. Note I did not have a closer look at |
efcfa55 to
84499a7
Compare
Changed the |
There was a problem hiding this comment.
With fetchCargoTarball we need to pass another attribute. Not important for this PR though.
There was a problem hiding this comment.
Hmpf, good point. We could change fetchCargoTarball to take cargoSha256/cargoHash instead, but that would make the argument non-canonical for a fetcher.
|
cc also @adisbladis @DavHau for feedback on how you intend to handle this in your Python tools. |
|
needs to target staging though |
|
/rebase-staging |
f373ede to
a3133d6
Compare
|
needs to be properly rebased onto staging though, some conflicts |
Mic92
left a comment
There was a problem hiding this comment.
Looks good to me too, but I have not tested it in depth.
This makes it possible to reuse this functionality as a hook in derivations that do not use buildRustPackage.
Use the new cargoSetupHook to set up Cargo vendoring, so that we do not need buildRustPackage anymore.
Backwards incompatible changes: Support for Python 2 has been removed. Note: This isn't a problem for Nixpkgs because pythonPackages.cryptography is frozen at version 3.3.2. Other important packaging changes: "Cryptography now incorporates Rust code. Users building cryptography themselves will need to have the Rust toolchain installed. Users who use an officially produced wheel will not need to make any changes. The minimum supported Rust version is 1.45.0."
a3133d6 to
198dd77
Compare
|
Fix merge conflict that occurred after merging staging-next. |
aaronjanse
left a comment
There was a problem hiding this comment.
Diff looks good. I'm excited!
|
Is this ready to merge? |
|
Started to testing with |
|
Follow-up for maturin in #112804. |
Motivation for this change
Factor out setting up .cargo/config from
buildRustPackageto a newcargoSetupHook. This makes it possible to reuse this functionality as a hook in derivations that do not usebuildRustPackage.As an example, the second commit uses
cargoSetupHookin thetokenizersPython package.Since I am not very familiar with hooks, I have first attempted to make a hook for setting up
.cargo/config. I can later also try to make other hooks, such ascargoBuild.CC @FRidh @Mic92
Built some Rust packages to check if there are any regressions.
Related issues:
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)