I remembered this issue on bpo with contracting opinions from when I first looked in 2019.
See https://bugs.python.org/issue33439
On Sat, 2021-10-23 at 12:25 -0300, Joannah Nanjekye wrote:
I remembered this issue on bpo with contracting opinions from when I first looked in 2019.
Hi,
This script is currently not written in Python and hardcodes paths that are incorrect on virtual environments and relocated installs, so it would make sense to rewrite it in Python, using sysconfig.
That does not require it to be exposed as a module, but would be a very cheap improvement.
As the bulk of the work would be to actually rewriting it in Python, and as there is reasoning to do this other than just exposing it as a module, I would be +1 FWIW.
Cheers, Filipe Laíns
On 23 Oct 2021, at 17:48, Filipe Laíns lains@riseup.net wrote:
On Sat, 2021-10-23 at 12:25 -0300, Joannah Nanjekye wrote:
I remembered this issue on bpo with contracting opinions from when I first looked in 2019.
Hi,
This script is currently not written in Python and hardcodes paths that are incorrect on virtual environments and relocated installs, so it would make sense to rewrite it in Python, using sysconfig.
That does not require it to be exposed as a module, but would be a very cheap improvement.
As the bulk of the work would be to actually rewriting it in Python, and as there is reasoning to do this other than just exposing it as a module, I would be +1 FWIW.
Note that the original python implementation is still in the repository and is used for framework builds on macOS because of the hardcoded values in the shell script variant. On macOS the sysconfig values for compiler related settings (CC, CFLAGS, …) are adjusted dynamically to account for different compilers and system versions.
IIRC the shell script variant was introduced to support some cross compilation scenario’s (see https://bugs.python.org/issue16235 https://bugs.python.org/issue16235).
Ronald
Cheers, Filipe Laíns _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-leave@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/QWA3HPPF... Code of Conduct: http://python.org/psf/codeofconduct/
—
Twitter / micro.blog: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/
On Mon, 2021-10-25 at 09:51 +0200, Ronald Oussoren wrote:
On 23 Oct 2021, at 17:48, Filipe Laíns lains@riseup.net wrote:
On Sat, 2021-10-23 at 12:25 -0300, Joannah Nanjekye wrote:
I remembered this issue on bpo with contracting opinions from when I first looked in 2019.
Hi,
This script is currently not written in Python and hardcodes paths that are incorrect on virtual environments and relocated installs, so it would make sense to rewrite it in Python, using sysconfig.
That does not require it to be exposed as a module, but would be a very cheap improvement.
As the bulk of the work would be to actually rewriting it in Python, and as there is reasoning to do this other than just exposing it as a module, I would be +1 FWIW.
Note that the original python implementation is still in the repository and is used for framework builds on macOS because of the hardcoded values in the shell script variant. On macOS the sysconfig values for compiler related settings (CC, CFLAGS, …) are adjusted dynamically to account for different compilers and system versions.
IIRC the shell script variant was introduced to support some cross compilation scenario’s (see https://bugs.python.org/issue16235).
Ronald
Ah! I noticed the presence of a Python python-config in the repo shortly after sending this, but I was missing the this context here, so thank thank you :)
So, I guess the existing python-config script just needs to be updated to handle cross compilation properly.
Cheers, Filipe Laíns
On 10/25/2021 4:24 PM, Filipe Laíns wrote:
So, I guess the existing python-config script just needs to be updated to handle cross compilation properly.
Including handling when the cross-compiled Python runtime won't actually run on the platform you're trying to get the config on ;)
Over at https://discuss.python.org/t/towards-standardizing-cross-compiling/10357/ about the *only* thing we could agree on is needing a static, cross-platform way to read config values from a Python build (essentially "python -m sysconfig" without being able to run Python).
Cheers, Steve