Package builds in computer, but fails to build in Launchpad, with the error "msgfmt: cannot locate ITS rules"

Asked by Archisman Panigrahi on 2020-09-07

I am trying to build blanket with this packaging recipe https://code.launchpad.net/~apandada1/+recipe/blanket-daily

The same source builds successfully in my computer (Xubuntu 20.04), but it always fails in Launchpad.
Here is the full buildlog https://launchpadlibrarian.net/496616682/buildlog_ubuntu-focal-amd64.blanket_0.2.0-0~202009070627~ubuntu20.04.1_BUILDING.txt.gz

The relevant part of the buildlog is
```
Found ninja-1.10.0 at /usr/bin/ninja
   dh_auto_build
 cd obj-x86_64-linux-gnu && LC_ALL=C.UTF-8 ninja -j4 -v
[1/3] glib-compile-resources ../data/resources/blanket.gresource.xml --sourcedir ../data/resources --internal --generate --target data/resources/blanket.gresource --dependency-file data/resources/blanket.gresource.d
xml-stripblanks preprocessing requested, but XMLLINT is not set, and xmllint is not in PATH
[2/3] /usr/bin/meson --internal msgfmthelper ../data/com.rafaelmardojai.Blanket.desktop.in data/com.rafaelmardojai.Blanket.desktop desktop ../data/../po
[3/3] /usr/bin/meson --internal msgfmthelper ../data/com.rafaelmardojai.Blanket.metainfo.xml.in data/com.rafaelmardojai.Blanket.metainfo.xml xml ../data/../po
FAILED: data/com.rafaelmardojai.Blanket.metainfo.xml
/usr/bin/meson --internal msgfmthelper ../data/com.rafaelmardojai.Blanket.metainfo.xml.in data/com.rafaelmardojai.Blanket.metainfo.xml xml ../data/../po
msgfmt: cannot locate ITS rules for ../data/com.rafaelmardojai.Blanket.metainfo.xml.in
ninja: build stopped: subcommand failed.
```

Similar packages like foliate and lollypop (both using meson build system, and have similar debian directory structure) build successfully in Launchpad. I am unsure why the build failed for blanket. I have added libappstream-glib-dev to the "build-depends" in the control file, but that did not help.

How to fix this?

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Solved by:
Colin Watson
Solved:
2020-09-08
Last query:
2020-09-08
Last reply:
2020-09-08
Ioana Lasc (ilasc) said : #1

Hi

The relevant line in the build log ("msgfmt: cannot locate ITS rules") indicates a dependency issue, please have a look at
https://github.com/bilelmoussaoui/nautilus-git/issues/25 and similar search results.

To reliably replicate the exact environment locally you should be building locally on Ubuntu Focal - same as the Launchpad builder.

Colin Watson (cjwatson) said : #2

I'd also recommend specifically testing locally using sbuild (https://wiki.ubuntu.com/SimpleSbuild). This is particularly important for problems that might be related to missing build-dependencies, because it gives you a clean environment that has only build-essential packages plus your declared build-dependencies installed.

I tried to build it in a clean chroot environment using pbuilder (I have not tried Sbuild), and the build fails with the same error.

I have added the package libappstream-glib-dev to build depends (as suggested in https://github.com/bilelmoussaoui/nautilus-git/issues/25#issuecomment-309259170, installing the package libappstream-glib-devel works in OpenSuse) but that did not work in the proot environment (and also in Launchpad).

In my computer, the debian package builds successfully even without libappstream-glib-dev.

I have opened an issue in the upstream repository (https://github.com/rafaelmardojai/blanket/issues/21), but the developer could not say how to fix it (because the package builds locally for the developer and also for me).

I have built packages similar to Blanket (e.g. Foliate, https://code.launchpad.net/~apandada1/+recipe/foliate-stable) in Launchpad, and Foliate builds successfully (the build-dependencies are almost the same).

For Foliate, the build dependencies are "debhelper-compat (= 10), gettext, meson (>= 0.40), pkg-config, libglib2.0-dev (>= 2.54), gjs", while for Blanket they are "debhelper-compat(=10), gettext, meson (>= 0.50), pkg-config, libglib2.0-dev" (as previously mentioned, I added libappstream-glib-dev to build depends, but that did not help).

So I cannot say that this is really due to missing build-depends.

Best Colin Watson (cjwatson) said : #4

I tried building your package locally in sbuild and reproduced the exact same error as on Launchpad. I strongly suggest that you use sbuild rather than pbuilder to reproduce build failures on Launchpad; there can occasionally be slight differences between them which can be relevant.

You're missing a Build-Depends on appstream (not libappstream-glib-dev), which provides the appropriate ITS locator rule for translations of *.metainfo.xml. After that I ran into a test failure when validating the appstream file, but perhaps you can work that out for yourself once you've reproduced it locally.

Yes, it builds in pbuilder after adding appstream. I guess it would build in Launchpad as well.

I had been trying random dependencies to fix it for the last three days. Thank you very much.

I will fix the validation issue of the appstream file.

Thanks Colin Watson, that solved my question.

It got built in Launchpad as well.