Skip to content

Commit

Permalink
build: hack around cargo bug
Browse files Browse the repository at this point in the history
Work around cargo which likes to jail break...

Signed-off-by: Tiago Castro <[email protected]>
  • Loading branch information
tiagolobocastro committed Oct 31, 2024
1 parent 0f7321a commit 82ee588
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions nix/shell/rust.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ let
echo "Target debug dir : $RUST_TARGET_DEBUG"
'';

rustCargoFix = ''
if [ -d ~/.cargo/bin ]; then
# Adding ~/.cargo/bin to the path let's us carry on using rustup but it lowers its
# priority: https://github.com/rust-lang/cargo/pull/11023
export PATH=$PATH:~/.cargo/bin
fi
'';

configurations = {
# Stable Rust channel configuration.
stable = {
Expand All @@ -41,8 +49,7 @@ let

inherit shellEnv;

shellHook = ''
'';
shellHook = rustCargoFix;

shellInfoHook = ''
echo "Rust channel : stable"
Expand All @@ -58,8 +65,7 @@ let

inherit shellEnv;

shellHook = ''
'';
shellHook = rustCargoFix;

shellInfoHook = ''
echo "Rust channel : nightly (explicity selected)"
Expand Down Expand Up @@ -87,7 +93,7 @@ let
RUST_TARGET_DEBUG = "target/x86_64-unknown-linux-gnu/debug";
};

shellHook = ''
shellHook = rustCargoFix + ''
export LLVM_SYMBOLIZER_DIR=$(dirname $(realpath $(which llvm-symbolizer)))
'';

Expand Down

0 comments on commit 82ee588

Please sign in to comment.