This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: _sysconfigdata.py doesn't support multiple build configurations
Type: behavior Stage:
Components: Build Versions: Python 3.3
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: Arfrever, dmalcolm, eric.araujo, pitrou, trent
Priority: normal Keywords:

Created on 2012-05-10 19:47 by dmalcolm, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (5)
msg160366 - (view) Author: Dave Malcolm (dmalcolm) (Python committer) Date: 2012-05-10 19:47
When building from source, if I create multiple configuration directories and build from there e.g.:

mkdir configs
cd configs
mkdir config-A
cd config-A
../../configure
make
cd ..
mkdir config-B
cd config-B
../../configure --enable-shared
make
cd ../config-A
./python -c "import sysconfig; print(sysconfig.get_config_var('CONFIG_ARGS')

then sysconfig's settings are the same for *every* config, reflecting those of the last build (config-B above, rathern than those of config-A).

This turns out to be due to this:
   ./python -SE -m sysconfig --generate-posix-vars
This generates $(srcdir)/Lib/_sysconfigdata.py for whichever config was last

Is there a way of fixing this whilst keeping it a python file?  Or do we need to build from a C file, perhaps?
msg160367 - (view) Author: Dave Malcolm (dmalcolm) (Python committer) Date: 2012-05-10 19:55
Note to self: workaround is to
  rm ../../Lib/_sysconfigdata.py || make ../../Lib/_sysconfigdata.py
before running my tests in either configuration, to force the file to be regenerated using what "make" thinks the settings are
msg160385 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-05-10 23:44
Would always recreating _sysconfigdata.py solve the problem?
msg160401 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-05-11 05:04
> Is there a way of fixing this whilst keeping it a python file?  Or do
> we need to build from a C file, perhaps?

Well I hope we don't make it a C file just for that reason. It would complicate the generation code quite a bit (right now it's just 3 lines long).

I tend to use separate clones myself (actually, I use "hg share" to avoid multiple pulls).
msg172814 - (view) Author: Trent Nelson (trent) * (Python committer) Date: 2012-10-13 17:22
I'm pretty sure this is a duplicate of http://bugs.python.org/issue15298 (which should be fixed shortly).

Feel free to re-open if I'm wrong.
History
Date User Action Args
2022-04-11 14:57:30adminsetgithub: 58979
2012-10-13 17:22:05trentsetstatus: open -> closed

nosy: + trent
messages: + msg172814

resolution: duplicate
2012-09-04 07:46:44Arfreversetnosy: + Arfrever
2012-05-11 05:04:45pitrousetmessages: + msg160401
2012-05-10 23:44:17eric.araujosetmessages: + msg160385
2012-05-10 23:43:38eric.araujosetnosy: + pitrou, eric.araujo
2012-05-10 19:55:24dmalcolmsetmessages: + msg160367
2012-05-10 19:47:33dmalcolmcreate