spotify / XCRemoteCache

Other
835 stars 52 forks source link

Consumer fails on CocoaPods lib #98

Closed aturan23 closed 2 years ago

aturan23 commented 2 years ago

My integration setup

CocoaPods cocoapods-xcremotecache plugin

Minimal reproduction of the problem with instructions

Producer works fine. Build succeeds.

Consumer Logs

...
2022-03-01 12:44:16.479 I  xcprebuild[92348:1bf4e9] Extra config override failed with missingConfigurationFile(user.rcinfo -- file:///Users/as.turan/build/mobile-ios/Pods/). Skipping extra configuration
2022-03-01 12:44:16.480 E  xcprebuild[92348:1bf4e9] (SomeLib) Couldn't verify if should disable RC for 18b80f9278e37b3c0d03a966aa3885c8f7262b2a.
2022-03-01 12:44:16.483 I  xcprebuild[92348:1bf4e9] (SomeLib) Found url to remapp: file:///Users/as.turan/build/DerivedData/MobileiOS-btwxsfumsrlvupejzudbjazglqqi/Build/Products/. Remapping: /Users/as.turan/build/DerivedData/MobileiOS-btwxsfumsrlvupejzudbjazglqqi/Build/Products
2022-03-01 12:44:16.483 I  xcprebuild[92348:1bf4e9] (SomeLib) Found url to remapp: file:///Users/as.turan/build/mobile-ios/Pods/. Remapping: /Users/as.turan/build/mobile-ios/Pods
2022-03-01 12:44:16.484 I  xcprebuild[92348:1bf4e9] (SomeLib) Making request http://localhost:8080/cache/meta/18b80f9278e37b3c0d03a966aa3885c8f7262b2a-SomeLib-Debug-iphonesimulator-13C100-53ef7ffb91ece1364f3217fd1a54c08c.json
2022-03-01 12:44:16.516 I  xcswiftc[92347:1bf4e6] Swiftc noop for x86_64-apple-ios13-simulator
...
2022-03-01 12:44:16.987 I  xcprebuild[92348:1bf4e9] (SomeLib) Downloading artifact to file:///Users/as.turan/build/DerivedData/MobileiOS-btwxsfumsrlvupejzudbjazglqqi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SomeLib.build/xccache/51921addea78eae65c56d4c5bddcf80d.zip
...
2022-03-01 12:44:17.770 I  xcprebuild[92348:1bf4e9] (SomeLib) Artifact unzipped to file:///Users/as.turan/build/DerivedData/MobileiOS-btwxsfumsrlvupejzudbjazglqqi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SomeLib.build/xccache/51921addea78eae65c56d4c5bddcf80d
...
2022-03-01 12:44:17.921 I  xcswiftc[92401:1bf5cb] Optional .swiftinterface file not found in the artifact at: /Users/as.turan/build/DerivedData/MobileiOS-btwxsfumsrlvupejzudbjazglqqi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SomeLib.build/Objects-normal/x86_64/SomeLib.swiftinterface
 

Pods/Carthage file

plugin 'cocoapods-xcremotecache'

xcremotecache({
    'cache_addresses' => ['http://localhost:8080/cache'], 
    'primary_repo' => '....git',
    'cache_commit_history' => 30,
    'artifact_maximum_age' => 7,
    'final_target' => 'MobileiOS',
    'primary_branch' => 'dev',
    'mode' => 'consumer',
})

min_iOS_target = '13'
platform :ios, min_iOS_target

use_frameworks!

...
 

Environment

Post build stats

hit_count: 98
miss_count: 1
local_cache_bytes: 201216000
indexing_hit_count: 0
indexing_miss_count: 0

Others Error log:

ld: file too small (length=0) file '/Users/as.turan/build/DerivedData/MobileiOS-btwxsfumsrlvupejzudbjazglqqi/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/SomeLib.build/Objects-normal/x86_64/Localizable.o'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
polac24 commented 2 years ago

Hello! As long all logs that mention SomeLib related to the same target, it suggests that the cached zip artifact for SomeLib was correctly downloaded, unzipped and the swift compilation step was mocked (no-op reported in Swiftc noop for x86_64-apple-ios13-simulator). However, for some reason a linker step wasn't mocked it tries to link locally.

  1. Can you check in Xcode's Build Settings if your have LD override in that target and it points to "$SRCROOT/#{srcroot_relative_xc_location}/xcld".?
  2. Does that file exist?
  3. Can you copy a failing command from Xcode (expand the Xcode's log using the "hamburger" menu) and invoke it from a terminal?
  4. The command in Xcode should start with {SOME_ABSOLUTE_PATH}/xcld ...
  5. Once you invoke it from a terminal, do you have any recent logs in log show...?