duplicate rpath in LDSHARED sysconfig
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- build-system
Hướng nghiên cứu
Issue nêu sysconfig.get_config_var("LDSHARED"), LDSHARED và LDFLAGS thay vì một tệp trong repository; hãy bắt đầu bằng cách tái hiện ví dụ CFFI trên macOS 15.4 và kiểm tra cách các giá trị đó được ghép lại. Hoàn thành khi extension được tạo không còn chứa các mục LC_RPATH trùng lặp và import thành công mà không ghi đè LDSHARED.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Solution to issue cannot be found in the documentation.
- I checked the documentation.
Issue
Related to duplicate LC_RPATH problems on macOS 15.4 showing up elsewhere, the current setup results in Python extensions guaranteeing the prefix rpath is set at least 3 times for Python extensions, which produces unloadable executables by default starting with 15.4 if built with a recent SDK (e.g. runtime compilation in user environments, as opposed to conda-forge infrastructure). This is coming up in e.g. dolfinx users which use runtime compilation via cffi.
The default sysconfig.get_config_var("LDSHARED") gives:
clang -bundle -undefined dynamic_lookup -Wl,-rpath,$PREFIX/lib -L$PREFIX/lib -Wl,-rpath,$PREFIX/lib -L$PREFIX/lib
while LDFLAGS also sets some of the same args:
-Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,$PREFIX/lib -L$PREFIX/lib
As a result, -Wl,-rpath,$PREFIX/lib -L$PREFIX/lib shows up by default 3 times when linking Python extensions. For a simple CFFI example:
import cffi
import logging
logging.basicConfig(level=logging.DEBUG)
ffibuilder = cffi.FFI()
src = """
int test_func() {
return 1;
}
"""
ffibuilder.set_source(
"_test_ffi",
src,
include_dirs=["include-dir"],
extra_compile_args=["-g"],
libraries=[],
)
ffibuilder.cdef("int test_func();")
ffibuilder.compile(verbose=True)
import _test_ffi
print(_test_ffi.lib.test_func())
Run in an env with c-compiler python cffi. With the default environment variables, this produces a module which fails to load with:
Traceback (most recent call last):
File "/Users/minrk/dev/simula/fenics/dolfinx/python/demo/test_ffi.py", line 21, in <module>
import _test_ffi # noqa
^^^^^^^^^^^^^^^^
ImportError: dlopen(/Users/minrk/dev/simula/fenics/dolfinx/python/demo/_test_ffi.cpython-312-darwin.so, 0x0002): tried: '/Users/minrk/dev/simula/fenics/dolfinx/python/demo/_test_ffi.cpython-312-darwin.so' (duplicate LC_RPATH '/Users/minrk/dev/simula/fenics/dolfinx/python/demo/.pixi/envs/default/lib'), '/System/Volumes/Preboot/Cryptexes/OS/Users/minrk/dev/simula/fenics/dolfinx/python/demo/_test_ffi.cpython-312-darwin.so' (no such file), '/Users/minrk/dev/simula/fenics/dolfinx/python/demo/_test_ffi.cpython-312-darwin.so' (duplicate LC_RPATH '/Users/minrk/dev/simula/fenics/dolfinx/python/demo/.pixi/envs/default/lib')
Running with
export LDSHARED="$CC -bundle -undefined dynamic_lookup"
results in success.
Suggestion: remove linker flags like rpath (and -L$PREFIX/lib?) from LDSHARED, relying on their presence in LDFLAGS.
Related reports:
- https://github.com/conda/conda-build/issues/5671
- https://github.com/prefix-dev/pixi/issues/3479
- https://github.com/conda-forge/numpy-feedstock/issues/347
Installed packages
python 3.12.8 hc22306f_1_cpython conda-forge
python_abi 3.12 5_cp312 conda-forge
Environment info
libmamba version : 2.0.8
mamba version : 2.0.8
curl version : libcurl/8.13.0 OpenSSL/3.4.1 (SecureTransport) zlib/1.3.1 zstd/1.5.7 libssh2/1.11.1 nghttp2/1.64.0
libarchive version : libarchive 3.7.7 zlib/1.3.1 liblzma/5.2.6 bz2lib/1.0.8 liblz4/1.9.3 libzstd/1.5.6
envs directories : /Users/minrk/conda/envs
package cache : /Users/minrk/conda/pkgs
/Users/minrk/.mamba/pkgs
environment : hypre (active)
env location : /Users/minrk/conda/envs/hypre
user config files : /Users/minrk/.mambarc
populated config files : /Users/minrk/.condarc
/Users/minrk/conda/.condarc
virtual packages : __unix=0=0
__osx=15.4=0
__archspec=1=arm64
channels : https://conda.anaconda.org/conda-forge/noarch
https://conda.anaconda.org/conda-forge/osx-arm64
base environment : /Users/minrk/conda
platform : osx-arm64
- Ngôn ngữ chính
- Shell
- Star
- 47
- Fork
- 112
- Merge trung bình
- 1 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 15
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của conda-forge/python-feedstock
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
conda-forge/python-feedstock#934 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
conda-forge/python-feedstock#929 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
conda-forge/python-feedstock#903 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
conda-forge/python-feedstock#880 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
conda-forge/python-feedstock#879 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của conda-forge/python-feedstock
Issue tương tự
-
package-update
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
bug needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
vllm-project/vllm-metal#841 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
obra/superpowers#2394 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
CachyOS/cachyos-aur-derived#772 ·
Maintainer thường phản hồi trong vòng 1 ngày