Skip to content

Commit e15d9c5

Browse files
mayastor-borsurso
andcommitted
Merge #1905
1905: build(nix): set clang path env var r=tiagolobocastro a=urso Sets CLANG_PATH environment variable in shell.nix to use Nix-provided clang compiler, preventing Rust tooling from falling back to potentially incompatible host system clang compiler. When clang is installed cargo might fallback to /usr/bin/clang instead of using the one setup by the shell.nix environment. Unfortunately, if the clang versions are incompatible, this might lead to errors when linking DPDK/SPDK crypto support with the io-engine. Explicitely setting CLANG_PATH ensure that the correct clang instance will be used. Note: I also did run into this problem even though PATH was set correctly and `which clang` did give me the correct path. Co-authored-by: Steffen Siering <[email protected]>
2 parents b430d00 + 8e1094f commit e15d9c5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

shell.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ let
6262
export PATH="$PATH:$(pwd)/scripts/nix-sudo"
6363
6464
export IO_ENGINE_DIR="$RUST_TARGET_DEBUG"
65+
66+
# Prevent Rust tooling to fallback to potentially incompatible host clang compiler
67+
export CLANG_PATH="$NIX_CC_FOR_TARGET/bin/clang"
6568
'';
6669

6770
shellInfoHook = ''

0 commit comments

Comments
 (0)