Building Python 3.11+ with `./configure --enable-optimizations && make altinstall -j` results in exit code 2

Open
#101,295 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
build-system

Research direction

Reproduce the reported CPython 3.11.1 build with ./configure --enable-optimizations followed by make altinstall -j 8, and compare its exit status with Python 3.10. Start by examining the build output and command that returns status 2 despite successful tests and installation. Done means the parallel altinstall completes successfully with exit code 0 while preserving the reported installation behavior.

Written by the indexing model from the issue text.

Description

build type-bug

Bug report

Compiling Python 3.11.1 with the -j flag will result in an exit code 2, even though Python is successfully installed.

In Python 3.10.x the -j flag results in exit code 0 as expected.

To reproduce:

wget https://www.python.org/ftp/python/3.11.1/Python-3.11.1.tgz && \
    tar xzf Python-3.11.1.tgz && \
    cd Python-3.11.1 && \
    ./configure --enable-optimizations && \
    make altinstall -j 8

echo "exit code: $?"

This installs Python successfully, but the exit code is 2, not 0:

[root@38c4e1f16954 Python-3.11.1]# echo "exit code: $?"
exit code: 2

However Python was apparently installed successfully, for example make outputs:

0:01:40 load avg: 1.38 [43/44] test_xml_etree
0:01:41 load avg: 1.35 [44/44] test_xml_etree_c

Total duration: 1 min 42 sec
Tests result: SUCCESS

And we can execute Python without any apparent issue:

root@38c4e1f16954 Python-3.11.1]# ./python --version
Python 3.11.1
root@38c4e1f16954 Python-3.11.1]# ./python -c 'print("hello world")'
hello world

Your environment

  • CPython versions tested on: 3.11, 3.10x
  • Operating system and architecture: RHEL
Dominant language
Python
Stars
77.2k
Forks
36k
Avg merge
1d 9h
Merged PRs (30d)
558

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python/cpython

All issues in python/cpython

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.