Skip to content

Python3.13.4 doesn't build, Python3.13.3 builds #135136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Kadelka opened this issue Jun 4, 2025 · 19 comments
Closed

Python3.13.4 doesn't build, Python3.13.3 builds #135136

Kadelka opened this issue Jun 4, 2025 · 19 comments
Labels
3.13 bugs and security fixes build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@Kadelka
Copy link

Kadelka commented Jun 4, 2025

Bug report

Bug description:

Tried to install Python3.13.4 from source. Installation fails testing the building. All modules o.k. except hashlib.py
The new Python3.12.11, Python3.11.13, Python3.10.18, Python3.9.23 can be built and installed without problems. The same holds true for Python3.13.3.
I do not find any log.file for errors.

CPython versions tested on:

3.13

Operating systems tested on:

Linux

@Kadelka Kadelka added the type-bug An unexpected behavior, bug, or error label Jun 4, 2025
@ZeroIntensity ZeroIntensity added build The build process and cross-build 3.13 bugs and security fixes labels Jun 4, 2025
@ZeroIntensity
Copy link
Member

Hi, what do you mean by "Installation fails testing the building"? What shows up?

@Kadelka
Copy link
Author

Kadelka commented Jun 4, 2025

I configure with (o.K. for all other versions)
./configure --prefix=/usr/local --enable-ipv6 --enable-optimizations --enable-shared ; make
Then compilation with gcc, version 15.1.
Building of Modules o.K. with some warnings. Problem starts with

Next, run the profile task to generate the profile information.

LD_LIBRARY_PATH=/install/Python-3.13.4 ./python -m test --pgo --timeout=

0:01:21 load avg: 1.13 [20/43] test_hashlib
test test_hashlib failed
0:01:22 load avg: 1.13 [20/43] test_hashlib failed (2 failures)

(The other versions of Python don't fail here).

After make altinstall the program behaves strangely.

@ZeroIntensity
Copy link
Member

Would you mind posting the tracebacks for the failures?

@Kadelka
Copy link
Author

Kadelka commented Jun 4, 2025

I don't know if this is what you mean: Compilation stops with

Total duration: 4 min 37 sec
Total tests: run=9,348 failures=2 skipped=185
Total test files: run=43/43 failed=1
Result: FAILURE
make: *** [Makefile:906: profile-run-stamp] Fehler 2

Is there any log I can publish?
I've replaced hashlib.py with hashlib.py from version 3.13.3 (I know this is ugly). Same problem.

@StanFromIreland
Copy link
Contributor

It does build, it is just a test that fails.

Can you please give the test traceback and what system you are on, this may be a duplicate.

@Kadelka
Copy link
Author

Kadelka commented Jun 4, 2025

I Have Suse Leap 15.6 (Linux) with local gcc-15.1 (works fine). python indeed builds, the test in the Makefile fails:

gcc -fno-semantic-interposition -fprofile-generate -Xlinker -export-dynamic -o Programs/_testembed Programs/testembed.o -L. -lpython3.13 -ldl -lm
sed -e "s,/usr/bin/env python3,/usr/local/bin/python3.13," < ./Tools/scripts/idle3 > build/scripts-3.13/idle3.13
sed -e "s,/usr/bin/env python3,/usr/local/bin/python3.13," < ./Tools/scripts/pydoc3 > build/scripts-3.13/pydoc3.13
sed -e "s,@exename@,/usr/local/bin/python3.13," < ./Misc/python-config.in >python-config.py
LC_ALL=C sed -e 's,$(([A-Za-z0-9
]*)),${\1},g' < Misc/python-config.sh >python-config
Checked 112 modules (33 built-in, 78 shared, 1 n/a on linux-x86_64, 0 disabled, 0 missing, 0 failed on import)
make[2]: Verzeichnis „/home/install/Python-3.13.4“ wird verlassen
touch profile-gen-stamp
make[1]: Verzeichnis „/home/install/Python-3.13.4“ wird verlassen

