Skip to content

Commit 2b7b283

Browse files
authored
fix(nix): move build tools from buildInputs to nativeBuildInputs
perl, clang, and pkg-config are build-time tools that need to be on $PATH during cargo build. In Nix, nativeBuildInputs are added to $PATH; buildInputs are not (they go to $NIX_LDFLAGS for runtime linkage). With perl in buildInputs, the openssl-sys vendored build fails when the flake is consumed as an input from another flake: cargo:warning=configuring OpenSSL build: Command 'perl' not found. openssl stays in buildInputs (runtime linkage). clang, perl, pkg-config move to nativeBuildInputs (build tools, need $PATH). Follow-up to #966. Fixes #894 for flake consumers.
1 parent 6851bba commit 2b7b283

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

flake.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
}: {
2424
rust-project.src = lib.sources.cleanSource ./.;
2525
rust-project.defaults.perCrate.crane.args.buildInputs = with pkgs; [
26-
clang
2726
openssl
27+
];
28+
rust-project.defaults.perCrate.crane.args.nativeBuildInputs = with pkgs; [
29+
clang
2830
perl
2931
pkg-config
3032
];

0 commit comments

Comments
 (0)