Compiling 3.13.1 fails when /usr/local/include/pyconfig.h is outdated
Offen
Dieses Issue hat noch niemand übernommen.
build
pending
type-bug
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 35.9k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Compiling Python 3.13.1 with
$ ./configure --with-lto --enable-shared --without-static-libpython --prefix=/root/chroot-n/python --disable-ipv6 --enable-optimizations CFLAGS='--sysroot=/root/chroot-n -Ichr/include -Wl,--dynamic-linker=/chr/lib/ld-linux-x86-64.so.2'
$ make
prints
make profile-gen-stamp
make[1]: Entering directory '/src/chroot/Python-3.13.1'
Building with support for profile generation:
make build_all CFLAGS_NODIST=" -fprofile-generate" LDFLAGS_NODIST=" -fprofile-generate" LIBS="-ldl "
make[2]: Entering directory '/src/chroot/Python-3.13.1'
gcc -DUSE_ZLIB_CRC32 -I/usr/local/include -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall --sysroot=/root/chroot-n -Ichr/include -Wl,--dynamic-linker=/chr/lib/ld-linux-x86-64.so.2 -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -fprofile-generate -I./Include/internal -I./Include/internal/mimalloc -I. -I./Include -fPIC -fPIC -c ./Modules/binascii.c -o Modules/binascii.o
In file included from ./Include/Python.h:79,
from ./Modules/binascii.c:60:
./Include/unicodeobject.h:61:9: warning: "Py_USING_UNICODE" redefined
61 | #define Py_USING_UNICODE
| ^~~~~~~~~~~~~~~~
In file included from ./Include/Python.h:14:
/usr/local/include/pyconfig.h:994:9: note: this is the location of the previous definition
994 | #define Py_USING_UNICODE 1
| ^~~~~~~~~~~~~~~~
./Include/unicodeobject.h:67:9: warning: "Py_UNICODE_SIZE" redefined
67 | #define Py_UNICODE_SIZE SIZEOF_WCHAR_T
| ^~~~~~~~~~~~~~~
/usr/local/include/pyconfig.h:991:9: note: this is the location of the previous definition
991 | #define Py_UNICODE_SIZE 2
| ^~~~~~~~~~~~~~~
/usr/local/include/pyconfig.h:982:25: error: two or more data types in declaration specifiers
982 | #define PY_UNICODE_TYPE unsigned short
| ^~~~~~~~
./Include/cpython/unicodeobject.h:9:37: note: in expansion of macro ‘PY_UNICODE_TYPE’
9 | Py_DEPRECATED(3.13) typedef wchar_t PY_UNICODE_TYPE;
| ^~~~~~~~~~~~~~~
/usr/local/include/pyconfig.h:982:34: error: two or more data types in declaration specifiers
982 | #define PY_UNICODE_TYPE unsigned short
| ^~~~~
./Include/cpython/unicodeobject.h:9:37: note: in expansion of macro ‘PY_UNICODE_TYPE’
9 | Py_DEPRECATED(3.13) typedef wchar_t PY_UNICODE_TYPE;
| ^~~~~~~~~~~~~~~
In file included from ./Include/unicodeobject.h:1014:
./Include/cpython/unicodeobject.h:9:1: warning: useless type name in empty declaration
9 | Py_DEPRECATED(3.13) typedef wchar_t PY_UNICODE_TYPE;
| ^~~~~~~~~~~~~
make[2]: *** [Makefile:3346: Modules/binascii.o] Error 1
make[2]: Leaving directory '/src/chroot/Python-3.13.1'
make[1]: *** [Makefile:883: profile-gen-stamp] Error 2
make[1]: Leaving directory '/src/chroot/Python-3.13.1'
make: *** [Makefile:895: profile-run-stamp] Error 2
My /usr/local/include/pyconfig.h is from 2016! After removing it, the compilation progresses.
- Building Python should not depend on /usr/local/include/pyconfig.h or /usr/include/pyconfig.h, installed from previous Python versions.
Linked PRs
- gh-134019
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die configure- und make-Befehle zu reproduzieren, und untersuche dann das generierte Makefile sowie die Include-Kette über Include/Python.h, Include/unicodeobject.h und Include/cpython/unicodeobject.h. Prüfe, wie /usr/local/include/pyconfig.h während des Builds von Modules/binascii.c ausgewählt wird. Als erledigt gilt die Aufgabe, wenn das Bauen von Python nicht mehr von veralteten pyconfig.h-Dateien des Systems abhängt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- build-system
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 25/100