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

cantarell-fonts build broken (GNOME 3 dependency) #50855

Closed
wizeman opened this issue Nov 20, 2018 · 8 comments
Closed

cantarell-fonts build broken (GNOME 3 dependency) #50855

wizeman opened this issue Nov 20, 2018 · 8 comments
Labels
0.kind: bug Something is broken 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: cross-compilation Building packages on a different platform than they will be used on

Comments

@wizeman
Copy link
Member

wizeman commented Nov 20, 2018

Issue description

On the release-18.09 branch, the cantarell-fonts package fails to build with the following errors:

building
build flags: -j4 -l4
[1/1] Generating org.gnome.cantarell.metainfo.xml_merge with a custom command.
FAILED: appstream/org.gnome.cantarell.metainfo.xml
/nix/store/hy65mn4wjswqih75gfr6g4q3xgqdm325-python3-3.6.6/bin/python3.6m /nix/store/0wrv6cips8sfzk04ca67w6vlsgy4lb3z-meson-0.46.1/bin/meson --internal msgfmthelper ../appstream/org.gnome.cantarell.metainfo.xml.in appstream/org.gnome.cantarell.metainfo.xml xml ../appstream/./
msgfmt: cannot locate ITS rules for ../appstream/org.gnome.cantarell.metainfo.xml.in
ninja: build stopped: subcommand failed.
builder for '/nix/store/52vznnzqs7iz60w7a2wln0xg13w5nkhg-cantarell-fonts-0.100.drv' failed with exit code 1
error: build of '/nix/store/52vznnzqs7iz60w7a2wln0xg13w5nkhg-cantarell-fonts-0.100.drv' failed

Steps to reproduce

Change the hash in pkgs/data/fonts/cantarell-fonts/default.nix and then:
nix-build '<nixpkgs>' -A cantarell-fonts

Technical details

Hydra has a successful build of the cantarell-fonts package cached as of September 3rd (due to cantarell-fonts being a fixed-output derivation), but if you force it to build locally it will fail.