Next, run the profile task to generate the profile information.
LD_LIBRARY_PATH=/install/Python-3.13.4 ./python -m test --pgo --timeout=
Using random seed: 1228288509
0:00:00 load avg: 1.28 Run 43 tests sequentially in a single process
0:00:00 load avg: 1.28 [ 1/43] test_array
0:00:04 load avg: 1.33 [ 1/43] test_array passed
0:00:04 load avg: 1.33 [ 2/43] test_base64
0:00:05 load avg: 1.33 [ 2/43] test_base64 passed
0:00:05 load avg: 1.33 [ 3/43] test_binascii
0:00:06 load avg: 1.33 [ 3/43] test_binascii passed
0:00:06 load avg: 1.33 [ 4/43] test_binop
0:00:06 load avg: 1.33 [ 4/43] test_binop passed
0:00:06 load avg: 1.33 [ 5/43] test_bisect
0:00:06 load avg: 1.33 [ 5/43] test_bisect passed
0:00:06 load avg: 1.33 [ 6/43] test_bytes
0:00:21 load avg: 1.26 [ 6/43] test_bytes passed
0:00:21 load avg: 1.26 [ 7/43] test_bz2
0:00:23 load avg: 1.32 [ 7/43] test_bz2 passed
0:00:23 load avg: 1.32 [ 8/43] test_cmath
0:00:24 load avg: 1.32 [ 8/43] test_cmath passed
0:00:24 load avg: 1.32 [ 9/43] test_codecs
0:00:28 load avg: 1.32 [ 9/43] test_codecs passed
0:00:28 load avg: 1.32 [10/43] test_collections
0:00:34 load avg: 1.27 [10/43] test_collections passed
0:00:34 load avg: 1.27 [11/43] test_complex
0:00:35 load avg: 1.27 [11/43] test_complex passed
0:00:35 load avg: 1.27 [12/43] test_dataclasses
0:00:37 load avg: 1.27 [12/43] test_dataclasses passed
0:00:37 load avg: 1.27 [13/43] test_datetime
0:00:51 load avg: 1.21 [13/43] test_datetime passed
0:00:51 load avg: 1.21 [14/43] test_decimal
0:01:07 load avg: 1.16 [14/43] test_decimal passed
0:01:07 load avg: 1.16 [15/43] test_difflib
0:01:11 load avg: 1.15 [15/43] test_difflib passed
0:01:11 load avg: 1.15 [16/43] test_float
0:01:12 load avg: 1.15 [16/43] test_float passed
0:01:12 load avg: 1.15 [17/43] test_fstring
0:01:17 load avg: 1.14 [17/43] test_fstring passed
0:01:17 load avg: 1.14 [18/43] test_functools
0:01:19 load avg: 1.13 [18/43] test_functools passed
0:01:19 load avg: 1.13 [19/43] test_generators
0:01:21 load avg: 1.13 [19/43] test_generators passed
0:01:21 load avg: 1.13 [20/43] test_hashlib
test test_hashlib failed
0:01:22 load avg: 1.13 [20/43] test_hashlib failed (2 failures)
0:01:22 load avg: 1.13 [21/43] test_heapq
0:01:24 load avg: 1.12 [21/43] test_heapq passed
0:01:24 load avg: 1.12 [22/43] test_int
0:01:26 load avg: 1.12 [22/43] test_int passed
0:01:26 load avg: 1.12 [23/43] test_itertools
0:01:47 load avg: 1.46 [23/43] test_itertools passed
0:01:47 load avg: 1.46 [24/43] test_json
0:02:00 load avg: 1.36 [24/43] test_json passed
0:02:00 load avg: 1.36 [25/43] test_long
0:02:10 load avg: 1.46 [25/43] test_long passed
0:02:10 load avg: 1.46 [26/43] test_lzma
0:02:11 load avg: 1.46 [26/43] test_lzma passed
0:02:11 load avg: 1.46 [27/43] test_math
0:02:24 load avg: 1.36 [27/43] test_math passed
0:02:24 load avg: 1.36 [28/43] test_memoryview
0:02:27 load avg: 1.36 [28/43] test_memoryview passed
0:02:27 load avg: 1.36 [29/43] test_operator
0:02:27 load avg: 1.36 [29/43] test_operator passed
0:02:27 load avg: 1.36 [30/43] test_ordered_dict
0:02:32 load avg: 1.33 [30/43] test_ordered_dict passed
0:02:32 load avg: 1.33 [31/43] test_patma
0:02:33 load avg: 1.33 [31/43] test_patma passed
0:02:33 load avg: 1.33 [32/43] test_pickle
0:03:00 load avg: 1.42 [32/43] test_pickle passed
0:03:00 load avg: 1.42 [33/43] test_pprint
0:03:01 load avg: 1.42 [33/43] test_pprint passed
0:03:01 load avg: 1.42 [34/43] test_re
0:03:05 load avg: 1.38 [34/43] test_re passed
0:03:05 load avg: 1.38 [35/43] test_set
0:03:29 load avg: 1.37 [35/43] test_set passed
0:03:29 load avg: 1.37 [36/43] test_sqlite3
0:03:34 load avg: 1.34 [36/43] test_sqlite3 passed
0:03:34 load avg: 1.34 [37/43] test_statistics
0:04:11 load avg: 1.32 [37/43] test_statistics passed in 37.6 sec
0:04:11 load avg: 1.32 [38/43] test_str
0:04:19 load avg: 1.27 [38/43] test_str passed
0:04:19 load avg: 1.27 [39/43] test_struct
0:04:22 load avg: 1.27 [39/43] test_struct passed
0:04:22 load avg: 1.27 [40/43] test_tabnanny
0:04:24 load avg: 1.25 [40/43] test_tabnanny passed
0:04:24 load avg: 1.25 [41/43] test_time
0:04:27 load avg: 1.25 [41/43] test_time passed
0:04:27 load avg: 1.25 [42/43] test_xml_etree
0:04:31 load avg: 1.23 [42/43] test_xml_etree passed
0:04:31 load avg: 1.23 [43/43] test_xml_etree_c
0:04:37 load avg: 1.37 [43/43] test_xml_etree_c passed

