← Back to issue list

Rewriting .pc file paths breaks using at runtime

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1661787
Type
issue
State
closed
Author
~mrjogo
Labels
robotics
Created
Updated
Closed

Current evaluation

Fixed via canonical/snapcraft#3848 and canonical/craft-parts#251, which strip staged build paths from .pc file prefixes before applying the new prefix, preventing runtime breakage.

Resolution: closed resolved

Reason: Closed by @~mr-cal who confirmed the fix was implemented via merged PRs canonical/snapcraft#3848 and canonical/craft-parts#251, which address the .pc file prefix rewriting issue.

Evaluated by: mr-cal-bot

No scores available.

Issue body

During staging, snapcraft rewrites *.pc files to prepend the stage directory onto the "prefix" path variable (done in PluginHandler.stage: https://github.com/snapcore/snapcraft/blob/master/snapcraft/internal/pluginhandler/__init__.py#L471). This rewrite is not reverted before snapping, breaking the .pc files at runtime (discovered when trying to run https://github.com/ros-simulation/gazebo_ros_pkgs/blob/kinetic-devel/gazebo_ros/scripts/gzserver#L26) (Note that the absolute paths in the *.pc files would still cause runtime issues unless using something like https://github.com/sergiusens/snapcraft-preload)

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b — closed resolved Fixed via canonical/snapcraft#3848 and canonical/craft-parts#251, which strip staged build paths from .pc file prefixes before applying the new prefix, preventing runtime breakage.
stealth/space-bunny-alpha
Impact: 22
Quick Win: 3
Complexity: 25
Confidence: 88
Actionability: 20
close resolved 2018 report that snapcraft's staging rewrite of .pc file 'prefix' paths was not reverted before packing, breaking the files at runtime. Now handled: the logic lives in craft-parts and skips relocatable ${pcfiledir} .pc files.
qwen/qwen3.6-35b-a3b
Impact: 70
Quick Win: 44
Complexity: 30
Confidence: 95
Actionability: 90
close resolved Snapcraft rewrites .pc file paths during staging, breaking runtime usage. Resolved in snapcraft 8.7 via PR #5157 which honors relocatable pkg-config files.
qwen/qwen3.8-27b
Impact: 50
Quick Win: 20
Staleness: 95
Complexity: 60
Confidence: 75
Support Request: 10
close stale Snapcraft's staging step rewrites .pc pkg-config files to prepend the stage directory to the prefix variable, but this rewrite is not reverted before snapping, breaking .pc files at runtime (e.g. gazebo_ros gzserver). No maintainer has responded; the issue is 9.5 years old.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 65
Confidence: 75
Support Request: 10
close stale Snapcraft rewrites .pc file paths during staging, breaking runtime execution. The issue has been inactive for over 9 years with no maintainer response or follow-up.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 45
Confidence: 95
Support Request: 15
close stale Bug report stating snapcraft rewrites pkg-config file paths during staging, breaking runtime execution. Inactive for over 9 years with no maintainer response.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 45
Confidence: 90
Support Request: 15
close stale Bug report from 9+ years ago stating that snapcraft rewrites pkg-config file paths during staging, breaking runtime execution. No maintainer response or activity.

Update history

Date Change
closed
created

Related work

  • Likely Fixed By: canonical/snapcraft#3848 (confidence 95%)

    Merged PR that fixes fix_pkg_config to remove build-stage prefixes from staged snap's .pc files.

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

    Merged PR in craft-parts that strips staged build paths from .pc prefixes before applying the new prefix.

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.
78%