Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

propagatedNativeBuildInputs does not propagate #64992

Closed
FRidh opened this issue Jul 17, 2019 · 7 comments · Fixed by #354341
Closed

propagatedNativeBuildInputs does not propagate #64992

FRidh opened this issue Jul 17, 2019 · 7 comments · Fixed by #354341
Labels
0.kind: regression Something that worked before working no longer 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@FRidh
Copy link
Member

FRidh commented Jul 17, 2019

Issue description

If I add e.g. a hook in propagatedNativeBuildInputs, then I expect it to be executed by reverse dependencies. This is not the case. Putting it in propagatedBuildInputs solves the issue, but that should break cross-compilation.

Related issue #37991

Steps to reproduce

Technical details

Please run nix-shell -p nix-info --run "nix-info -m" and paste the
results.

cc @Ericson2314

@FRidh FRidh added the 0.kind: regression Something that worked before working no longer label Jul 17, 2019
@FRidh FRidh added this to the 19.09 milestone Jul 18, 2019
@Ericson2314
Copy link
Member

propogated native build inputs only works if your dependency is in buildinputs, depsHostHost or depTargetTarget. Otherwise we have two -1 offset which sum to a negative -2 offset so the transitive dependency is "out of bounds".

@Ericson2314
Copy link
Member

propagatedBuildInputs looks correct to me because xfce4-dev-tools is a nativeBuildInput. propagatedBuildInputs . nativeBuildInputs = nativeBuildInput so to speak. My nativeBuildInput's run time is my build time.

@matthewbauer matthewbauer removed this from the 19.09 milestone Aug 15, 2019
@stale

This comment has been minimized.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 2, 2020
@roberth
Copy link
Member

roberth commented Mar 3, 2021

I also ran into this and I can confirm that propagatedBuildInputs works for my use case in hercules-ci-effects.
It also works with strictDeps = true; and the original issue has been resolved in 6b72364.

However, the documentation has the following example and says

X <--propagatedNativeBuildInputs-- Y <--nativeBuildInputs-- Z

If instead, package Z has nativeBuildInputs = [Y], then Z will be built as if it included X in the depsBuildBuild of package Z, because of the sum of the two -1 host offsets.

and

depsBuildBuild [...] Since these packages are able to be run at build-time, they are always added to the PATH

So I inferred that it would work, which it doesn't.

@Ericson2314 Did I misunderstand or is the documentation incorrect?

Perhaps this use case should be documented as an example of propagatedBuildInputs in the manual. Both my use case and the original one involve a package that bundles nativeBuildInputs by propagating them and both also define a setup hook script (although the setup script is not essential, it is does seem to form a pattern).

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 3, 2021
@roberth
Copy link
Member

roberth commented Jul 14, 2021

Maybe my proposal in #28327 (comment) helps here. Among other things I propose renaming buildInputs -> components and:

I also expect components to help with the intuition around propagation and setup hooks, the thought being: component builds are like my own build, so their propagation and setup hooks behave like my own.

@stale

This comment has been minimized.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label May 2, 2022
@roberth
Copy link
Member

roberth commented May 2, 2022

Needs at least docs.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label May 2, 2022
@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: regression Something that worked before working no longer 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants