[Python-Dev] Re: Should python-config be an stdlib module?

2021-10-25 Thread Ronald Oussoren via Python-Dev


> On 23 Oct 2021, at 17:48, Filipe Laíns  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.
>> 
>> See https://bugs.python.org/issue33439
> 
> 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

> 
> Cheers,
> Filipe Laíns
> ___
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-le...@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/QWA3HPPFTHGDWYMMAXJRIXKVORC2ATLA/
> Code of Conduct: http://python.org/psf/codeofconduct/

—

Twitter / micro.blog: @ronaldoussoren
Blog: https://blog.ronaldoussoren.net/

___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@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/T2MRJMT4ID7HSZ3XHES6IXOM3GTFPT6T/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Should python-config be an stdlib module?

2021-10-25 Thread Filipe Laíns
On Mon, 2021-10-25 at 09:51 +0200, Ronald Oussoren wrote:
> 
> 
> > On 23 Oct 2021, at 17:48, Filipe Laíns  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.
> > > 
> > > See https://bugs.python.org/issue33439
> > 
> > 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


signature.asc
Description: This is a digitally signed message part
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@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/AI35IFNAOIEDJDSZHRKEGU3E2HHRRQJS/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: Should python-config be an stdlib module?

2021-10-25 Thread Steve Dower

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
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@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/XKY5LFHHEIUXSY72C3LJSRH5FWTM5INY/
Code of Conduct: http://python.org/psf/codeofconduct/