← Back to issue list

Revert pkgconfig_fixup during prime stage

View original Github issue

Metadata

Project
craft-parts
Number
#1754
Type
issue
State
open
Author
jonathan-conder
Labels
—
Created
Updated
Closed
—

Current evaluation

Feature request to have _builtin_prime strip the /root/stage prefix that pkgconfig_fixup adds to .pc files during stage, so primed pkg-config files suit end consumers (e.g. Mir SDK). Brand new, no labels or maintainer response.

Suggested action: needs triage

Reason: The issue is well-scoped — it names the exact function to extend (StepHandler._builtin_prime mirroring the existing pkgconfig_fixup in _builtin_stage) and the exact transformation to invert (remove the /root/stage prefix= value) — but it carries no labels, no assignee, and zero maintainer comments, so it has not yet been triaged. Repository inspection tools were unavailable (no pinned SHA for craft-parts), so I could not verify current handler code, existing prime tests, or whether a related fix already landed, which is why confidence is moderate rather than high. Design questions remain unanswered: whether the behaviour should be default or opt-in, and how to handle parts that were not staged in the current run.

Evaluated by: mr-cal-bot

Impact: 45 Quick Win: 18 Complexity: 40 Confidence: 60 Actionability: 68

Issue body

### What needs to get done `StepHandler._builtin_stage` defines a function called `pkgconfig_fixup` which prepends `/root/stage` to the `prefix=` value in `.pc` files. I want `StepHandler._builtin_prime` to undo this, i.e. remove the `/root/stage` prefix. ### Why it needs to get done The reason (I presume) to add `/root/stage` is because other parts might be built against the current one. But once that's done, if the `.pc` file is primed then future consumers aren't likely to want this prefix. For example, see https://github.com/canonical/sdkcraft/issues/293. As far as I know, the Mir team wants to provide `.pc` files for users of the Mir SDK, not for other parts within the SDK. Currently they have to work around it with `override-stage`.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 45
Quick Win: 18
Complexity: 40
Confidence: 60
Actionability: 68
needs triage Feature request to have _builtin_prime strip the /root/stage prefix that pkgconfig_fixup adds to .pc files during stage, so primed pkg-config files suit end consumers (e.g. Mir SDK). Brand new, no labels or maintainer response.
stealth/space-bunny-alpha
Impact: 40
Quick Win: 17
Complexity: 40
Confidence: 68
Actionability: 70
needs triage Feature request: make StepHandler._builtin_prime strip the /root/stage prefix that pkgconfig_fixup adds to .pc files during stage, so primed .pc files suit end consumers (e.g. Mir SDK). New, unlabelled, no maintainer response.
qwen/qwen3.8-27b
Impact: 40
Quick Win: 9
Complexity: 55
Confidence: 65
Actionability: 50
needs triage Feature request to make _builtin_prime undo the stage-dir prefix that pkgconfig_fixup prepends to .pc files during stage, so primed .pc files have correct prefixes for end consumers (e.g. Mir SDK). No maintainer response yet.

Update history

Date Change
created

Related work

  • Related To: sdkcraft#293 (confidence 70%)

    Explicitly cited in the issue body as the motivating case; the Mir team currently works around the stage prefix with override-stage.

  • Related To: snapcraft (launchpad)#1916281 (confidence 50%)

    Launchpad bug 1916281 (not a GitHub issue) on the same /root/stage prefix in .pc files; fixed in snapcraft by stripping build-stage prefixes, showing the prefix problem is already acknowledged downstream.

Related issues

No related issues found above the similarity threshold.