Bug report
Python 3.10 had the ability to set PYTHON_DECIMAL_WITH_MACHINE to override the choice of configuration for the _decimal module:
| 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 setting PYTHON_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 system libmpdec was built.
Homebrew's Python currently depends on this feature.
A test within CPython also seems to depend on this feature:
| 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/null 2>&1 |
| ./configure CFLAGS="$ADD_CFLAGS" LDFLAGS="$ADD_LDFLAGS" --with-pydebug $args> /dev/null 2>&1 |
| $GMAKE| grep _decimal |
Your environment
- CPython versions tested on: 3.11.0rc2
- Operating system and architecture: macOS 12 (x86_64 and arm64)
Bug report
Python 3.10 had the ability to set
PYTHON_DECIMAL_WITH_MACHINEto override the choice of configuration for the_decimalmodule:cpython/setup.py
Lines 2388 to 2397 in dcb342b
Since Python 3.11, this is no longer possible. This feature was necessary, on macOS particularly, with the
--with-system-libmpdecoption if that system libmpdec is configured differently to the default Python config. On macOS, the default Python config forces universal, while settingPYTHON_DECIMAL_WITH_MACHINEallowed it to be single-arch.libmpdecproduces different headers depending on how it was built, which is why the setting is important to be able to override. Without it, the_decimalmodule will fail to compile if the default does not match how systemlibmpdecwas 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 in f4c0348
Your environment