-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
sysconfig data is generated with the host Python's Makefile when cross-compiling #127429
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
Comments
Signed-off-by: Filipe Laíns <[email protected]>
I still see this in my tests where I deliberately relocate Python after building. Can Alternatively, can we skip the test when the current |
We could ignore the prefix if it doesn't match the running interpreter. Though, in your use-case, is the install expected to be relocated during its lifetime, or do you just do it as an intermediate step? |
I'm building it and packaging it up so that other people can download a pre-built interpreter into their builds. I can't control where they extract it to, so finding the prefix at runtime is basically necessary. After it's been run for the first time it's unlikely to move again, but I don't get to have an executable install step. So ideally we'd just calculate the prefix each time we launch and never hard code it. |
Alright, I am not too worried about those use-cases. My recommendation would be to probably manually set the prefixes to For all practical purposes, this file is not critical, we don't load data from it currently, and if we move towards that, we will be definitely keep calculating the prefix at runtime. Right now it is provided as a nice-to-have for introspection, but not for folks to rely on always existing. Regarding the test, yep, we should definitely either ignore the prefixes when comparing the data, or skip it, so that it passes on the situation you described. |
Can you be more specific about what you mean by this? Do I try and patch the generated JSON file? I wonder if there's a way we can override |
Yep. Either that, or just don't ship the JSON file. These are just my suggestions anyway, feel free to go for what you feel most comfortable with. I think you should actually be able to build with an empty prefix (empty string), and install to a relocatable location using |
Well this isn't an error I expected to see:
But yeah, passing an empty |
Huh, interesting! |
…pythonGH-127430) (cherry picked from commit 2950bc5) Co-authored-by: Filipe Laíns 🇵🇸 <[email protected]>
Bug report
Bug description:
Currently, the POSIX sysconfig data is generated with the
Makefile
from the host interpreter, instead of the target. This results in incorrect data, as demonstrated by https://github.com/python/cpython/actions/runs/12090193539/job/33716932397?pr=127426.CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: