From e54812c3c5f27861b19c95b245f464389ea8d178 Mon Sep 17 00:00:00 2001 From: Hermes Date: Fri, 19 Jun 2026 12:13:37 -0400 Subject: [PATCH] fix: add native gcc for clamav Rust build scripts in cross-compile --- flake.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index 63d4bc2..51af370 100644 --- a/flake.nix +++ b/flake.nix @@ -193,13 +193,11 @@ "-Dtest_run_result=0" "-Dtest_run_result__TRYRUN_OUTPUT=" ]; - # Rust proc-macro build scripts need a native linker; cmake overrides - # CC/CXX to the cross-compiler, confusing cargo. Set CC to native gcc - # so proc-macros can compile and run on the build host. - preConfigure = (old.preConfigure or "") + '' - export CC=gcc - export CXX=g++ - ''; + # Give cargo access to a native C compiler for Rust build script + # compilations (proc-macros run on the BUILD host, not the target). + nativeBuildInputs = (old.nativeBuildInputs or []) ++ [ + prev.buildPackages.gcc + ]; }); };