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
gettext: remove cross suffix from envHook #50881
Conversation
`role_post` is meant for cross compilation, eg. `CC_FOR_BUILD` and `CC_FOR_TARGET`. There's no such concept for `GETTEXTDATADIRS`. In particular we hit this with `cantarell-fonts`, where only `GETTEXTDATADIRS_FOR_BUILD` is defined due to empty buildInputs. see NixOS#50855
The short answer is our gettext needs to be extended with this concept, rather than abandoning it. Don't worry, it should just be a simple wrapper script. I'm surprised that build even uses gettext since so binaries are produced. That should be investigated too. There may also be an opportunity to patch the fonts to fox the same issue. (I'm also improving cross support for meson, but as gettext doesn't seem to be automatically handled by it, at least in this case without C code (right?), I don't that that will help just yet.) |
I can get to fixing all that this weekend, perhaps |
gettext is being used to produce some appstream data: https://hydra.nixos.org/build/84539462/log
|
Does it really matter how gettext data is built? Isn’t it the same everywhere? |
It's not how the data is built, it's what it's used for. 99% gettext is just used in the outputs, I.e runtime stuff. Here, since it's a build input, it's used for a build time thing, which is confusing. Gettext is also confused because there is a library component and executable component. That executable component is acting as a depsBuildBuild here. |
It would be good to maintain a list of common packages in our documentation and where they belong ( |
I think we could make a flow chart on this. But basically it comes down to:
These are not mutually exclusive though. In some cases we will need more than one version of a software (native built vs. cross built). |
These are less clear than the FAQ, but actually exhaustive.
This is in fact what the cross complication section of the manual says, in longer terms that no one wants to read. I have no problem with the convenience FAQ, but in the odd cases people have to full back on the full principles. |
gettext is both a tool and a library ( |
I believe a note on pkgconfig should be added somewhere. If pkgconfig is used just for compiling (ie autoconf), it should go into nativeBuildInputs. On the other hand, if it is a library which generates .pc, than it should go into propagatedNativeBuildInputs because there will be a ref to pkgconfig. |
I summarized it in the wiki: https://nixos.wiki/wiki/Cross_Compiling#How_to_specify_dependencies |
Are there modernized equivalents to |
Those should be okay to use still. There was an issue in the disallowedReferences logic that means you really can’t use it on propagated inputs. All propagated inputs end up in the nix-support directory due to how the propagation logic works. Eventually i would like to handle propagation in Nix eval but it’s not a huge prio. |
@Mic92 the modernized equivalences don't actually exist, as I didn't want to create two ways to do the same thing / start a renaming battle right off the bat. But they would be, respectively, |
I don't think it's worth propagating pkgconfig. There are multiple ways to resolve libraries, so just because a package supports pkgconfig, doesn't mean it won't also support .cmake or plain old LDFLAGS. |
Yes that's true. |
Are there any updates on this pull request, please? |
Thank you for your contributions.
|
Closing due to inactivity. Feel free to reopen the discussion. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/use-buildinputs-or-nativebuildinputs-for-nix-shell/8464/2 |
Motivation for this change
role_post
is meant for cross compilation, eg.CC_FOR_BUILD
andCC_FOR_TARGET
. There's no such concept forGETTEXTDATADIRS
.In particular we hit this with
cantarell-fonts
, where onlyGETTEXTDATADIRS_FOR_BUILD
is defined due to empty buildInputs.see #50855
cc @Ericson2314 as this was introduced in 2110c0b