Skip to content

Conversation

@mrmathematica
Copy link

@mrmathematica mrmathematica commented Nov 14, 2025

Currently, the python build on Unix is not really relocatalbe. When installing, uv further patches the _sysconfigdata_ file in uv/crates/uv-python/src/sysconfig/mod.rs update_sysconfig and patch_sysconfigdata function. Since _sysconfigdata_ file is a python file, we can let it dynamically decide the install path here in python-build-standalone, instead of rely on further patch down the line.

I see from uv/crates/uv-python/src/sysconfig/mod.rs, it also "remove any references to -isysroot in a whitespace-separated string". If needed I can add that part of logic to here as well.

The aim for this change is that, for python install to be able to be copied into any place after install, it should still work. Doing so here instead of inside uv should make it more avialable.

@AlexWaygood AlexWaygood changed the title Make the Unix build truely relocatalbe Make the Unix build truly relocatable Nov 21, 2025
@jjhelmus
Copy link
Contributor

jjhelmus commented Dec 3, 2025

@mrmathematica Thanks for putting this together.

Working towards a more relocatable distribution is a goal of this project but we also want to balance this with not deviating too far from upstream. Rather than modify sysconfigdata as part of this projects build script a preferred approach would be apply a patch to CPython itself to performs these modification as part of the standard build process. If these modification are part of building CPython directly the patch can be submitted upstream for inclusion in a future release of CPython. See #861 for an example of this type of work where portions of the RPATH adjusts in the build script are migrated to a patch.

If this is something you are interested in working on, I'd be happy to assist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants