Snapcraft not handling cmake nested builds, not including build script files in snap, and dependency issues with meson builds
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
New
|
Undecided
|
Unassigned | ||
snapcraft (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
snapcraft, version 2.41+18.4.2
I am trying to build my first snap from a Github project, jangernert/
feedreader is a cmake-based project, with meson recently added on a testing branch. Snapcraft needs to download and build the latest valac in the snap because what comes on most distros is woefully out of date, including the Snapcraft build machine. Getting and building valac works fine with autotools.
But I have run into three issues trying different approaches:
Issue 1. I can’t simply let the cmake plugin in Snapcraft handle everything because it breaks down when encountering nested cmake files in the WebExtension submodule of the FeedReader project:
[ 11%] Built target gtkimageview
[ 11%] Linking C static library librss-glib.a
[ 11%] Building C object libVilistextum/
[ 11%] Building C object libVilistextum/
[ 11%] Built target i18n
[ 11%] Building C object libIvy/
[ 12%] Building C object libVilistextum/
[ 12%] Built target rss-glib
[ 12%] Linking C static library libvilistextum.a
[ 12%] Built target vilistextum
[ 12%] Linking C static library libgd.a
[ 12%] Built target gd
[ 13%] Linking C static library libivy.a
[ 13%] Built target ivy
[ 14%] Linking C shared library libwebextension.so
[ 14%] Built target webextension
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Failed to run 'make -j8' for 'feedreader': Exited with code 2.
Verify that the part is using the correct parameters and try again.
Issue 2. So I tried using the "build-override" scripting option in the cmake plugin to call cmake, make, and make install myself and that appears to build without the issue above. But none of the built libraries and binaries come over into staging or prime, even though I specify they should with snap:, which is what I described here. Other parts, specifically the latest valac built by the autotools plugin, do come over, just them in fact. So when you try to run this snap, it gives me a "feedreader" not found error because there are no feedreader files, just spiffy new valac files.
https:/
Issue 3. FeedReader also has upstream meson build features, so I pulled those in and tried using snapcraft’s meson plugin for a yaml here. But it fails with gcc, glibc, and zlib issues:
/snap/feedreade
/snap/
/snap/
/snap/
https:/
description: | updated |
description: | updated |
summary: |
- Snapcraft not handling cmake nested builds + Snapcraft not handling cmake nested builds and behaving unexpectedly |
summary: |
- Snapcraft not handling cmake nested builds and behaving unexpectedly + Snapcraft not handling cmake nested builds, not including build script + files in snap, and dependency issues with meson builds |
description: | updated |
Changed in snapcraft (Ubuntu): | |
status: | Incomplete → New |
Changed in snapcraft: | |
status: | Incomplete → New |
The snapcraft.yaml is here https:/ /github. com/sirredbeard /FeedReader/ commit/ 71b0c6757e1d5b9 b0b4bc91a4d0ab0 675517eee4
Most recent version: https:/ /github. com/sirredbeard /FeedReader/ blob/master/ snap/snapcraft. yaml
The make files generated by cmake build the web extension and whole project just fine.