alexcrichton / curl-rust

Rust bindings to libcurl
MIT License
1k stars 234 forks source link

Ensure that the Xcode CLI tools are installed #415

Closed winterqt closed 2 years ago

winterqt commented 2 years ago

When compiling curl-sys with static-curl and ssl on macOS, xcodebuild is unconditionally executed to retrieve the Xcode major version. However, these tools aren't always installed. This normally wouldn't be an issue (since the logic can already handle this), except that there's a dialog that pops up prompting the user to install the CLI tools every execution.

According to this Stack Overflow answer, xcode-select -p exits with a nonzero status code if the CLI tools are not installed, so we check that first before attempting to execute xcodebuild.

alexcrichton commented 2 years ago

Thanks!