Skip to content

Commit

Permalink
fix: macos activation cargo vars
Browse files Browse the repository at this point in the history
  • Loading branch information
ruben-arts committed Nov 27, 2024
1 parent 7553b78 commit 2f1737f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 1 addition & 3 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ clang = ">=18.1.8,<19.0"
compilers = ">=1.6.0"
make = ">=4.3,<5"
mold = ">=2.33.0,<3.0"
[feature.build.target.linux-64.activation]
scripts = ["scripts/activate.sh"]
[feature.build.target.osx-arm64.activation]
[feature.build.target.unix.activation]
scripts = ["scripts/activate.sh"]
[feature.build.target.win-64.activation]
scripts = ["scripts/activate.bat"]
Expand Down
6 changes: 6 additions & 0 deletions scripts/activate.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/bash
set -Eeuo pipefail
export CARGO_TARGET_DIR="target/pixi"

# on linux we need to set these rust flags
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER="clang"
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS="-C link-arg=-fuse-ld=$CONDA_PREFIX/bin/mold"

# on macOS we need to set these rust flags
export CARGO_TARGET_X86_64_APPLE_DARWIN_RUSTFLAGS="-C link-arg=-Wl,-rpath,$CONDA_PREFIX/lib"
export CARGO_TARGET_AARCH64_APPLE_DARWIN_RUSTFLAGS="-C link-arg=-Wl,-rpath,$CONDA_PREFIX/lib"

0 comments on commit 2f1737f

Please sign in to comment.