rust-lang / cc-rs

Rust library for build scripts to compile C/C++ code into a Rust library
https://docs.rs/cc
Apache License 2.0
1.76k stars 425 forks source link

Add tests that execute `{TVOS,XROS}_DEPLOYMENT_VERSION` detecion logic. #1097

Closed briansmith closed 2 weeks ago

briansmith commented 2 weeks ago

This causes the version detection to be skipped and thus it isn't being tested. Remove it so that we test the version detection.

briansmith commented 2 weeks ago

The code has:

            AppleOs::TvOs => deployment_from_env("TVOS_DEPLOYMENT_TARGET")
                .or_else(default_deployment_from_sdk)
                .unwrap_or_else(|| "9.0".into()),

            AppleOs::VisionOS => deployment_from_env("XROS_DEPLOYMENT_TARGET")
                .or_else(default_deployment_from_sdk)
                .unwrap_or_else(|| "1.0".into()),

...so even if the detection from the SDK fails, shouldn't these tests still pass? It seems like there's something wrong here.

briansmith commented 2 weeks ago

The issue is caused by the fact that GitHub Actions defaults to Xcode 15.0.x, not 15.2, and 15.2 is the first to support visionos.