3
0
Fork 0
forked from mirrors/nixpkgs

Revert "rust: store the cargo-vendor config"

This reverts commit 0af2c5891b.

See 0af2c5891b (commitcomment-26737983)
This breaks the cargoSha256 hashes.
This commit is contained in:
Robin Gloster 2018-01-09 15:03:03 +01:00
parent 86a45e0308
commit 7c5430c27c
No known key found for this signature in database
GPG key ID: D5C458DF6DD97EDF
4 changed files with 20 additions and 20 deletions

View file

@ -2,11 +2,11 @@
let
inherit (stdenv) system;
version = "0.1.13";
version = "0.1.12";
hashes = {
x86_64-linux = "1znv8hm4z4bfb6kncf95jv6h20qkmz3yhhr8f4vz2wamynklm9pr";
x86_64-darwin = "0hcib4yli216qknjv7r2w8afakhl9yj19yyppp12c1p4pxhr1qr6";
x86_64-linux = "1hxlavcxy374yypfamlkygjg662lhll8j434qcvdawkvlidg5ii5";
x86_64-darwin = "1jkvhh710gwjnnjx59kaplx2ncfvkx9agfa76rr94sbjqq4igddm";
};
hash = hashes. ${system} or badSystem;

View file

@ -43,15 +43,21 @@ in stdenv.mkDerivation (args // {
postUnpack = ''
eval "$cargoDepsHook"
if [[ ! -f $cargoDeps/.config ]]; then
echo "ERROR: file not found: $cargoDeps/.config"
echo "try updating the cargoSha256"
exit 1
fi
unpackFile "$cargoDeps"
cargoDepsCopy=$(stripHash $(basename $cargoDeps))
chmod -R +w "$cargoDepsCopy"
mkdir -p .cargo
# inherit cargo config from the deps, rewrite the target directory
cat $cargoDeps/.config | sed "s|REPLACEME|$cargoDeps|g" > .cargo/config
mkdir .cargo
cat >.cargo/config <<-EOF
[source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
replace-with = 'vendored-sources'
[source.vendored-sources]
directory = '$(pwd)/$cargoDepsCopy'
EOF
unset cargoDepsCopy
export RUST_LOG=${logLevel}
export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt

View file

@ -22,15 +22,9 @@ stdenv.mkDerivation {
export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
cargo vendor --locked | tee result.txt
cargo vendor
mkdir $out
# keep the outputted cargo config but remove the target directory.
# the target directory should be $out but that should change the sha256
cat result.txt | sed "s|directory = \".*|directory = \"REPLACEME\"|" > $out/.config
cp -ar vendor/* $out/
cp -ar vendor $out
'';
outputHashAlgo = "sha256";

View file

@ -32,7 +32,7 @@ rec {
cargo = callPackage ./cargo.nix rec {
version = "0.23.0";
srcSha = "14b2n1msxma19ydchj54hd7f2zdsr524fg133dkmdn7j65f1x6aj";
cargoSha256 = "1mcqv45l0d1gw8v3v48gm1902xckj6r0s8l1z46nbmrsjs34rzhx";
cargoSha256 = "1sj59z0w172qvjwg1ma5fr5am9dgw27086xwdnrvlrk4hffcr7y7";
inherit rustc; # the rustc that will be wrapped by cargo
inherit rustPlatform; # used to build cargo