diff --git a/flake.nix b/flake.nix index 5a51737b..0493cf9e 100644 --- a/flake.nix +++ b/flake.nix @@ -54,7 +54,7 @@ name = "nac3artiq"; src = self; cargoLock = { lockFile = ./Cargo.lock; }; - nativeBuildInputs = [ pkgs.python3 llvm-nac3 ]; + nativeBuildInputs = [ pkgs.python3 llvm-nac3 pkgs.llvmPackages_13.clang-unwrapped ]; buildInputs = [ pkgs.python3 llvm-nac3 ]; cargoBuildFlags = [ "--package" "nac3artiq" ]; cargoTestFlags = [ "--package" "nac3ast" "--package" "nac3parser" "--package" "nac3core" "--package" "nac3artiq" ]; @@ -81,7 +81,7 @@ name = "nac3artiq-instrumented"; src = self; cargoLock = { lockFile = ./Cargo.lock; }; - nativeBuildInputs = [ pkgs.python3 llvm-nac3-instrumented ]; + nativeBuildInputs = [ pkgs.python3 llvm-nac3-instrumented pkgs.llvmPackages_13.clang-unwrapped ]; buildInputs = [ pkgs.python3 llvm-nac3-instrumented ]; cargoBuildFlags = [ "--package" "nac3artiq" "--features" "init-llvm-profile" ]; doCheck = false; @@ -119,7 +119,7 @@ name = "nac3artiq-pgo"; src = self; cargoLock = { lockFile = ./Cargo.lock; }; - nativeBuildInputs = [ pkgs.python3 llvm-nac3-pgo ]; + nativeBuildInputs = [ pkgs.python3 llvm-nac3-pgo pkgs.llvmPackages_13.clang-unwrapped ]; buildInputs = [ pkgs.python3 llvm-nac3-pgo ]; cargoBuildFlags = [ "--package" "nac3artiq" ]; cargoTestFlags = [ "--package" "nac3ast" "--package" "nac3parser" "--package" "nac3core" "--package" "nac3artiq" ]; @@ -140,7 +140,7 @@ name = "nac3artiq"; src = self; cargoLock = { lockFile = ./Cargo.lock; }; - nativeBuildInputs = [ pkgs.zip ]; + nativeBuildInputs = [ pkgs.zip pkgs.llvmPackages_13.clang-unwrapped ]; buildInputs = [ pkgs-mingw.zlib ]; configurePhase = '' @@ -185,6 +185,7 @@ clippy (packages.x86_64-linux.python3-mimalloc.withPackages(ps: [ ps.numpy ])) ]; + UNWRAPPED_CLANG = "${pkgs.llvmPackages_13.clang-unwrapped}/bin/clang"; }; hydraJobs = { diff --git a/nac3core/build.rs b/nac3core/build.rs index c4dcfc8e..d7f8cb41 100644 --- a/nac3core/build.rs +++ b/nac3core/build.rs @@ -10,6 +10,7 @@ fn main() { const FILE: &str = "src/codegen/irrt/irrt.c"; println!("cargo:rerun-if-changed={}", FILE); const FLAG: &[&str] = &[ + "--target=wasm32", FILE, "-O3", "-emit-llvm", @@ -20,7 +21,7 @@ fn main() { "-o", "-", ]; - let output = Command::new("clang") + let output = Command::new(env::var("UNWRAPPED_CLANG").unwrap_or_else(|_| "clang".into())) .args(FLAG) .output() .map(|o| {