snapcraft changing pkgconfig .pc prefix is creating conflicts between parts
Metadata
Current evaluation
Resolved conflicting pkg-config prefix rewriting through snapcore/snapcraft PR #676, which a maintainer linked as the issue's resolution.
Resolution: closed resolved
Reason: Maintainer Sergiusens linked snapcore/snapcraft PR #676 as the fix, and the issue was subsequently closed. The direct PR link provides concrete evidence that the conflicting .pc-file behavior was addressed.
Evaluated by: mr-cal-bot
No scores available.
Issue body
You have 2 parts, shipping the same .pc file (from stage-packages or from source). snapcraft is changing their prefix in the ,pc file.
This results in a conflict when shipping in the staging directory as the prefix is different for each part:
...
Skipping build ffmpeg (already ran)
'upstream-src' has prerequisites that need to be staged: desktop/qt5 ffmpeg
Skipping pull desktop/qt5 (already ran)
Skipping pull ffmpeg (already ran)
Skipping build desktop/qt5 (already ran)
Skipping build ffmpeg (already ran)
Parts 'desktop/qt5' and 'upstream-src' have the following file paths in common which have different contents:
usr/share/pkgconfig/shared-mime-info.pc
usr/share/pkgconfig/xkeyboard-config.pc
diff parts/upstream-src/install/usr/share/pkgconfig/shared-mime-info.pc parts/desktop/qt5/install/usr/share/pkgconfig/shared-mime-info.pc
1c1
< prefix=/root/kdenlive/parts/upstream-src/install/usr
---
> prefix=/root/kdenlive/parts/desktop/qt5/install/usr
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Resolved conflicting pkg-config prefix rewriting through snapcore/snapcraft PR #676, which a maintainer linked as the issue's resolution. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by PR #676 (commit 6757dabee), adding special handling for conflicting pkg-config files so rewritten prefix values no longer collide between parts. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed pkg-config .pc staging conflicts by special-casing differing part prefixes; PR #676 merged as commit 6757dabee. | |
| stealth/space-bunny-alpha | — | closed stale | Closed without a documented resolution; later relocatable pkg-config work in #5157 and craft-parts#977 is related but is not shown to have closed this report. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution, likely abandoned. Snapcraft modified pkg-config .pc file prefixes differently per part, causing staging conflicts. No fix or related PR was provided. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. Snapcraft's per-part pkgconfig prefix modification causing staging conflicts remains unfixed, likely abandoned due to inactivity. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. Snapcraft altered pkgconfig .pc prefixes per part, causing staging conflicts when multiple parts shipped identical files. No fix was implemented. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Abandoned. Snapcraft modified pkgconfig .pc prefixes differently across parts, causing staging conflicts. No fix or discussion was provided. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
snapcore/snapcraft#676
(confidence 98%)
The issue's sole maintainer comment identifies this PR as the resolution.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #251 repo: fix_pkg_config removes prefixes from staged snap's .pc files. | craft-parts | merged | Merged in craft-parts#251 via 7c8140f4 (commit 359d377a), stripping staged build paths from .pc prefixes before applying the new prefix, addressing LP #1916281. | |
| #5158 Snapcraft doesn't honor ${pcfiledir} in pkgconfig files | snapcraft | closed | Fixed ${pcfiledir} handling via snapcraft#5157 (0a7f753ac) for Core20/Core22 and craft-parts#977 (b4a09d95) for Core24+. | |
| #3848 repo: fix_pkg_config removes prefixes from staged snap's .pc files. | snapcraft | merged | Merged in snapcraft#3848 as commit 2dadaa6da, fixing fix_pkg_config to remove build-stage prefixes from staged snaps' pkg-config .pc files. | |
| #620 Alter prefix for pkg-config to get correct values | snapcraft | merged | Merged in snapcraft#620 as commit f25abf9c0, correcting pkg-config prefixes so reported values resolve correctly during builds. | |
| #1567054 Snapcraft clean doesn't remove pkg-config override | snapcraft (launchpad) | closed | Closed as unreproducible: the maintainer could not reproduce the reported `snapcraft clean` or `snapcraft clean <part-name>` behavior. | |
| #1548232 Snapcraft messes with include path precedence in unhealthy ways | snapcraft (launchpad) | closed | Include-path precedence was corrected by pkg-config work in canonical/snapcraft#429 (commit a117bd273), with a regression test added. | |
| #1595243 pkg-config fails to find dependencies built from other parts | snapcraft (launchpad) | closed | Launchpad bug #1595243 (pkg-config cannot find libraries built by other parts) was fixed by snapcore/snapcraft PR #620 'Alter prefix for pkg-config to get correct values', merged as commit f25abf9c0 after the earlier attempt PR #612 was closed. | |
| #1916281 pkgconfig files end up with double `/root/stage` in prefix | snapcraft (launchpad) | closed | Fixed by snapcraft PR #3848 (commit 2dadaa6da), which removes staged-snap prefixes from .pc files; the reporter confirmed that Snapcraft 7.1.1 on stable fixes it. | |
| #1774254 Wrong prefix is set in staged pkg-config files when alternate --prefix is configured | snapcraft (launchpad) | closed | Fixed incorrect prefix in staged pkg-config files when alternate --prefix is configured. Resolved via snapcraft#3848 and craft-parts#251. |