Skip to content

Fix: materialize propagatedNativeBuildInputs file for runtimeInputs propagation#231

Merged
angerman merged 2 commits into
mainfrom
fix/propagate-runtimeInputs
Feb 25, 2026
Merged

Fix: materialize propagatedNativeBuildInputs file for runtimeInputs propagation#231
angerman merged 2 commits into
mainfrom
fix/propagate-runtimeInputs

Conversation

@angerman
Copy link
Copy Markdown
Collaborator

Summary

  • Fix the writeShellApplicationWithRuntime helper to actually write the $out/nix-support/propagated-native-build-inputs file

Root cause

writeShellApplication uses writeTextFile internally, which does not run stdenv.mkDerivation's fixupPhase. Setting propagatedNativeBuildInputs via overrideAttrs only adds the attribute to the derivation but never materializes the $out/nix-support/propagated-native-build-inputs file that setup.sh's findInputs reads at runtime.

Without this file, curl was invisible to the -env container shell environment — the wrapper script itself had curl on its internal PATH (via writeShellApplication's inline export PATH=...), but other programs in the environment (like GHC's stage0 cabal built from source) could not find it.

Fix

Explicitly create the nix-support/propagated-native-build-inputs file in postInstall.

Test plan

  • Hydra eval succeeds with 861 builds
  • Verify nix-support/propagated-native-build-inputs file exists in wrapper store path
  • GHC CI stage0 cabal can find curl for HTTPS hackage transport

@angerman angerman enabled auto-merge February 25, 2026 12:42
writeShellApplication uses writeTextFile internally, which does NOT
run stdenv.mkDerivation's fixupPhase. Setting propagatedNativeBuildInputs
via overrideAttrs only adds the attribute to the derivation but never
materializes the $out/nix-support/propagated-native-build-inputs file
that setup.sh's findInputs actually reads at runtime.

Without this file, curl was invisible to the shell environment despite
being set as a propagated dep — the wrapper script itself had curl on
its internal PATH, but other programs (like GHC's stage0 cabal) could
not find it.

Fix: explicitly create the nix-support file in postInstall.
writeTextFile sets `buildCommand` in the derivation, which causes
stdenv's genericBuild to skip the entire phase system — installPhase,
postInstall, fixupPhase — none of them execute. The previous commit
used postInstall which was silently ignored, leaving the wrapper
output without nix-support/propagated-native-build-inputs.

Append the file creation directly to buildCommand, which is the only
code path the builder actually runs.
@angerman angerman force-pushed the fix/propagate-runtimeInputs branch from 40d5f43 to ed23423 Compare February 25, 2026 12:42
@angerman angerman added this pull request to the merge queue Feb 25, 2026
Merged via the queue into main with commit 8cbcf3d Feb 25, 2026
14 of 55 checks passed
@angerman angerman deleted the fix/propagate-runtimeInputs branch February 25, 2026 12:50
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.

1 participant