python3 -m sysconfig showing the wrong optimization flag

Bug #2100624 reported by Marcos Alano
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python3.12 (Ubuntu)
New
Undecided
Unassigned

Bug Description

If I execute `python3 -m sysconfig`, I can see all the options related to how Python was compiled.
The problem is: Python now is compiled with '-O3' flag by default on upstream and also downstream, but for some reason the previously mentioned command shows '-O2'. It's because a line in d/rules that does the replacement, but I don't think we still need it since '-O3' is the default behavior. Keeping '-O2' instead of the real '-O2' is masking the real value, making the sysconfig module less trustworthy.

Revision history for this message
Matthias Klose (doko) wrote :

> I can see all the options related to how Python was compiled.

this is not the purpose of this module. It's used to build third party extensions. The build systems for the third party extensions pick up the flags from the environment.

Revision history for this message
Marcos Alano (mhalano) wrote :

> pick up the flags from the environment.

You mean, the build systems use the output of this module, or they actually use environment variables?
If they use the output of this module, that declares many env variables, that's ok at first, but I still think we could check if the change from -O3 to -O2 is still necessary today.
If they grab from env variables from the machine itself, not from the module, this change would be irrelevant, right?

Revision history for this message
Marcos Alano (mhalano) wrote :

Matthias, do we still have a strong reason to not reveal over sysconfig module that we are using -O3?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.