← Back to issue list

repo: fix_pkg_config trims prefixes more generically

View original Github issue

Metadata

Project
craft-parts
Number
#252
Type
pull request
State
merged
Author
mr-cal
Labels
—
Created
Updated
Closed

Current evaluation

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.

Resolution: closed resolved

Reason: PR #252 was merged into main as commit f6681f0f (merge commit 789d2510), replacing #251's stage-path-specific stripping with generic trimming of everything up to and including 'stage/'. The change was subsequently reverted by #255 (commit e7f3fe49, merge cb249a7c) because the generic match hit unrelated paths.

Evaluated by: mr-cal-bot

No scores available.

Issue body

- [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? ----- Follow up to https://github.com/canonical/craft-parts/pull/251 thanks to an idea from @cmatsuoka. When normalizing pkg-config (.pc) files from staged snaps, the previously prepended `<path-to-project-path>/stage` will be removed from the `prefix` parameter. This means all directories prior to and including `stage/` are trimmed. For example, `/root/stage/usr` is trimmed to `/usr`. LP: #[1916281](https://bugs.launchpad.net/snapcraft/+bug/1916281) (CRAFT-1215)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved 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.
stealth/space-bunny-alpha — closed resolved Merged in craft-parts#252 (789d2510, f6681f0f), trimming staged .pc prefixes through stage/; later reverted by #255 (e7f3fe49) after stage/ in working-directory paths caused false matches.
qwen/qwen3.6-35b-a3b — — Merged. Updates fix_pkg_config to generically strip prefixes, including the stage directory, when normalizing pkg-config files from staged snaps. Resolves LP #1916281 and CRAFT-1215. Approved and passed CI.
qwen3.6-35b-a3b-mtp-q6 — — Merged fix updating fix_pkg_config to generically strip stage path prefixes from pkg-config files in staged snaps. Resolves LP #1916281 and CRAFT-1215 as a follow-up to PR #251.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/craft-parts#255 (confidence 95%)

    Revert PR merged as e7f3fe49 (merge cb249a7c) undoing f6681f0f after generic prefix trimming caused false matches when 'stage' occurred in the working directory path.

  • Likely Fixed By: canonical/craft-parts#251 (confidence 60%)

    Earlier, narrower fix (commit 359d377a) that #252 explicitly follows up on; reverted along with #252.

Related issues

Issue Project State Summary Similarity
#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.
86%
#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.
81%
#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.
77%
#977 fix: Honor the ${pcfiledir} entries in pkgconfig craft-parts merged Merged as b4a09d95, preserving ${pcfiledir}-based prefixes so relocatable pkg-config files remain valid; released in Craft Parts 2.4.1.
72%
#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.
72%