Total duration: 4 min 37 sec
Total tests: run=9,348 failures=2 skipped=185
Total test files: run=43/43 failed=1
Result: FAILURE

and then make stops.

make install

installs version 3.13.4, but this version does not behave correctly. After closing python the local program starts profiling.

@ZeroIntensity
Copy link
Member

Maybe there are some old build artifacts that shouldn't be there? Try running make clean or using a fresh clone of 3.13 and then building.

@Kadelka
Copy link
Author

Kadelka commented Jun 4, 2025

With

./configure --prefix=/usr/local --enable-ipv6 --enable-shared ; make

(without --enable-optimizations) Python3.13.4 can be built without problems. Of course this is not a complete solution of this problem, since Python3.13.3 can be installed with --enable-optimizations

@StanFromIreland
Copy link
Contributor

StanFromIreland commented Jun 4, 2025

I could recreate, I nuked build/ and it was fine. Somehow my permissions had changed on a dir, magic maybe? make clean was useless as a result. I'll look into returning it to that state again, it caused some odd errors.

Edit: Thought: My system uses a non-utf8 locale, maybe this is the issue after it has been made default recently.

@ZeroIntensity
Copy link
Member

Edit: Thought: My system uses a non-utf8 locale, maybe this is the issue after it has been made default recently.

Not on 3.13

@Kadelka
Copy link
Author

Kadelka commented Jun 4, 2025

Meanwhile the problem is solved, at least for me. The "solution" is strange. First I had to install Python3.13.4 with configuration
./configure --prefix=/usr/local --enable-ipv6 --enable-shared ; make ; make altinstall
then removing directory Python3.13.4, loading directory Python3.13.4 anew and then
./configure --prefix=/usr/local --enable-ipv6 --enable-optimization --enable-shared ; make ; make altinstall
installed python3.13 as intended.

I think, Makefile uses simultaneously two versions of python (the new built one and a system wide python) in the building process.

@vstinner
Copy link
Member

vstinner commented Jun 5, 2025

Would you mind to run test_hashlib in verbose mode and copy/paste the output? Something like:

LD_LIBRARY_PATH=/install/Python-3.13.4 ./python -m test test_hashlib -v

