python / python/cpython

Compiling 3.13.1 fails when /usr/local/include/pyconfig.h is outdated

Đang mở
#129,019 19 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

build pending type-bug
Ngôn ngữ chính
Python
Star
77.2k
Fork
35.9k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện các lệnh configure và make, sau đó kiểm tra Makefile được tạo ra và chuỗi include thông qua Include/Python.h, Include/unicodeobject.h và Include/cpython/unicodeobject.h. Kiểm tra cách /usr/local/include/pyconfig.h được chọn trong quá trình build Modules/binascii.c. Hoàn thành khi việc build Python không còn phụ thuộc vào các tệp pyconfig.h cũ của hệ thống.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
build-system
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.