Skip to content

Commit

Permalink
rustc: Add setup hook to set $CARGO_HOME
Browse files Browse the repository at this point in the history
This works around 'failed to open:
/homeless-shelter/.cargo/.package-cache' with Rust 1.36 even when
we're using 'cargo --frozen'.
  • Loading branch information
edolstra committed Jul 7, 2019
1 parent 2c0a6e1 commit 3372343
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkgs/development/compilers/rust/rustc.nix
Expand Up @@ -206,6 +206,8 @@ in stdenv.mkDerivation rec {
# https://github.com/rust-lang/rust/issues/30181
# enableParallelBuilding = false;

setupHooks = ./setup-hook.sh;

requiredSystemFeatures = [ "big-parallel" ];

meta = with stdenv.lib; {
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/compilers/rust/setup-hook.sh
@@ -0,0 +1,4 @@
# Fix 'failed to open: /homeless-shelter/.cargo/.package-cache' in rust 1.36.
if [[ -z $IN_NIX_SHELL && -z $CARGO_HOME ]]; then
export CARGO_HOME=$TMPDIR
fi

0 comments on commit 3372343

Please sign in to comment.