@Kadelka
Copy link
Author

Kadelka commented Jun 5, 2025

Installing the old environment
LD_LIBRARY_PATH=/install/Python-3.13.4 ./python -m test test_hashlib -v
results in

== CPython 3.13.4 (main, Jun 5 2025, 20:29:43) [GCC 15.1.0]
== Linux-6.4.0-150600.23.50-default-x86_64-with-glibc2.38 little-endian
== Python build: release shared PGO
== cwd: /home/install/Python-3.13.3/build/test_python_worker_30615æ
== CPU count: 2
== encodings: locale=UTF-8 FS=utf-8
== resources: all test resources are disabled, use -u option to unskip tests
Using random seed: 3312523463
0:00:00 load avg: 0.73 Run 1 test sequentially in a single process
0:00:00 load avg: 0.73 [1/1] test_hashlib
test_algorithms_available (test.test_hashlib.HashLibTestCase.test_algorithms_available) ... ok
test_algorithms_guaranteed (test.test_hashlib.HashLibTestCase.test_algorithms_guaranteed) ... ok
test_blake2b (test.test_hashlib.HashLibTestCase.test_blake2b) ... ok
test_blake2b_vectors (test.test_hashlib.HashLibTestCase.test_blake2b_vectors) ... skipped "Use of the 'urlfetch' resource not enabled"
test_blake2s (test.test_hashlib.HashLibTestCase.test_blake2s) ... ok
test_blake2s_vectors (test.test_hashlib.HashLibTestCase.test_blake2s_vectors) ... skipped "Use of the 'urlfetch' resource not enabled"
test_blocksize_and_name (test.test_hashlib.HashLibTestCase.test_blocksize_and_name) ... ok
test_blocksize_name_blake2 (test.test_hashlib.HashLibTestCase.test_blocksize_name_blake2) ... ok
test_blocksize_name_sha3 (test.test_hashlib.HashLibTestCase.test_blocksize_name_sha3) ... ok
test_case_blake2b_0 (test.test_hashlib.HashLibTestCase.test_case_blake2b_0) ... ok
test_case_blake2b_1 (test.test_hashlib.HashLibTestCase.test_case_blake2b_1) ... ok
test_case_blake2b_all_parameters (test.test_hashlib.HashLibTestCase.test_case_blake2b_all_parameters) ... ok
test_case_blake2s_0 (test.test_hashlib.HashLibTestCase.test_case_blake2s_0) ... ok
test_case_blake2s_1 (test.test_hashlib.HashLibTestCase.test_case_blake2s_1) ... ok
test_case_blake2s_all_parameters (test.test_hashlib.HashLibTestCase.test_case_blake2s_all_parameters) ... ok
test_case_md5_0 (test.test_hashlib.HashLibTestCase.test_case_md5_0) ... ok
test_case_md5_1 (test.test_hashlib.HashLibTestCase.test_case_md5_1) ... ok
test_case_md5_2 (test.test_hashlib.HashLibTestCase.test_case_md5_2) ... ok
test_case_md5_huge (test.test_hashlib.HashLibTestCase.test_case_md5_huge) ... skipped 'not enough memory: 4.0G minimum needed'
test_case_md5_uintmax (test.test_hashlib.HashLibTestCase.test_case_md5_uintmax) ... skipped 'not enough memory: 4.0G minimum needed'
test_case_sha1_0 (test.test_hashlib.HashLibTestCase.test_case_sha1_0) ... ok
test_case_sha1_1 (test.test_hashlib.HashLibTestCase.test_case_sha1_1) ... ok
test_case_sha1_2 (test.test_hashlib.HashLibTestCase.test_case_sha1_2) ... ok
test_case_sha1_3 (test.test_hashlib.HashLibTestCase.test_case_sha1_3) ... ok
test_case_sha224_0 (test.test_hashlib.HashLibTestCase.test_case_sha224_0) ... ok
test_case_sha224_1 (test.test_hashlib.HashLibTestCase.test_case_sha224_1) ... ok
test_case_sha224_2 (test.test_hashlib.HashLibTestCase.test_case_sha224_2) ... ok
test_case_sha224_3 (test.test_hashlib.HashLibTestCase.test_case_sha224_3) ... ok
test_case_sha256_0 (test.test_hashlib.HashLibTestCase.test_case_sha256_0) ... ok
test_case_sha256_1 (test.test_hashlib.HashLibTestCase.test_case_sha256_1) ... ok
test_case_sha256_2 (test.test_hashlib.HashLibTestCase.test_case_sha256_2) ... ok
test_case_sha256_3 (test.test_hashlib.HashLibTestCase.test_case_sha256_3) ... ok
test_case_sha384_0 (test.test_hashlib.HashLibTestCase.test_case_sha384_0) ... ok
test_case_sha384_1 (test.test_hashlib.HashLibTestCase.test_case_sha384_1) ... ok
test_case_sha384_2 (test.test_hashlib.HashLibTestCase.test_case_sha384_2) ... ok
test_case_sha384_3 (test.test_hashlib.HashLibTestCase.test_case_sha384_3) ... ok
test_case_sha3_224_0 (test.test_hashlib.HashLibTestCase.test_case_sha3_224_0) ... ok
test_case_sha3_224_vector (test.test_hashlib.HashLibTestCase.test_case_sha3_224_vector) ... skipped "Use of the 'urlfetch' resource not enabled"
test_case_sha3_256_0 (test.test_hashlib.HashLibTestCase.test_case_sha3_256_0) ... ok
test_case_sha3_256_vector (test.test_hashlib.HashLibTestCase.test_case_sha3_256_vector) ... skipped "Use of the 'urlfetch' resource not enabled"
test_case_sha3_384_0 (test.test_hashlib.HashLibTestCase.test_case_sha3_384_0) ... ok
test_case_sha3_384_vector (test.test_hashlib.HashLibTestCase.test_case_sha3_384_vector) ... skipped "Use of the 'urlfetch' resource not enabled"
test_case_sha3_512_0 (test.test_hashlib.HashLibTestCase.test_case_sha3_512_0) ... ok
test_case_sha3_512_vector (test.test_hashlib.HashLibTestCase.test_case_sha3_512_vector) ... skipped "Use of the 'urlfetch' resource not enabled"
test_case_sha512_0 (test.test_hashlib.HashLibTestCase.test_case_sha512_0) ... ok
test_case_sha512_1 (test.test_hashlib.HashLibTestCase.test_case_sha512_1) ... ok
test_case_sha512_2 (test.test_hashlib.HashLibTestCase.test_case_sha512_2) ... ok
test_case_sha512_3 (test.test_hashlib.HashLibTestCase.test_case_sha512_3) ... ok
test_case_shake128_vector (test.test_hashlib.HashLibTestCase.test_case_shake128_vector) ... skipped "Use of the 'urlfetch' resource not enabled"
test_case_shake256_vector (test.test_hashlib.HashLibTestCase.test_case_shake256_vector) ... skipped "Use of the 'urlfetch' resource not enabled"
test_case_shake_128_0 (test.test_hashlib.HashLibTestCase.test_case_shake_128_0) ... ok
test_case_shake_256_0 (test.test_hashlib.HashLibTestCase.test_case_shake_256_0) ... ok
test_digest_length_overflow (test.test_hashlib.HashLibTestCase.test_digest_length_overflow) ... ok
test_disallow_instantiation (test.test_hashlib.HashLibTestCase.test_disallow_instantiation) ... ok
test_extra_sha3 (test.test_hashlib.HashLibTestCase.test_extra_sha3) ... ok
test_get_builtin_constructor (test.test_hashlib.HashLibTestCase.test_get_builtin_constructor) ... ok
test_get_fips_mode (test.test_hashlib.HashLibTestCase.test_get_fips_mode) ... ok
test_gil (test.test_hashlib.HashLibTestCase.test_gil) ... ok
test_hash_array (test.test_hashlib.HashLibTestCase.test_hash_array) ... ok
test_hash_disallow_instantiation (test.test_hashlib.HashLibTestCase.test_hash_disallow_instantiation) ... ok
test_hexdigest (test.test_hashlib.HashLibTestCase.test_hexdigest) ... ok
test_large_update (test.test_hashlib.HashLibTestCase.test_large_update) ... ok
test_name_attribute (test.test_hashlib.HashLibTestCase.test_name_attribute) ... ok
test_new_upper_to_lower (test.test_hashlib.HashLibTestCase.test_new_upper_to_lower) ... ok
test_no_unicode (test.test_hashlib.HashLibTestCase.test_no_unicode) ... ok
test_no_unicode_blake2 (test.test_hashlib.HashLibTestCase.test_no_unicode_blake2) ... ok
test_no_unicode_sha3 (test.test_hashlib.HashLibTestCase.test_no_unicode_sha3) ... ok
test_readonly_types (test.test_hashlib.HashLibTestCase.test_readonly_types) ... ok
test_sha256_update_over_4gb (test.test_hashlib.HashLibTestCase.test_sha256_update_over_4gb) ... skipped "resource 'cpu' is not enabled"
test_sha3_256_update_over_4gb (test.test_hashlib.HashLibTestCase.test_sha3_256_update_over_4gb) ... skipped "resource 'cpu' is not enabled"
test_threaded_hashing (test.test_hashlib.HashLibTestCase.test_threaded_hashing) ... ok
test_unknown_hash (test.test_hashlib.HashLibTestCase.test_unknown_hash) ... ok
test_usedforsecurity_false (test.test_hashlib.HashLibTestCase.test_usedforsecurity_false) ... ok
test_usedforsecurity_true (test.test_hashlib.HashLibTestCase.test_usedforsecurity_true) ... ok
test_file_digest (test.test_hashlib.KDFTests.test_file_digest) ... ok
test_normalized_name (test.test_hashlib.KDFTests.test_normalized_name) ... ok
test_pbkdf2_hmac_c (test.test_hashlib.KDFTests.test_pbkdf2_hmac_c) ... ok
test_scrypt (test.test_hashlib.KDFTests.test_scrypt) ... ok
----------------------------------------------------------------------
Ran 78 tests in 0.631s
OK (skipped=12)
0:00:00 load avg: 0.73 [1/1] test_hashlib passed
== Tests result: SUCCESS ==
1 test OK.
Total duration: 856 ms
Total tests: run=78 skipped=12
Total test files: run=1/1
Result: SUCCESS

