← Back to issue list

feat(gnome): add cmake prefix path

View original Github issue

Metadata

Project
snapcraft
Number
#5461
Type
pull request
State
merged
Author
mr-cal
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #5461 (commit a3f33196f) added CMAKE_PREFIX_PATH=$CRAFT_STAGE/usr to the GNOME extension build environment, fixing #5272. Follow-up #5589 (d30f563a7) added the SDK usr prefix; shipped in snapcraft 8.10.1.

Resolution: closed resolved

Reason: The PR was merged and delivered the requested change: snapcraft/extensions/gnome.py now injects a CMAKE_PREFIX_PATH build-environment entry. Review was approved with 0 unresolved comments, and release notes (docs/release-notes/snapcraft-8-10.rst) document the GNOME extension pointing CMAKE_PREFIX_PATH at the SDK usr dir and the stage dir, with #5272 closed.

Evaluated by: mr-cal-bot

No scores available.

Issue body

- [x] Have you followed the [guidelines for contributing](https://github.com/canonical/snapcraft/blob/main/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] Have you successfully run `make lint`? - [x] Have you successfully run `make test`? --- Testing on a few snaps in the wild that use the gnome extension and have a part that uses `cmake`: | snap | builds? | | - | - | | [Parabolic](https://github.com/NickvisionApps/Parabolic/blob/main/snap/snapcraft.yaml) | ✅ | | [gnome-clocks](https://github.com/ubuntu/gnome-clocks/blob/stable/snapcraft.yaml) | ✅ | | [gnome-chess](https://github.com/ubuntu/gnome-chess/blob/stable/snapcraft.yaml) | ✅ | | [telegram-desktop](https://github.com/telegramdesktop/tdesktop/blob/dev/snap/snapcraft.yaml) | ✅ | | [remmina](https://github.com/FreeRDP/Remmina/blob/master/snap/snapcraft.yaml) |❌ | | [handbrake](https://github.com/robxnano/handbrake-snap/blob/main/snapcraft.yaml) | ✅ | | [multipass](https://github.com/marceloneppel/multipass/blob/main/snap/snapcraft.yaml) |✅ | | [warzone 2100](https://github.com/Warzone2100/warzone2100/blob/master/snapcraft.yaml) |✅ | This breaks snaps that: * use the gnome extension * build a part with the cmake plugin and define `cmake-parameters: [-DCMAKE_PREFIX_PATH=...]` What happens is that the gnome extension adds a `build-environment: [CMAKE_PREFIX_PATH: ...]`. CMake appears to merge both values rather than one overriding the other ([source](https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html)). I was able to fix [Remmina](https://github.com/FreeRDP/Remmina/blob/master/snap/snapcraft.yaml) with this change: ```diff parts: remmina: plugin: cmake ... cmake-parameters: - -DCMAKE_BUILD_TYPE=Release - -DWITH_FREERDP3=ON - -DWITH_KF5WALLET=ON - -DWITH_GVNC=ON - -DWITH_X2GO=ON - -DWITH_PYTHON=ON - - -DCMAKE_PREFIX_PATH=$CRAFT_STAGE/usr - -DSNAP_BUILD=on # XXX: This is an hack to have a kind of bind-mount with absolute prefix. - -DCMAKE_INSTALL_PREFIX=/snap/$CRAFT_PROJECT_NAME/current/usr + build-environment: + - CMAKE_PREFIX_PATH: $CRAFT_STAGE/usr ``` Fixes #5272 (SNAPCRAFT-1024)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #5461 (commit a3f33196f) added CMAKE_PREFIX_PATH=$CRAFT_STAGE/usr to the GNOME extension build environment, fixing #5272. Follow-up #5589 (d30f563a7) added the SDK usr prefix; shipped in snapcraft 8.10.1.
stealth/space-bunny-alpha — closed resolved Merged in canonical/snapcraft#5461 (a3f33196f), adding CMAKE_PREFIX_PATH to the GNOME extension to resolve CMake parameter conflicts; #5589 later corrected the prefix to include usr.
qwen/qwen3.6-35b-a3b — — Merged to resolve #5272. Injects CMAKE_PREFIX_PATH into the GNOME extension environment to prevent conflicts with part-level cmake parameters, fixing build failures for affected snaps like Remmina.
qwen3.6-35b-a3b-mtp-q6 — — Merged. Moves CMAKE_PREFIX_PATH to the GNOME extension's build-environment to prevent CMake from merging conflicting values. Fixes snap builds failing when using custom cmake-parameters with the GNOME extension. Resolves #5272.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/snapcraft#5272 (confidence 95%)

    The bug report this PR fixes; PR body states "Fixes #5272 (SNAPCRAFT-1024)".

  • Likely Fixed By: canonical/snapcraft#5589 (confidence 90%)

    Merged follow-up (d30f563a7) correcting #5461's prefix to include the SDK's usr dir; released in snapcraft 8.10.1.

Related issues

Issue Project State Summary Similarity
#5589 fix(gnome): update cmake prefix path snapcraft merged Merged PR #5589 (commit d30f563a7) fixed the GNOME extension's CMAKE_PREFIX_PATH to point at $CRAFT_STAGE/usr and the SDK snap's usr dir, a follow-up to #5272; released in snapcraft 8.10.1.
93%
#5272 CMAKE_PREFIX_PATH is not set with gnome extenstion snapcraft closed GNOME/KDE extension CMAKE_PREFIX_PATH handling was corrected by merged PR #5589 (d30f563a7), adding stage and SDK usr prefixes; released in Snapcraft 8.10.1.
81%
#5515 feat(gnome): Add SNAPCRAFT_GNOME_SDK env snapcraft merged Merged PR #5515 (commit 0e880534e) adds a SNAPCRAFT_GNOME_SDK build-environment variable to the GNOME extension, exposing the SDK snap path (/snap/gnome-XX-XXXX-sdk/current/); documented in gnome extension docs and the 8.13 release notes.
78%
#2098893 CMAKE_PREFIX_PATH is not set with gnome extenstion snapcraft (launchpad) closed Fixed by merged PR snapcraft#5589 (d30f563a7), correcting the GNOME extension’s CMAKE_PREFIX_PATH to include /usr; initial support was added in #5461 (a3f33196f).
76%
#5310 fix: Fix cmake prefix path and remove invalid cmake root path. snapcraft merged Merged as 9cb3f5155, fixing KDE Neon CMake prefix handling and removing an invalid CMake root path in Snapcraft 8.8; fixes #5302.
71%
#5514 extensions/gnome: Add sdk include directories to C_INCLUDE_PATH snapcraft open Adds GNOME SDK header paths to C_INCLUDE_PATH and updates tests/docs. Most CI passes, but maintainers say it could break stable core24 builds and should wait for Snapcraft 9/core26.
70%
#5585 fix: kde-neon: Append usr to cmake prefix path #5272 snapcraft merged Merged as e2daf4cbe: PR #5585 updates KDE Neon CMAKE_PREFIX_PATH entries to use SDK usr subdirectories, fixing #5272; released in Snapcraft 8.10.1.
70%