Use `-skipMacroValidation` for xcodebuild command when using an external package that includes macros

683 views Asked by At

My GitHub CI was failing with a xcodebuild when I included a swift package that contains some macros. The build with xcodebuild was simply telling me xcodebuild: error: Failed writing xctestrun file: The folder .xctestrun doesn’t exist. and failed. The package resolving worked but the build failed. Locally it is working properly.

2

There are 2 answers

0
Quambadeur On

After a very long journey I finally found out:

xcodebuild needs the parameter -skipMacroValidation to work properly.

Obviously locally it was working because I initially enabled the package when adding it to the dependencies.

0
Anton Plebanovich On

Another possibility is to update defaults on the CI machine before build:

defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES

Taken from https://forums.swift.org/t/is-there-a-way-to-programmatically-allow-trust-the-compiler-plugin-to-run-from-the-command-line/65690/2