Skip to content

Commit

Permalink
Revert "rust: store the cargo-vendor config"
Browse files Browse the repository at this point in the history
This reverts commit 0af2c58.

See 0af2c58#commitcomment-26737983
This breaks the cargoSha256 hashes.
  • Loading branch information
globin committed Jan 9, 2018
1 parent 86a45e0 commit 7c5430c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions pkgs/build-support/rust/cargo-vendor.nix
Expand Up @@ -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;

Expand Down
24 changes: 15 additions & 9 deletions pkgs/build-support/rust/default.nix
Expand Up @@ -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
mkdir -p .cargo
# inherit cargo config from the deps, rewrite the target directory
cat $cargoDeps/.config | sed "s|REPLACEME|$cargoDeps|g" > .cargo/config
unpackFile "$cargoDeps"
cargoDepsCopy=$(stripHash $(basename $cargoDeps))
chmod -R +w "$cargoDepsCopy"
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
Expand Down
10 changes: 2 additions & 8 deletions pkgs/build-support/rust/fetchcargo.nix
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/rust/default.nix
Expand Up @@ -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
Expand Down

0 comments on commit 7c5430c

Please sign in to comment.