diff options
author | Justin Humm <justin.humm@posteo.de> | 2018-08-20 20:30:02 +0200 |
---|---|---|
committer | Symphorien Gibol <symphorien+git@xlumurb.eu> | 2018-09-11 23:44:14 +0200 |
commit | b66ef28841319bf1a281bde4e97c82458839a483 (patch) | |
tree | 629b15bb6db4f470acbfe88b98894dbaaadd7259 /doc | |
parent | cb8fb7e71ba7b99321156027934cc96fdf0f0ad7 (diff) | |
download | nixlib-b66ef28841319bf1a281bde4e97c82458839a483.tar nixlib-b66ef28841319bf1a281bde4e97c82458839a483.tar.gz nixlib-b66ef28841319bf1a281bde4e97c82458839a483.tar.bz2 nixlib-b66ef28841319bf1a281bde4e97c82458839a483.tar.lz nixlib-b66ef28841319bf1a281bde4e97c82458839a483.tar.xz nixlib-b66ef28841319bf1a281bde4e97c82458839a483.tar.zst nixlib-b66ef28841319bf1a281bde4e97c82458839a483.zip |
buildRustPackage, fetchcargo: optionally use vendor config from cargo-vendor
By setting useRealVendorConfig explicitly to true, the actual (slightly modified) config generated by cargo-vendor is used. This solves a problem, where the static vendor config in pkgs/build-support/rust/default.nix would not sufficiently replace all crates Cargo is looking for. As useRealVendorConfig (and writeVendorConfig in fetchcargo) default to false, there should be no breakage in existing cargoSha256 hashes. Nethertheless, imho using this new feature should become standard. A possible deprecation path could be: - introduce this patch - set useRealVendorConfig explicitly to false whereever cargoSha256 is set but migration is not wanted yet. - after some time, let writeVendorConfig default to true - when useRealVendorConfig is true everywhere cargoSha256 is set and enough time is passed, `assert cargoVendorDir == null -> useRealVendorConfig;`, remove old behaviour - after some time, remove all appearences of useRealVendorConfig and the parameter itself
Diffstat (limited to 'doc')
-rw-r--r-- | doc/languages-frameworks/rust.section.md | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/doc/languages-frameworks/rust.section.md b/doc/languages-frameworks/rust.section.md index 6588281878a0..737759fd8bd8 100644 --- a/doc/languages-frameworks/rust.section.md +++ b/doc/languages-frameworks/rust.section.md @@ -42,7 +42,8 @@ rustPlatform.buildRustPackage rec { sha256 = "0y5d1n6hkw85jb3rblcxqas2fp82h3nghssa4xqrhqnz25l799pj"; }; - cargoSha256 = "0q68qyl2h6i0qsz82z840myxlnjay8p1w5z7hfyr8fqp7wgwa9cx"; + cargoSha256 = "194lzn9xjkc041lmqnm676ydgbhn45xx9jhrhz6lzlg99yr6b880"; + useRealVendorConfig = true; meta = with stdenv.lib; { description = "A fast line-oriented regex search tool, similar to ag and ack"; @@ -64,6 +65,14 @@ When the `Cargo.lock`, provided by upstream, is not in sync with the added in `cargoPatches` will also be prepended to the patches in `patches` at build-time. +The `useRealVendorConfig` parameter tells cargo-vendor to include a Cargo +configuration file in the fetched dependencies. This will fix problems with +projects, where Crates are downloaded from non-crates.io sources. Please note, +that currently this parameter defaults to `false` only due to compatibility +reasons, as setting this to `true` requires a change in `cargoSha256`. +Eventually this distinction will be deprecated, so please always set +`useRealVendorConfig` to `true` and make sure to recompute the `cargoSha256`. + To install crates with nix there is also an experimental project called [nixcrates](https://github.com/fractalide/nixcrates). |