After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 780775 - meson projects fail to install with a flatpak runtime
meson projects fail to install with a flatpak runtime
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: plugins
Flatpak Nightly Channel
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-03-31 17:27 UTC by Giovanni Campagna
Modified: 2017-03-31 18:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
configuration: prepare configuration when changing runtimes (1.39 KB, patch)
2017-03-31 17:45 UTC, Christian Hergert
committed Details | Review

Description Giovanni Campagna 2017-03-31 17:27:33 UTC
If I open a meson project that does not have a flatpak builder .json file, and try to build against a flatpak runtime using the "Build Configuration" UI, meson still installs the binary in the host directory:

[0/1] Installing files.
Installing src/lol to /home/gcampagn/.var/app/org.gnome.Builder/cache/gnome-builder/install/lol/host/bin/lol

Subsequents attempts to run fail with it:
execvp lol: No such file or directory
Comment 1 Christian Hergert 2017-03-31 17:36:57 UTC
How did you even get it to Build? Did meson recently get put into the SDK?
Comment 2 Patrick Griffis (tingping) 2017-03-31 17:40:48 UTC
(In reply to Christian Hergert from comment #1)
> How did you even get it to Build? Did meson recently get put into the SDK?

Meson was indeed added to the freedesktop SDK recently.
Comment 3 Christian Hergert 2017-03-31 17:45:07 UTC
Created attachment 349068 [details] [review]
configuration: prepare configuration when changing runtimes

When changing the runtime, we might need to alter the installation prefix.
Comment 4 Giovanni Campagna 2017-03-31 17:45:55 UTC
(In reply to Christian Hergert from comment #1)
> How did you even get it to Build? Did meson recently get put into the SDK?

I don't know, it just did 
Comment 5 Giovanni Campagna 2017-03-31 17:46:28 UTC
Also bugzilla ate half my comment.
The rest was:

I guess SDKs that are missing the required build tools should not be offered as an option?
Or shouldn't instead Builder use the build tools from the host or from its own SDK (ie, the SDK/runtime used to run builder itself)?
At least for cross-platform tools like meson (or autoconf, valgrind, gdb, etc.) that would allow to build against "minimal" SDKs without losing access to some tools.
Comment 6 Christian Hergert 2017-03-31 17:47:40 UTC
Comment on attachment 349068 [details] [review]
configuration: prepare configuration when changing runtimes

We weren't calling the prepare_configuration() vfunc for the runtime, so the installation prefix was not updated.

This should ensure that the project gets rebuilt with /app as a prefix (Although you might need to click "Rebuild") and then the execve() will be able to find the binary.
Comment 7 Christian Hergert 2017-03-31 18:07:19 UTC
(In reply to Giovanni Campagna from comment #5)
> I guess SDKs that are missing the required build tools should not be offered
> as an option?

We could consider adding an IdeBuildSystem::supports_runtime(IdeRuntime*) vfunc so that it can check.

> Or shouldn't instead Builder use the build tools from the host or from its
> own SDK (ie, the SDK/runtime used to run builder itself)?
> At least for cross-platform tools like meson (or autoconf, valgrind, gdb,
> etc.) that would allow to build against "minimal" SDKs without losing access
> to some tools.

We cannot use the build tooling from the host when building in a runtime, because the host tooling will not be able to access files from the runtime. Meson on the host would configure to find pkgconfig/gcc/etc in different locations than they exist in the runtime.
Comment 8 Christian Hergert 2017-03-31 18:10:03 UTC
(In reply to Christian Hergert from comment #7)
> (In reply to Giovanni Campagna from comment #5)
> > I guess SDKs that are missing the required build tools should not be offered
> > as an option?
> 
> We could consider adding an IdeBuildSystem::supports_runtime(IdeRuntime*)
> vfunc so that it can check.

Actually, this would not be sufficient.

Because you can have your build system as a dependency in your manifest. Meson (pre-SDK addition) is one such example. Meson can be supported once the dependencies have been built.