spotify / XCRemoteCache

Other
827 stars 50 forks source link

Is RC producer expected to build from IDE on CI? #123

Closed cezarsignori closed 2 years ago

cezarsignori commented 2 years ago

When using fastlane (build_app) to build the app configured for producer mode, the RC build step is not invoked (no files in the server, no build failures, no RC logs in the log).

Fastline does show one warning right at the start of the build that is actually an early build failure in case I skip fastlane and call xcodebuild directly:

2022-04-22 13:45:33.730 xcodebuild[67561:3608596]  DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDELanguageSupport/IDELanguageSupport-19500/XCLanguageSupport/XCCompilerSpecificationSwift.m:167
Details:  error getting info from swift compiler '/Users/csignori/Projects/iphone/xcremotecache/xcswiftc': Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={NSLocalizedDescription=Non-zero exit code 1 returned from shell command: /Users/csignori/Projects/iphone/xcremotecache/xcswiftc -v 2>&1, NSLocalizedFailureReason=No such file or directory}
Object:   
Method:   -discoveredToolInfoWithMacroExpansionScope:
Thread:   {number = 22, name = (null)}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
2022-04-22 13:45:33.730 xcodebuild[67561:3608596]  DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDELanguageSupport/IDELanguageSupport-19500/XCLanguageSupport/XCCompilerSpecificationSwift.m:171
Details:  unable to get the version for the swift compiler from the following command: /Users/csignori/Projects/iphone/xcremotecache/xcswiftc -v 2>&1
Object:   
Method:   -discoveredToolInfoWithMacroExpansionScope:
Thread:   {number = 22, name = (null)}
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.

The error says "No such file or directory" but if I run /Users/csignori/Projects/iphone/xcremotecache/xcswiftc -v, the file is there and I get Missing argument. Args: ["/Users/csignori/Projects/iphone/xcremotecache/xcswiftc", "-v"].

This behavior happens regardless of manual or automated RC integration.

Fastlane code:

build_app(
      workspace: ENV["XCWORKSPACE_PATH"],
      configuration: "Debug",
      scheme: ENV["SCHEME_NAME"],
      destination: "platform:iOS Simulator, name=iPhone 13 Pro,OS=15.2",
      clean: true,
      derived_data_path: ENV["DERIVEDDATA_DIR"],
      skip_package_ipa: true,
      skip_package_pkg: true,
      skip_package_dependencies_resolution: true,
      skip_build_archive: true,
      skip_archive: true,
      disable_package_automatic_updates: true,
    )

xcodebuild call:

xcodebuild -showBuildSettings \
           -workspace "$XCWORKSPACE_PATH" \
           -scheme "$SCHEME_NAME" \
           -configuration "Debug" \
           -destination "platform=iOS Simulator,name=iPhone 13 Pro,OS=15.2" \
           -derivedDataPath "$WORKSPACE/deriveddata" \
           -disableAutomaticPackageResolution 

Thanks!

cezarsignori commented 2 years ago

My mistake. Adding --showBuildSettings makes it so xcodebuild does not build AND show settings but shows settings INSTEAD of building.