You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
_sysconfigdata.py doesn't support multiple build configurations #58979
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?
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
Activity
davidmalcolm commentedon May 10, 2012
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?
davidmalcolm commentedon May 10, 2012
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
merwok commentedon May 10, 2012
Would always recreating _sysconfigdata.py solve the problem?
pitrou commentedon May 11, 2012
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).
tpn commentedon Oct 13, 2012
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.