Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Various fetchcargo improvements #74863
Motivation for this change
Most stdenv wrappers already work like this -- it allows greater customisation. We just have to be careful to remove arguments we're using that shouldn't be passed to stdenv. I've been conservative here, because fetchcargo checksums shouldn't change lightly.
If a custom unpackPhase is used for the package, it needs to also be used for fetchcargo so the same source is available for vendoring.
Can you provide an usecase example, how you would use this?
Sure. Here I use a custom unpackPhase for a Rust program that is very fussy about where it is on disk in relation to its dependencies. Without the changes in this PR, doing this isn't possible because fetchcargo doesn't know about the custom unpackPhase. https://spectrum-os.org/git/nixpkgs/tree/pkgs/os-specific/linux/chromium-os/crosvm/default.nix We have an open PR to add that package to Nixpkgs (#52353), and as you can see it has to do something much more complicated, using several intermediary src derivations, to work around this limitation of fetchcargo.