Skip to content
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: allow patches to fix Cargo.lock #44981

Merged
merged 2 commits into from Aug 14, 2018

Conversation

Ekleog
Copy link
Member

@Ekleog Ekleog commented Aug 13, 2018

Motivation for this change

Version that should work of #44967

I have checked building a package that requires it (#44968) and a project that uses dynamic patches (rustracer). rustracer's hashes appear to not have changed, so I guess it's alright :)

cc @Mic92 @LnL7

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@LnL7
Copy link
Member

LnL7 commented Aug 13, 2018

Did you verify with --check?

@symphorien
Copy link
Member

Maybe document cargoPatches in doc/languages-frameworks/rust.section.md ?

@Ekleog
Copy link
Member Author

Ekleog commented Aug 14, 2018

@LnL7 I don't know how to verify with --check for the cargo dependencies. However, I did test by changing one character from cargoSha256, and check the error'd output hash was actually the previous hash.

@symphorien Good point, done!

@@ -59,6 +59,10 @@ all crate sources of this package. Currently it is obtained by inserting a
fake checksum into the expression and building the package once. The correct
checksum can be then take from the failed build.

When there is an error in the `Cargo.lock` provided by upstream, it is possible
Copy link
Member

@Mic92 Mic92 Aug 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the `Cargo.lock` file, provided by upstream, is not in sync with the `Cargo.toml` it is possible to use `cargoPatches` to update it.

@@ -59,6 +59,10 @@ all crate sources of this package. Currently it is obtained by inserting a
fake checksum into the expression and building the package once. The correct
checksum can be then take from the failed build.

When there is an error in the `Cargo.lock` provided by upstream, it is possible
to use `cargoPatches` to fix this up. All patches added in `cargoPatches` will
also be prepended to the patches in `patches` for build-time.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at build-time

@Ekleog
Copy link
Member Author

Ekleog commented Aug 14, 2018

Thanks! fixed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants