GNOME Software doesn't build

Hey guys! I’m following a tutorial to learn how to contribute to GNOME but my first try to build and app (GNOME Software) fails with the following error:

Found pkg-config: /usr/bin/pkg-config (1.8.0)
Run-time dependency gio-2.0 found: YES 2.73.3
Run-time dependency gio-unix-2.0 found: YES 2.73.3
Run-time dependency glib-2.0 found: YES 2.73.3
Run-time dependency gobject-2.0 found: YES 2.73.3
Run-time dependency expat found: YES 2.4.8
Has header "expat.h" with dependency expat: YES 
Checking for function "XML_ParserCreate" with dependency expat: YES 
Found CMake: /usr/bin/cmake (3.24.0)
Run-time dependency mozjs-91 found: NO (tried pkgconfig and cmake)

../meson.build:151:2: ERROR: Dependency "mozjs-91" not found, tried pkgconfig and cmake

A full log can be found at /run/build/polkit/_flatpak_build/meson-logs/meson-log.txt
Error: module polkit: Child process exited with code 1

I’m using GNOME Builder IDE. Other apps such as GNOME Calendar builds correctly. I checked this mozjs-91 package and it’s installed in my system (Arch Linux) as js91. I also tried building the app on another system (Fedora 36) with the same result.

By the way, I tried to open the full log which according to the error is located in /run/build/polkit/_flatpak_build/meson-logs/meson-log.txt but there is not such file.

Thank you!

pkg-config is looking for mozjs-91.pc (don’t know cmake), which is probably installed by a devel package. You may well need other devel packages!

I think Builder is building ‘Software’ in a flatpak sandbox like it does for every other app.

Try running

meson setup _build
meson compile -C _build

manually in a terminal and see if it builds successfully.

Thanks for the reply! The first command fails but with a different error:

Run-time dependency flatpak found: YES 1.12.7
Run-time dependency ostree-1 found: YES 2022.5
WARNING: pkgconfig variable 'soupapiversion' not defined for dependency flatpak.

meson.build:235:4: ERROR: Problem encountered: flatpak was built against a different API of libsoup. 2.4 instead of 3.0.

Is GNOME Builder installed as a flatpak or it it a native package?

If you are building the latest development version of ‘Software’, I would recommend building it inside Builder installed from GNOME nightly flatpak remote.

I installed the nightly flatpak version but the error is still there:

Dependency "mozjs-91" not found, tried pkgconfig and cmake

The command that GNOME Builder runs when building is this one:

flatpak-builder --arch=x86_64 --ccache --force-clean --disable-updates --disable-download --state-dir /home/daniel/.var/app/org.gnome.Builder.Devel/cache/gnome-builder/flatpak-builder --stop-at=gnome-software /home/daniel/.var/app/org.gnome.Builder.Devel/cache/gnome-builder/projects/gnome-software/flatpak/staging/x86_64-main /home/daniel/Projects/gnome-software/contrib/org.gnome.

gjs migrated to mozjs-102, so the previously used mozjs-91 is no longer pulled into the runtime.

The GNOME Software manifest needs to be updated to either

  • bundle mozjs91 as well
  • don’t bundle polkit and use the version provided by the runtime

I don’t know why the Software flatpak bundles its own polkit build, so I can’t tell which of those options is more appropriate.

I suggest filing an issue in gitlab.

Thanks for the info! I just filled an issue in the project’s Gitlab.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.