Fix: materialize propagatedNativeBuildInputs file for runtimeInputs propagation#231
Merged
Conversation
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.
40d5f43 to
ed23423
Compare
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
writeShellApplicationWithRuntimehelper to actually write the$out/nix-support/propagated-native-build-inputsfileRoot cause
writeShellApplicationuseswriteTextFileinternally, which does not runstdenv.mkDerivation's fixupPhase. SettingpropagatedNativeBuildInputsviaoverrideAttrsonly adds the attribute to the derivation but never materializes the$out/nix-support/propagated-native-build-inputsfile thatsetup.sh'sfindInputsreads at runtime.Without this file, curl was invisible to the
-envcontainer shell environment — the wrapper script itself had curl on its internal PATH (viawriteShellApplication's inlineexport 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-inputsfile inpostInstall.Test plan
nix-support/propagated-native-build-inputsfile exists in wrapper store path