Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Python 3.11 loses the ability to set PYTHON_DECIMAL_WITH_MACHINE #98557

Open
Labels
buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or error
@Bo98

Description

@Bo98

Bug report

Python 3.10 had the ability to setPYTHON_DECIMAL_WITH_MACHINE to override the choice of configuration for the_decimal module:

cpython/setup.py

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:

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp