Skip to content
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

Make the installed pkg-config files relocatable (astral-sh/uv#11028) #507

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

geofft
Copy link
Collaborator

@geofft geofft commented Jan 28, 2025

This ensures that e.g. PKG_CONFIG_PATH=/wherever/python/lib/pkgconfig pkg-config --cflags gets you existent paths in /wherever/python instead of nonexistent paths in /install.

@geofft geofft added platform:darwin Specific to the macOS platform platform:linux Specific to the Linux platform python:3.13 labels Jan 28, 2025
@geofft geofft requested a review from zanieb January 28, 2025 23:56
@lgarrison
Copy link

That was fast, thanks! I think sed -i -> sed ${sed_args} will unstick the MacOS CI.

@geofft geofft force-pushed the pkg-config-relocatable branch from cd79e7c to e5d83b0 Compare January 29, 2025 00:46
@geofft geofft changed the base branch from pkg-config-relocatable to main January 29, 2025 00:49
@geofft geofft force-pushed the pkg-config-relocatable branch from a2bd20b to e5d83b0 Compare January 29, 2025 00:50
@geofft
Copy link
Collaborator Author

geofft commented Jan 29, 2025

Ah, thanks, did not notice the script already did that :)

This ensures that e.g. `PKG_CONFIG_PATH=/wherever/python/lib/pkgconfig
pkg-config --cflags` gets you existent paths in /wherever/python instead
of nonexistent paths in /install.
@geofft geofft force-pushed the pkg-config-relocatable branch from e5d83b0 to 0349133 Compare January 29, 2025 03:08
@zanieb zanieb merged commit dfb68b2 into astral-sh:main Jan 30, 2025
87 checks passed
geofft added a commit to geofft/uv that referenced this pull request Feb 6, 2025
Previously, we patched pkg-config .pc files to have the absolute path to
the directory where we unpack a python-build-standalone release.  As
discussed in astral-sh#11028, we can use ${pcfiledir} in a .pc file to indicate
paths relative to the location of the file itself.

This change was implemented in astral-sh/python-build-standalone#507,
so for newer python-build-standalone releases, we don't need to do any
patching. Optimize this case by only modifying the .pc file if an actual
change is needed (which might be helpful down the line with hard links
or something). For older releases, change uv's patch to match what
python-build-standalone now does.
geofft added a commit to geofft/uv that referenced this pull request Feb 6, 2025
Previously, we patched pkg-config .pc files to have the absolute path to
the directory where we unpack a python-build-standalone release.  As
discussed in astral-sh#11028, we can use ${pcfiledir} in a .pc file to indicate
paths relative to the location of the file itself.

This change was implemented in astral-sh/python-build-standalone#507,
so for newer python-build-standalone releases, we don't need to do any
patching. Optimize this case by only modifying the .pc file if an actual
change is needed (which might be helpful down the line with hard links
or something). For older releases, change uv's patch to match what
python-build-standalone now does.
zanieb pushed a commit to astral-sh/uv that referenced this pull request Feb 7, 2025
Previously, we patched pkg-config .pc files to have the absolute path to
the directory where we unpack a python-build-standalone release. As
discussed in #11028, we can use ${pcfiledir} in a .pc file to indicate
paths relative to the location of the file itself.

This change was implemented in astral-sh/python-build-standalone#507, so
for newer python-build-standalone releases, we don't need to do any
patching. Optimize this case by only modifying the .pc file if an actual
change is needed (which might be helpful down the line with hard links
or something). For older releases, change uv's patch to match what
python-build-standalone now does.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:darwin Specific to the macOS platform platform:linux Specific to the Linux platform python:3.13
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants