Make the Unix build truly relocatable#857
Make the Unix build truly relocatable#857mrmathematica wants to merge 1 commit intoastral-sh:mainfrom
Conversation
|
@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. |
|
@jjhelmus |
|
A patch here first is what I was referring to. |
|
OK @jjhelmus I give that a try. I see there can be all kinds of downstream places that touches On the otherhand, the change in this PR is much more robust. It happened at the same place in this repo where |
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.rsupdate_sysconfigandpatch_sysconfigdatafunction. 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
-isysrootin 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.