cargo_build_script does not set MACOSX_DEPLOYMENT_TARGET for cc-rs
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- build-system
Hướng nghiên cứu
Find the cargo_build_script action and the existing apple_deployment_target_env use in rustc actions. Check how C compile args and the action environment are assembled, then reproduce with a build script using cc-rs and an Apple toolchain configured with macos_minimum_os=26.0. Done when the deployment target variable is present in the build script environment and the C object uses the requested minimum OS version.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
cargo_build_script populates CFLAGS and CXXFLAGS from the cc toolchain, so the Apple -target arm64-apple-macosx26.0 (or -m<os>-version-min=) flag reaches the build script. cc-rs does not read the deployment target from those variables. It reads MACOSX_DEPLOYMENT_TARGET (and IPHONEOS_DEPLOYMENT_TARGET and siblings), and falls back to its own default when they are unset.
The result is a C object built by a build script (for example with cc::Build) that carries a different minimum OS version than the rest of the build. The linker then warns about the mismatch, or the object is built for an older target than the toolchain asked for.
#4149 and #4282 fixed this for rustc actions by deriving the variable from the link args with apple_deployment_target_env. Build script actions were not covered.
To reproduce: build a cargo_build_script that uses cc-rs with an Apple cc toolchain configured with macos_minimum_os=26.0, and print MACOSX_DEPLOYMENT_TARGET from build.rs. It is unset.
The fix is to call apple_deployment_target_env on the C compile args in cargo_build_script and add the result to the action env. I will send a PR.
Assisted by Claude.
- Ngôn ngữ chính
- Starlark
- Star
- 857
- Fork
- 701
- Merge trung bình
- 4 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 46
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 bazelbuild/rules_rust
-
`rust_test(crate = ...)` does not stage the crate's transitive dynamic libraries into runfilesCó thể đã có người làm @Wito-1 đã nhận 65 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
bazelbuild/rules_rust#4309 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Windows (no-symlink path): drain_runfiles_dir_windows deletes retained runfiles — inverted filename_suffixes_to_retain conditionCó thể đã có người làm @Mattbusel đã nhận 17 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
bazelbuild/rules_rust#4266 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
rust.toolchain(strip_level = ...) is silently ignoredCó thể đã có người làm @Mattbusel đã nhận 17 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
bazelbuild/rules_rust#4223 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 90/100
bazelbuild/rules_rust#4152 · 1 reaction ·
Maintainer thường phản hồi trong vòng 3 ngày
-
awaiting-response
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
bazelbuild/rules_rust#3599 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của bazelbuild/rules_rust
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
bazelbuild/apple_support#707 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
blocky: new version 0.38.0Đang mởout-of-date
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CachyOS/CachyOS-PKGBUILDS#2232 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
blast/large refactor risk/low spend-dem
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
chriskelly/MusicWall#87 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
neilotoole/sq#1503 ·
Maintainer thường phản hồi trong vòng 1 ngày