GNOME Bugzilla – Bug 780775
meson projects fail to install with a flatpak runtime
Last modified: 2017-03-31 18:10:03 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
How did you even get it to Build? Did meson recently get put into the SDK?
(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.
Created attachment 349068 [details] [review] configuration: prepare configuration when changing runtimes When changing the runtime, we might need to alter the installation prefix.
(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
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 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.
(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.
(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.