As far as I can tell, the build fails because the GETTEXTDATADIRS environment variable is not defined. Instead, there is a GETTEXTDATADIRS_FOR_BUILD variable defined (but it's not being used?).

If I add the following line to the cantarell-fonts/default.nix file it will build successfuly:

  preBuild = ''export GETTEXTDATADIRS="$GETTEXTDATADIRS_FOR_BUILD"'';

However, I'm pretty sure that this isn't the correct solution.

This seems related to #33524, #33458 and #40139.

cc @Ericson2314

@jtojnar jtojnar mentioned this issue Nov 20, 2018
9 tasks
@hedning
Copy link
Contributor

hedning commented Nov 20, 2018

I'm guessing role_post actually shouldn't be used here as gettext doesn't have a concept of GETTEXTDATADIRS_FOR_BUILD, as opposed to eg. CC_FOR_BUILD which is used for cross compilation:

addToSearchPath "GETTEXTDATADIRS${role_post}" "$1/share/gettext"

Just like it's not used in gobject-introspection's setup-hook as there's no concept of GI_TYPELIB_PATH_FOR_BUILD:

addToSearchPath GI_TYPELIB_PATH $1/lib/girepository-1.0

Not sure why we're hitting this only with cantarell though.

@jtojnar
Copy link
Member

jtojnar commented Nov 20, 2018

Most packages that need its rules probably pick it up from XDG_DATA_DIRS where the share directory is added by gobjectIntrospection setup hook. nautilus-sendto and cantarell-fonts do not use that setup hook.

@jtojnar
Copy link
Member

jtojnar commented Nov 20, 2018

Weird, nautilus-sendto has somehow the variable set:

unpacking sources
unpacking source archive /nix/store/4aj92q4ai50y1alfk8iwjjln0j8haf17-nautilus-sendto-3.8.6.tar.xz
source root is nautilus-sendto-3.8.6
setting SOURCE_DATE_EPOCH to timestamp 1502278258 of file nautilus-sendto-3.8.6/src/nautilus-sendto.metainfo.xml.in
patching sources
configuring
preConfigure=env | grep GETTEXTDATADIRS
GETTEXTDATADIRS=/nix/store/m7qkvrfxjfz68nqc4bywjg2nkazlml2b-gettext-0.19.8.1/share/gettext:/nix/store/b6l82p13kmn3bjcx1kan4l1vn3bd271w-glib-2.58.1/share/gettext:/nix/store/y1g563q2gsk1s9ivn4svc9wfyhn0p8y1-gtk+3-3.24.1/share/gettext:/nix/store/3sy9kxsywhld7qdliwmqwbxaaa38364h-appstream-glib-0.7.14/share/gettext:/nix/store/m7qkvrfxjfz68nqc4bywjg2nkazlml2b-gettext-0.19.8.1/share/gettext:/nix/store/b6l82p13kmn3bjcx1kan4l1vn3bd271w-glib-2.58.1/share/gettext:/nix/store/m7qkvrfxjfz68nqc4bywjg2nkazlml2b-gettext-0.19.8.1/share/gettext:/nix/store/b6l82p13kmn3bjcx1kan4l1vn3bd271w-glib-2.58.1/share/gettext:/nix/store/y1g563q2gsk1s9ivn4svc9wfyhn0p8y1-gtk+3-3.24.1/share/gettext:/nix/store/3sy9kxsywhld7qdliwmqwbxaaa38364h-appstream-glib-0.7.14/share/gettext:/nix/store/m7qkvrfxjfz68nqc4bywjg2nkazlml2b-gettext-0.19.8.1/share/gettext:/nix/store/b6l82p13kmn3bjcx1kan4l1vn3bd271w-glib-2.58.1/share/gettext
GETTEXTDATADIRS_FOR_BUILD=/nix/store/m7qkvrfxjfz68nqc4bywjg2nkazlml2b-gettext-0.19.8.1/share/gettext:/nix/store/b6l82p13kmn3bjcx1kan4l1vn3bd271w-glib-2.58.1/share/gettext:/nix/store/y1g563q2gsk1s9ivn4svc9wfyhn0p8y1-gtk+3-3.24.1/share/gettext:/nix/store/3sy9kxsywhld7qdliwmqwbxaaa38364h-appstream-glib-0.7.14/share/gettext:/nix/store/m7qkvrfxjfz68nqc4bywjg2nkazlml2b-gettext-0.19.8.1/share/gettext:/nix/store/b6l82p13kmn3bjcx1kan4l1vn3bd271w-glib-2.58.1/share/gettext:/nix/store/m7qkvrfxjfz68nqc4bywjg2nkazlml2b-gettext-0.19.8.1/share/gettext:/nix/store/b6l82p13kmn3bjcx1kan4l1vn3bd271w-glib-2.58.1/share/gettext:/nix/store/y1g563q2gsk1s9ivn4svc9wfyhn0p8y1-gtk+3-3.24.1/share/gettext:/nix/store/3sy9kxsywhld7qdliwmqwbxaaa38364h-appstream-glib-0.7.14/share/gettext:/nix/store/m7qkvrfxjfz68nqc4bywjg2nkazlml2b-gettext-0.19.8.1/share/gettext:/nix/store/b6l82p13kmn3bjcx1kan4l1vn3bd271w-glib-2.58.1/share/gettext:/nix/store/m7qkvrfxjfz68nqc4bywjg2nkazlml2b-gettext-0.19.8.1/share/gettext:/nix/store/b6l82p13kmn3bjcx1kan4l1vn3bd271w-glib-2.58.1/share/gettext:/nix/store/y1g563q2gsk1s9ivn4svc9wfyhn0p8y1-gtk+3-3.24.1/share/gettext:/nix/store/3sy9kxsywhld7qdliwmqwbxaaa38364h-appstream-glib-0.7.14/share/gettext:/nix/store/m7qkvrfxjfz68nqc4bywjg2nkazlml2b-gettext-0.19.8.1/share/gettext:/nix/store/b6l82p13kmn3bjcx1kan4l1vn3bd271w-glib-2.58.1/share/gettext

@jtojnar jtojnar added 0.kind: bug Something is broken 6.topic: cross-compilation Building packages on a different platform than they will be used on labels Nov 20, 2018
@hedning
Copy link
Contributor

hedning commented Nov 20, 2018

Ok, looks like the plain variant is only added if buildInputs is defined (adding eg. glib to buildInputs fixes the build).

@hedning
Copy link
Contributor

hedning commented Nov 20, 2018

Hmm, so gobject-introspection's envHook might actually cause problems for cross compilation, at least when combined with wrapGAppsHook, as stuff in nativeBuildInput could end up in the wrappers.

While gettext should probably be safe, as that's all done at compile time?

@jtojnar
Copy link
Member

jtojnar commented Nov 20, 2018

I think it should not matter for cross-compilation, as /share typically contains architecture-independent data. There might be some problem with over-detecting dependencies #32293
We might fix it with #32790

hedning added a commit to hedning/nixpkgs that referenced this issue Nov 21, 2018
`GETTEXTDATADIRS` isn't populated correctly due to empty buildInputs. Borrow from
`GETTEXTDATADIRS_FOR_BUILD` until we fix gettext's envHook.

see: NixOS#50855
hedning added a commit to hedning/nixpkgs that referenced this issue Nov 21, 2018
`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
hedning added a commit that referenced this issue Nov 21, 2018
`GETTEXTDATADIRS` isn't populated correctly due to empty buildInputs. Borrow from
`GETTEXTDATADIRS_FOR_BUILD` until we fix gettext's envHook.

see: #50855
hedning added a commit to hedning/nixpkgs that referenced this issue Nov 22, 2018
`GETTEXTDATADIRS` isn't populated correctly due to empty buildInputs. Borrow from
`GETTEXTDATADIRS_FOR_BUILD` until we fix gettext's envHook.

see: NixOS#50855
hedning added a commit that referenced this issue Nov 22, 2018
`GETTEXTDATADIRS` isn't populated correctly due to empty buildInputs. Borrow from
`GETTEXTDATADIRS_FOR_BUILD` until we fix gettext's envHook.

see: #50855
jtojnar pushed a commit that referenced this issue Nov 30, 2018
`GETTEXTDATADIRS` isn't populated correctly due to empty buildInputs. Borrow from
`GETTEXTDATADIRS_FOR_BUILD` until we fix gettext's envHook.

see: #50855
coreyoconnor pushed a commit to coreyoconnor/nixpkgs that referenced this issue Dec 9, 2018
`GETTEXTDATADIRS` isn't populated correctly due to empty buildInputs. Borrow from
`GETTEXTDATADIRS_FOR_BUILD` until we fix gettext's envHook.

see: NixOS#50855
@stale
Copy link

stale bot commented Jun 3, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

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

This is definitely fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: cross-compilation Building packages on a different platform than they will be used on
Projects
None yet
Development

No branches or pull requests

4 participants