From c22f0c7474e42cd4c45fc0db95adfae1b74f09f2 Mon Sep 17 00:00:00 2001 From: David Craven Date: Tue, 31 May 2016 20:30:19 +0200 Subject: [PATCH] Fix buildRustPackage edge cases 1. When multiple versions of the same package are required $revs is an array. 2. When cargo fetch is run it usually doesn't need a network connection. But when it does SSL_CERT_FILE isn't set. --- pkgs/build-support/rust/default.nix | 1 + pkgs/build-support/rust/fetch-cargo-deps | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/rust/default.nix b/pkgs/build-support/rust/default.nix index 6bacba73f1e7..b889c4f24583 100644 --- a/pkgs/build-support/rust/default.nix +++ b/pkgs/build-support/rust/default.nix @@ -44,6 +44,7 @@ in stdenv.mkDerivation (args // { export CARGO_HOME="$(realpath deps)" export RUST_LOG=${logLevel} + export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt # Let's find out which $indexHash cargo uses for file:///dev/null (cd $sourceRoot && cargo fetch &>/dev/null) || true diff --git a/pkgs/build-support/rust/fetch-cargo-deps b/pkgs/build-support/rust/fetch-cargo-deps index 4fbc53d1039e..54593994990f 100755 --- a/pkgs/build-support/rust/fetch-cargo-deps +++ b/pkgs/build-support/rust/fetch-cargo-deps @@ -147,7 +147,7 @@ EOF done # Create ad-hoc branches for the revs we need - echo "$revs" | while read rev; do + echo "$revs" | tr " " "\n" | while read -d " " rev; do echo "Creating git branch b_$rev $rev" git branch b_$rev $rev done