Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Description
Bug report
Python 3.10 had the ability to setPYTHON_DECIMAL_WITH_MACHINE to override the choice of configuration for the_decimal module:
Lines 2388 to 2397 indcb342b
| machine=os.environ.get('PYTHON_DECIMAL_WITH_MACHINE') | |
| ifmachine: | |
| # Override automatic configuration to facilitate testing. | |
| define_macros=config[machine] | |
| elifMACOS: | |
| # Universal here means: build with the same options Python | |
| # was built with. | |
| define_macros=config['universal'] | |
| elifsizeof_size_t==8: |
Since Python 3.11, this is no longer possible. This feature was necessary, on macOS particularly, with the--with-system-libmpdec option if that system libmpdec is configured differently to the default Python config. On macOS, the default Python config forces universal, while settingPYTHON_DECIMAL_WITH_MACHINE allowed it to be single-arch.
libmpdec produces different headers depending on how it was built, which is why the setting is important to be able to override. Without it, the_decimal module will fail to compile if the default does not match how systemlibmpdec was built.
Homebrew's Python currently depends on this feature.
A test within CPython also seems to depend on this feature:
cpython/Modules/_decimal/tests/runall-memorydebugger.sh
Lines 63 to 79 inf4c0348
| unset PYTHON_DECIMAL_WITH_MACHINE | |
| libmpdec_config=$config | |
| if [ X"$config"!= X"auto" ];then | |
| PYTHON_DECIMAL_WITH_MACHINE=$config | |
| export PYTHON_DECIMAL_WITH_MACHINE | |
| else | |
| libmpdec_config="" | |
| fi | |
| ############ refleak tests ########### | |
| print_config"refleak tests: config=$config"$args | |
| printf"\nbuilding python ...\n\n" | |
| cd ../../ | |
| $GMAKE distclean> /dev/null2>&1 | |
| ./configure CFLAGS="$ADD_CFLAGS" LDFLAGS="$ADD_LDFLAGS" --with-pydebug$args> /dev/null2>&1 | |
| $GMAKE| grep _decimal |
Your environment
- CPython versions tested on: 3.11.0rc2
- Operating system and architecture: macOS 12 (x86_64 and arm64)