python / python/cpython

python3-config folder dependent result

Đang mở
#101,735 0 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 type-bug
Ngôn ngữ chính
Python
Star
77.2k
Fork
36k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

Bug report

Python is build into a manylinux_2_28 docker image with following commands (image is py3.11-latest from my dockerhub repo, created with this Dockerfile):

./configure --enable-shared --enable-optimizations --disable-test-modules --prefix=/opt/build_python/installed
make altinstall

the process ends correctly, at the end I found the content into expected folder

/opt/build_python/installed/lib
├── [lrwxrwxrwx root     root    ]  libpython3.11.so -> libpython3.11.so.1.0
├── [-rwxr-xr-x root     root    ]  libpython3.11.so.1.0
├── [-rwxr-xr-x root     root    ]  libpython3.so
/opt/build_python/installed/bin
├── [-rwxr-xr-x root     root    ]  2to3-3.11
├── [-rwxr-xr-x root     root    ]  idle3.11
├── [-rwxr-xr-x root     root    ]  pip3.11
├── [-rwxr-xr-x root     root    ]  pydoc3.11
├── [-rwxr-xr-x root     root    ]  python3.11
└── [-rwxr-xr-x root     root    ]  python3.11-config

and if I run python3.11-config FROM INSIDE that folder I obtain the expected result (look at the -L part)

[root@919ee1a66e62 opt]# /opt/build_python/installed/bin/python3.11-config --embed --ldflags
 -L/opt/build_python/installed/lib -lpython3.11 -lpthread -ldl  -lutil -lm

If I do link that executable into /usr/local/bin and then run the same command, the output at -L flag part is different:

[root@919ee1a66e62 opt]# ln -s /opt/build_python/installed/bin/python3.11-config /usr/local/bin/python3-config

[root@919ee1a66e62 opt]# file /usr/local/bin/python3-config
/usr/local/bin/python3-config: symbolic link to /opt/build_python/installed/bin/python3.11-config

[root@919ee1a66e62 opt]# ls -l /usr/local/bin/python3-config
lrwxrwxrwx 1 root root 49 Feb  9 10:05 /usr/local/bin/python3-config -> /opt/build_python/installed/bin/python3.11-config

[root@919ee1a66e62 opt]# /usr/local/bin/python3-config --embed --ldflags
 -L/usr/local/lib -lpython3.11 -lpthread -ldl  -lutil -lm

this difference, when building C extension, led to have an error on dl phase cannot find -lpython3.11: No such file or directory because of wrong lib folder used.

I expected that python3-config's output, even if executed via symlink, should be the same.

Please let me know if my expectation is not correct, thanks.

Your environment

A manylinux_2_28_86_x64 docker image used to build python 3.11.1 into.
Then doing the steps above into the docker container.

  • CPython versions tested on: 3.11.1
  • Operating system and architecture: manylinux (CentOS) , x64

Thanks for this awesome programming language.

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 với các lệnh configure và make altinstall đã được báo cáo, sau đó kiểm tra các tệp được tạo /opt/build_python/installed/bin/python3.11-config và Dockerfile_2_28_x64_py311. Chạy trực tiếp dạng --embed --ldflags của nó và thông qua liên kết symbolic /usr/local/bin/python3-config, rồi xác định xem cả hai lần gọi có nên tạo ra cùng một đường dẫn thư viện hay khô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, shell
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
45/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.