Skip to content

fix(nix): move build tools from buildInputs to nativeBuildInputs#1047

Closed
t4min0 wants to merge 1 commit intoRightNow-AI:mainfrom
t4min0:fix/nix-build-tools-native-build-inputs
Closed

fix(nix): move build tools from buildInputs to nativeBuildInputs#1047
t4min0 wants to merge 1 commit intoRightNow-AI:mainfrom
t4min0:fix/nix-build-tools-native-build-inputs

Conversation

@t4min0
Copy link
Copy Markdown
Contributor

@t4min0 t4min0 commented Apr 12, 2026

Summary

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.

Changes

  • openssl: stays in buildInputs (runtime linkage dependency)
  • clang, perl, pkg-config: moved to new nativeBuildInputs (build-time tools that must be on $PATH)
  • No code changes, flake.nix only

Testing

  • cargo clippy --workspace --all-targets -- -D warnings passes
  • cargo test --workspace passes
  • Live integration tested (if applicable)

Security

  • No new unsafe code
  • No secrets or API keys in diff
  • User input validated at boundaries

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.
@jaberjaber23
Copy link
Copy Markdown
Member

Superseded by #1063, which does everything this PR does (move clang/perl/pkg-config to nativeBuildInputs) plus fixes the openfang-desktop GTK/tray runtime closure with wrapGAppsHook3 + libayatana-appindicator + the preFixup LD_LIBRARY_PATH wrapping required for a working NixOS tray. Closing in favor of #1063. Thanks @t4min0 for kicking this off — your change is effectively included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] nix build fails on v0.5.4+: native-tls vendored feature requires perl missing from flake buildInputs

2 participants