pkg-config fails to find dependencies built from other parts
Metadata
Current evaluation
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.
Resolution: closed resolved
Reason: The issue was resolved upstream by snapcraft PR #620, merged as commit f25abf9c0, which corrected pkg-config prefix handling so build parts can locate .pc files/libs from other parts; the earlier PR #612 was closed in favour of it.
Evaluated by: mr-cal-bot
No scores available.
Issue body
I have an application that depends on a newer version of a library than is present in the archives, so I can't use stage-packages to pull it in. I have created a new part that will build this library from upstream source, and that part builds without problem. However, the application part that needs it is unable to find it, with pkg-config failing
This is the snapcraft.yaml that reproduced the problem.
https://github.com/ubuntu/snappy-playpen/blob/f58d396bff2503cf942d2afad65adbc4b6575192/pantheon-mail/snapcraft.yaml
Granite 0.4 is the dependency that is needed by Pantheon Mail.
This is the output from snapcraft cleanbuild:
http://paste.ubuntu.com/17662567/
This is the location and content of the granite.pc produced by the dependency part:
http://paste.ubuntu.com/17662693/
I even tried forcing all of the other -dev packages to be installed to the same location, here is the full list of .pc files:
http://paste.ubuntu.com/17665800/
Still pkg-config is unable to find the granite dependency when building the mail part.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | 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. | |
| stealth/space-bunny-alpha | — | closed resolved | pkg-config dependency discovery was fixed by merged PR #620 in commit f25abf9c0, which corrected generated .pc prefixes; the earlier #612 attempt was closed. | |
| stealth/space-bunny-alpha | — | closed stale | Closed without a documented fix or linked resolving PR; no maintainer explanation was provided. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The report detailed pkg-config failing to locate dependencies built from other parts in Snapcraft. No fix or merge was provided, and the issue appears abandoned or superseded by newer Snapcraft versions. | |
| qwen/qwen3.6-35b-a3b | — | — | Abandoned. The issue was closed without comments or resolution, likely due to its age. Cross-part pkg-config dependency handling has since been improved in newer Snapcraft releases. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
snapcore/snapcraft#620
(confidence 95%)
Merged PR altering pkg-config prefixes, cited by sergiusens in the final comment as the fix for this bug.
-
Superseded By:
snapcore/snapcraft#612
(confidence 90%)
Initial PR 'Do not wipe PKG_CONFIG_LIBDIR' was closed and replaced by #620.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #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. | |
| #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. |