.. | ||
build-rust-crate | ||
patch-registry-deps | ||
cargo-vendor-normalise.py | ||
carnix.nix | ||
crates-io.nix | ||
default-crate-overrides.nix | ||
default.nix | ||
fetchcargo-default-config.toml | ||
fetchcargo.nix | ||
fetchCargoTarball.nix | ||
fetchcrate.nix | ||
README.md |
Updated fetchCargo behavior
Changes to the fetchcargo.nix
behavior that cause changes to the cargoSha256
are somewhat disruptive, so historically we've added conditionals to provide
backwards compatibility. We've now accumulated enough of these that it makes
sense to do a clean sweep updating hashes, and delete the conditionals in the
fetcher to simplify maintenance and implementation complexity. These
conditionals are:
-
When cargo vendors dependencies, it generates a config. Previously, we were hard-coding our own config, but this fails if there are git dependencies. We have conditional logic to sometimes copy the vendored cargo config in, and sometimes not.
-
When a user updates the src package, they may forget to update the
cargoSha256
. We have an opt-in conditional flag to add theCargo.lock
into the vendor dir for inspection and compare at build-time, but it defaults to false. -
We were previously vendoring into a directory with a recursive hash, but would like to vendor into a compressed tar.gz file instead, for the reasons specified in the git commit message adding this feature.
Migration plan
-
(DONE in this PR) Implement
fetchCargoTarball
as a separate, clean fetcher implementation along-sidefetchcargo
. RenameverifyCargoDeps
(default false) tolegacyCargoFetcher
(default true), which switches the fetcher implementation used. ReplaceverifyCargoDeps = true;
withlegacyCargoFetcher = false;
in Rust applications. -
Send a treewide Rust PR that sets
legacyCargoFetcher = true;
in all Rust applications not using this (which is ~200 of them), with a note to maintainers to delete if updating the package. Change the default inbuildRustPackage
to false. -
Go through all Rust src packages deleting the
legacyCargoFetcher = false;
line and re-computing thecargoSha256
, merging as we go. -
Delete the
fetchcargo.nix
implementation entirely and also remove:
- All overrides in application-level packages
- The
fetchcargo-default-config.toml
and conditionals around using it when no$CARGO_CONFIG
exists - This README.md file