During make I had the message

0:01:13 load avg: 1.01 [20/43] test_hashlib
test test_hashlib failed
0:01:14 load avg: 1.01 [20/43] test_hashlib failed (2 failures)

Strange!

@Kadelka
Copy link
Author

Kadelka commented Jun 5, 2025

The row
cwd: /home/install/Python-3.13.3/build/test_python_worker_30615æ
looks suspicious. This directory doesn't exist.

@vstinner
Copy link
Member

vstinner commented Jun 6, 2025

Result: SUCCESS

Oh. If you cannot reproduce the hashlib failure in verbose mode, we cannot help you.

The row
cwd: /home/install/Python-3.13.3/build/test_python_worker_30615æ
looks suspicious. This directory doesn't exist.

Python creates a temporary directory and then runs tests from that temporary directory.

@Kadelka
Copy link
Author

Kadelka commented Jun 6, 2025

O.K. and thank you. I've solved the problem at least for me by first installing 3.13.4 without --enable-optimization and after installation installing 3.13.4 (with python3.13.4 in /usr/local/bin) and clearing the build directory with --enable-optimization. I know that this is not a correct solution.

@vstinner
Copy link
Member

vstinner commented Jun 6, 2025

Should we close the issue since you managed to work around it?

@Kadelka
Copy link
Author

Kadelka commented Jun 6, 2025

If its only my problem definitely yes. Thank you.

@vstinner
Copy link
Member

vstinner commented Jun 6, 2025

I close the issue. If you can reproduce the issue and run test_hashlib in verbose mode, please reopen the issue.

@vstinner vstinner closed this as completed Jun 6, 2025
@vstinner vstinner closed this as not planned Won't fix, can't repro, duplicate, stale Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 bugs and security fixes build The build process and cross-build type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants