-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Snapcraft doesn't honor ${pcfiledir} in pkgconfig files #5158
Snapcraft doesn't honor ${pcfiledir} in pkgconfig files #5158
Comments
Just a note that this bug is affecting the GIMP snap as described here: snapcrafters/gimp#300 There is a workaround in the PR to hard-code the |
I prepared a patch for gnome-46-2404-sdk which should fix the problem ubuntu/gnome-sdk#264 but it's just a workaround until this is fixed in snapcraft. |
Hey @sergio-costas, Do you have any ideas to why #5157 didn't work? |
@mr-cal No idea, but I modified the entry of this bug to include a test YAML file, that shows the problem and allows to know if it has been fixed. |
I've been doing some extra tests and adding debugging messages. Building the test snap, in the |
I suspect that the replacement is being done in other of the *craft projects code... I'll try to find it. |
(updated) Ah yes, it's here for core22 and core24 snaps: https://github.com/canonical/craft-parts/blob/2a7578ed4f588b8a4d04aebc54a45ec5a4e2540f/craft_parts/packages/normalize.py#L160 I was looking at the bug report for gimp, which uses core20. In gimp's case, #5157 is correct to modify |
Ok, so both this patch, and another for craft-parts are required to fix this, isn't it? |
Correct |
Ok, changed #5157 to ready, and added canonical/craft-parts#977 |
Bug Description
Pkgconfig defines the ${pcfiledir} variable as "the path of the .pc file". It is designed to allow to create relocatable .pc files. For example, the .pc file for librsvg library version 2.59.1 begins with:
Since the file is stored at
/usr/lib/x86_64-linux-gnu/pkg-config
, the result is thatprefix
is/usr
.Unfortunately, snapcraft doesn't honor it, and prepends the $CRAFT_STAGE path during build, which breaks it. When the
prefix
begins with${pcfiledir}
, it should be kept unmodified.Patch #5157 fixes Core20 and Core22 snaps, and canonical/craft-parts#977 fixes Core24 and newer.
To Reproduce
Just downloading the current stable version of gnome-46-2404 shows it.
Environment
Using LXD on Ubuntu 24.10.
snapcraft.yaml
Building this test snap shows the problem. After build, unsquash the snap file and check the file
squashfs-root/usr/lib/x86_64-linux-gnu/pkgconfig/librsvg-2.0.pc
.Relevant log output
Additional context
No response
The text was updated successfully, but these errors were encountered: