setup-xcode icon indicating copy to clipboard operation
setup-xcode copied to clipboard

Export DEVELOPER_DIR instead of invoking xcode-select to set the active Xcode version

Open bobergj opened this issue 3 years ago • 0 comments

Export the DEVELOPER_DIR environment variable instead of invoking xcode-select to set the active Xcode version.

Setting the active Xcode version with sudo xcode-select changes the setting system wide. Github actions can also be run with a self-hosted runner: https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners. When using a self-hosted github runner, the run isn't necessarily containerized. Changing the system-wide Xcode version then creates conflicts between concurrent runs.

From man xcode-select:

ENVIRONMENT DEVELOPER_DIR Overrides the active developer directory. When DEVELOPER_DIR is set, its value will be used instead of the system-wide active developer directory.

bobergj avatar Jan 05 '23 01:01 bobergj