repo: fix_pkg_config removes prefixes from staged snap's .pc files.
Metadata
Current evaluation
Merged in snapcraft#3848 as commit 2dadaa6da, fixing fix_pkg_config to remove build-stage prefixes from staged snaps' pkg-config .pc files.
Resolution: closed resolved
Reason: PR #3848 was approved and squash-merged as commit 2dadaa6da. It implements the upstream craft-parts fix for LP #1916281 and CRAFT-1214.
Evaluated by: mr-cal-bot
No scores available.
Issue body
- [X] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/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 `pytest tests/unit`?
-----
When normalizing pkg-config (.pc) files from staged snaps, directories previously prepended to the prefix parameter will be removed:
- `/build/<snap-name>/stage` from snaps built via launchpad
- `/root/stage` from snaps built via a provider
LP: #[1916281](https://bugs.launchpad.net/snapcraft/+bug/1916281)
(CRAFT-1214)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged in snapcraft#3848 as commit 2dadaa6da, fixing fix_pkg_config to remove build-stage prefixes from staged snaps' pkg-config .pc files. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged in #3848 (commit 2dadaa6da): fixed staged-snap pkg-config normalization by removing prepended build-stage prefixes. Companion craft-parts changes: #251 and #252. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged a fix normalizing pkg-config prefixes in staged snaps by stripping prepended build directories. Squash-merged after review approval and full test coverage, resolving Launchpad #1916281 and CRAFT-1214. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged fix normalizing pkg-config prefixes in staged snaps by stripping prepended build directories. Squash-merged with craft-parts dependency updated to 1.10.0 for consistent resolution. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
canonical/craft-parts#251
(confidence 98%)
Direct upstream counterpart that removed staged build-directory prefixes from pkg-config files.
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. | |
| #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. | |
| #252 repo: fix_pkg_config trims prefixes more generically | craft-parts | merged | Merged: generic pkg-config prefix trimming (f6681f0f, merge 789d2510), follow-up to #251 for CRAFT-1215/LP#1916281. Later reverted by #255 (e7f3fe49) after false matches when 'stage' appeared in the working-directory path. | |
| #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. | |
| #1604472 snapcraft changing pkgconfig .pc prefix is creating conflicts between parts | snapcraft (launchpad) | closed | Resolved conflicting pkg-config prefix rewriting through snapcore/snapcraft PR #676, which a maintainer linked as the issue's resolution. | |
| #255 Revert "repo: fix_pkg_config trims prefixes more generically" | craft-parts | merged | Merged #255, reverting f6681f0f to undo generic pkg-config prefix trimming that changed behavior when "stage" appeared in the working directory path. | |
| #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. | |
| #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+. | |
| #335 Redo pkg-config handling with library collecting | snapcraft | merged | Merged in snapcraft#335 as commit 4a5de243e, reworking pkg-config sysroot handling and adding host-to-snap ELF dependency collection. |