spotify / XCRemoteCache

Other
825 stars 50 forks source link

[WatchOS] Duplicate symbols for architecture armv7k arm64_32 arm64 #190

Closed canhth closed 10 months ago

canhth commented 1 year ago

Thank you for helping us in https://github.com/spotify/XCRemoteCache/issues/187 But it seems the issue still remains.

My integration setup [ x ] CocoaPods cocoapods-xcremotecache plugin 0.1.15

Description

❌ duplicate symbol '_$s9SwiftyRSA16_objc_PrivateKeyCACycfC' in

SwiftyRSA(SwiftyRSA+ObjC.o) SwiftyRSA(SwiftyRSA+ObjC.o)

❌ duplicate symbol '_$s9SwiftyRSA24_objc_VerificationResultCACycfC' in

SwiftyRSA(SwiftyRSA+ObjC.o) SwiftyRSA(SwiftyRSA+ObjC.o)

❌ duplicate symbol '_$s9SwiftyRSA18_objc_ClearMessageCACycfC' in

SwiftyRSA(SwiftyRSA+ObjC.o) SwiftyRSA(SwiftyRSA+ObjC.o)


### Others
- For Debug build, I can fix it by adding `config.build_settings['EXCLUDED_ARCHS[sdk=watchsimulator*]'] = 'arm64'` in Podfile and Excluded Architectures for Watch target.
- But Release/Staging configuration still error.
- Added the Watch target into `exclude_targets`, but it didn't work even though [XCRC] steps are removed from the target. 😢 
polac24 commented 1 year ago

Hi! Can you provide more logs (e.g. from Xcode?). I wonder what command actually fails with duplications: is that xclipo, xccc, xcswift? In #187 that was coming from xcld I think, so probably that is a different problem.

canhth commented 1 year ago

Hi @polac24, The error coming from xcld, here is a small path of the log:

Projects-dir/App-demo/XCRC/xcld -target x86_64-apple-watchos7.0-simulator -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator9.1.sdk -L<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/EagerLinkingTBDs -L<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/watchsimulator -L/Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator9.1.sdk/usr/lib/swift -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/EagerLinkingTBDs -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/Alamofire-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/Arcane-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/InternalFoundationKit-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/InternalNetworkKit-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/InternalWatchAppShared-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/BaseModels-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/AppClient-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/AppHTTPDNS-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/AppSession-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/BlueCryptor-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/BlueECC-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/BlueRSA-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/CombineExt-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/DateToolsSwift-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/HTTPCore-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/KeychainAccess-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/KeychainExtension-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/KituraContracts-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/LocalizationKit-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/Localize-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/LoggableKit-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/LoggerAPI-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/Logging-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/Persistent-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/PromiseKit.root-CorePromise-Foundation -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/InternalSmartDomainSDK-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/SwiftJWT-watchOS -F<Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/SwiftyRSA-watchOS -filelist <Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/App.build/Dev\ Debug-watchsimulator/AppWatch\ Watch\ App.build/Objects-normal/x86_64/AppWatch\ Watch\ App.LinkFileList -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker <Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/App.build/Dev\ Debug-watchsimulator/AppWatch\ Watch\ App.build/Objects-normal/x86_64/AppWatch\ Watch\ App_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -debug_variant -fprofile-instr-generate -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/watchsimulator -L/usr/lib/swift -Xlinker -add_ast_path -Xlinker <Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/App.build/Dev\ Debug-watchsimulator/AppWatch\ Watch\ App.build/Objects-normal/x86_64/AppWatch_Watch_App.swiftmodule -ObjC -lc++ -framework Alamofire -framework Arcane -framework InternalFoundationKit -framework InternalNetworkKit -framework InternalWatchAppShared -framework BaseModels -framework AppClient -framework AppHTTPDNS -framework AppSession -framework CFNetwork -framework Combine -framework CombineExt -framework Cryptor -framework CryptorECC -framework CryptorRSA -framework DateToolsSwift -framework Foundation -framework HTTPCore -framework KeychainAccess -framework KeychainExtension -framework KituraContracts -framework LocalizationKit -framework Localize -framework LoggableKit -framework LoggerAPI -framework Logging -framework Persistent -framework PromiseKit -framework Security -framework InternalSmartDomainSDK -framework SwiftJWT -framework SwiftyRSA -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker <Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/App.build/Dev\ Debug-watchsimulator/AppWatch\ Watch\ App.build/AppWatch\ Watch\ App.app-Simulated.xcent -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __ents_der -Xlinker <Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/App.build/Dev\ Debug-watchsimulator/AppWatch\ Watch\ App.build/AppWatch\ Watch\ App.app-Simulated.xcent.der -framework Pods_AppWatch_Watch_App -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker <Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/App.build/Dev\ Debug-watchsimulator/AppWatch\ Watch\ App.build/Objects-normal/x86_64/AppWatch\ Watch\ App_dependency_info.dat -o <Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/App.build/Dev\ Debug-watchsimulator/AppWatch\ Watch\ App.build/Objects-normal/x86_64/Binary/AppWatch\ Watch\ App

duplicate symbol '_$s6Arcane3AESVMn' in:
    <Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev Debug-watchsimulator/Arcane-watchOS/Arcane.framework/Arcane(AES.o)
duplicate symbol '_$s6Arcane3AESVMa' in:
    <Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev Debug-watchsimulator/Arcane-watchOS/Arcane.framework/Arcane(AES.o)
duplicate symbol '_$s6Arcane3AESV7encrypt_3key0D4SizeSSSgSS_SSSitFZ' in:
    <Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev Debug-watchsimulator/Arcane-watchOS/Arcane.framework/Arcane(AES.o)
duplicate symbol '_$s6Arcane3AESV7decrypt_3key0D4SizeSSSgSS_SSSitFZ' in:
    <Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev Debug-watchsimulator/Arcane-watchOS/Arcane.framework/Arcane(AES.o)
duplicate symbol '_$s6Arcane3AESV7encrypt_3key0D4Size10Foundation4DataVSgAI_AISitFZ' in:
    <Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev Debug-watchsimulator/Arcane-watchOS/Arcane.framework/Arcane(AES.o)
duplicate symbol '_$s6Arcane3AESV7decrypt_3key0D4Size10Foundation4DataVSgAI_AISitFZ' in:
    <Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev Debug-watchsimulator/Arcane-watchOS/Arcane.framework/Arcane(AES.o)
canhth commented 1 year ago

I've tried to reproduce the issue in my demo project but only reproduce it once. (change the Deployment target of watchOS and added OTHER_LDFLAGS -ObjC)

Here is the full build log of it. Error-demo.txt

polac24 commented 1 year ago

Thanks for a log. Maybe we forgot to bump the schema version and your remote cache is polluted with a target that has duplicated symbols (here)?

As a quick verification:

  1. In your reproduce scenario, did you use a remote cache that could have artifacts generated by a previous version?
  2. If so, maybe you can workaround that by add a "hacky" value that emulate the shema bump: add custom_fingerprint_envs: ['XCODE_PRODUCT_BUILD_VERSION'] to your .rcinfo. That will add XCODE_PRODUCT_BUILD_VERSION value yet another time, which would actually invalidates all previously generated artifacts (here is the code).

If your remote cache (used in the above log) was produced from scratch, I need to spend some more time and carefully analyze your flow.

canhth commented 1 year ago

Hi @polac24 , I've tried to remove all the old cache in my server, and the problem still remains. All the caches are now generated with the latest version, I don't think it is polluted with duplicated symbols....

polac24 commented 1 year ago

I tried to reproduce it locally with the Standalone project (link) but no success so far.

If you find a reliable set of steps to reproduce or have a sample project, that could be useful. Otherwise, I will try to analyze the potential issue once I have more time (hopefully over the weekend).

polac24 commented 1 year ago

I've tried to remove all the old cache in my server

@canhth, did you also remove your local CAS cache at ls -al ~/Library/Caches/XCRemoteCache?

I looked into the code and tried to reproduce that with a demo project but for me everything looks fine. If that happens again locally, can you post here some extra commands from machO files that report a problem, e.g.

otool -f  <Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev Debug-watchsimulator/Arcane-watchOS/Arcane.framework/Arcane
otool -L  <Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev Debug-watchsimulator/Arcane-watchOS/Arcane.framework/Arcane
file  <Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev Debug-watchsimulator/Arcane-watchOS/Arcane.framework/Arcane
nm  <Xcode-path>DerivedData/App-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev Debug-watchsimulator/Arcane-watchOS/Arcane.framework/Arcane
canhth commented 1 year ago

Hi @polac24 , Yes, I did remove all the cache from local and remote server. Also, use the new path for cache_addresses.

The funny thing here is that my actual project, it's failing only for Release or Staging configuration. Dev Debug still fine 😢 .

Is there anything related to this config?

# Variables for XCRemote Cache
    if ENV['XCREMOTE_PLATFORM'] == nil
      ENV['XCREMOTE_PLATFORM'] =
        if configuration == 'Dev Debug'
          'iphonesimulator'
        else
          'iphoneos'
        end
    end
canhth commented 1 year ago

The flow to reproduce this in my project:

  1. Delete all the caches.
  2. Generate the cache at commit A.
  3. Everything works fine.
  4. Some other members pushed the new changes.
  5. CI jobs generate cache 4 times per day. (same commit SHA will generate 2 cache for Debug and Release)
  6. Then some PRs will get the error. Sometimes with Debug(simulator), some with Release(iphoneos).

Is there any way I can completely ignore the Watch target and its dependencies? I tried it before as mentioned earlier but seems doesn't work.

polac24 commented 1 year ago

Curious if any of the producer ever printed a warning like that :

libtool: warning for architecture: x86_64 same member name (xxxx.o) in output file used for input files: /xxxx(xxxx.o) and: xxxxx(xxxxxx.o) due to use of basename, truncation and blank padding

That might be a hint, but honestly, I don't see a flow that could potentially trigger it.

polac24 commented 1 year ago

@canhth, Hi! In the meantime, I added a new feature that disables XCRC for some SDKs so you would be able to disable it for watchOS completely. It would be nice if you could test if excluding the watch SDK works for you from #196.

canhth commented 1 year ago

Thanks @polac24 , I've tried to build the release package and use pod extension from your forked branch. But getting this error for Broadcast target 😢 :

SwiftDriver Broadcast normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'Broadcast' from project 'MyProject')
    cd /Users/canhtran/Documents/Projects/MyProject-com
    builtin-SwiftDriver -- /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -module-name Broadcast -Onone -whole-module-optimization -enforce-exclusivity\=checked @/Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-...........
    ..........
error: unknown argument: '-debug-prefix-map=/Users/canhtran/Documents/Projects/<ProjectName>=/xxxxxxxxxx'
Command CompileSwiftSources failed with a nonzero exit code

Btw, can we make this as a warning instead of error? error: Prepare failed with error: Finding a common commit failed. Please try to callgit fetch origin. [Error: statusError("status 1: ", 1)]

polac24 commented 1 year ago

Hi @canhth,

  1. Sorry for that, I made a silly mistake, but a fix is simple: #197. Would be nice if you could verify again. BTW. Are you able to pass me the entire command line - the one starting with builtin-SwiftDriver -- ...? I have never seent that.
  2. No, we cannot make it a warning, as this is a critical part of the flow. If we cannot find a "common" sha, XCRemoteCache cannot be used at all.
canhth commented 1 year ago

Hi @polac24 , Yah, sure. Here is the entire command that causes the error in #196. FYI: Broadcast is iOS Extension.

Screen Shot 2023-04-11 at 11 52 34
 SwiftDriver Broadcast normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'Broadcast' from project 'MyProject')
    cd /Users/canhtran/Documents/Projects/MyProject-com
    builtin-SwiftDriver -- /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -module-name Broadcast -Onone -whole-module-optimization -enforce-exclusivity\=checked @/Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/MyProject.build/Dev\ Debug-iphonesimulator/Broadcast.build/Objects-normal/x86_64/Broadcast.SwiftFileList -DDEBUG -debug-prefix-map\=/Users/canhtran/Documents/Projects/MyProject-com\= -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.2.sdk -target x86_64-apple-ios13.0-simulator -enable-bare-slash-regex -g -module-cache-path /Users/canhtran/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -Xfrontend -serialize-debugging-options -application-extension -profile-coverage-mapping -profile-generate -enable-testing -index-store-path /Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Index.noindex/DataStore -swift-version 5 -I /Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-iphonesimulator -F /Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-iphonesimulator -F /Users/canhtran/Documents/Projects/MyProject-com/Pods/AgoraRtcEngine_Special_iOS -F /Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-iphonesimulator/XCFrameworkIntermediates/AgoraRtcEngine_Special_iOS/ReplayKit_duplicate -parse-as-library -emit-localized-strings -emit-localized-strings-path /Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/MyProject.build/Dev\ Debug-iphonesimulator/Broadcast.build/Objects-normal/x86_64 -c -num-threads 10 -output-file-map /Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/MyProject.build/Dev\ Debug-iphonesimulator/Broadcast.build/Objects-normal/x86_64/Broadcast-OutputFileMap.json -use-frontend-parseable-output -save-temps -no-color-diagnostics -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/MyProject.build/Dev\ Debug-iphonesimulator/Broadcast.build/Objects-normal/x86_64/Broadcast.swiftmodule -Xcc -I/Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/MyProject.build/Dev\ Debug-iphonesimulator/Broadcast.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/MyProject.build/Dev\ Debug-iphonesimulator/Broadcast.build/Broadcast-generated-files.hmap -Xcc -I/Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/MyProject.build/Dev\ Debug-iphonesimulator/Broadcast.build/Broadcast-own-target-headers.hmap -Xcc -I/Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/MyProject.build/Dev\ Debug-iphonesimulator/Broadcast.build/Broadcast-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/MyProject.build/Dev\ Debug-iphonesimulator/Broadcast.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/MyProject.build/Dev\ Debug-iphonesimulator/Broadcast.build/Broadcast-project-headers.hmap -Xcc -I/Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-iphonesimulator/include -Xcc -I/Users/canhtran/Documents/Projects/MyProject-com/Pods/Headers/Public -Xcc -I/Users/canhtran/Documents/Projects/MyProject-com/Pods/Headers/Public/Firebase -Xcc -I/Users/canhtran/Documents/Projects/MyProject-com/Pods/Headers/Public/rapidjson -Xcc -I/Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/MyProject.build/Dev\ Debug-iphonesimulator/Broadcast.build/DerivedSources-normal/x86_64 -Xcc -I/Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/MyProject.build/Dev\ Debug-iphonesimulator/Broadcast.build/DerivedSources/x86_64 -Xcc -I/Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/MyProject.build/Dev\ Debug-iphonesimulator/Broadcast.build/DerivedSources -Xcc -DDEBUG\=1 -Xcc -DCOCOAPODS\=1 -emit-objc-header -emit-objc-header-path /Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/MyProject.build/Dev\ Debug-iphonesimulator/Broadcast.build/Objects-normal/x86_64/Broadcast-Swift.h -import-objc-header /Users/canhtran/Documents/Projects/MyProject-com/Broadcast/Broadcast-Bridging-Header.h -pch-output-dir /Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/PrecompiledHeaders -working-directory /Users/canhtran/Documents/Projects/MyProject-com

error: Driver threw unknown argument: '-debug-prefix-map=/Users/canhtran/Documents/Projects/MyProject-com=' without emitting errors. (in target 'Broadcast' from project 'MyProject')

I've tried with your new change #197, but seems it doesn't work, still getting the same error above. gem 'cocoapods-xcremotecache', :git => 'https://github.com/polac24/XCRemoteCache.git', :branch => 'fix-exclude-sdk' (kept the same binaries created in #196, only update this gem to new branch.)

polac24 commented 1 year ago

Thanks, that was helpful. Can you try again with #197 (pushed a fix)?

canhth commented 1 year ago

Thanks @polac24 , The problem about -debug-prefix-map is fixed. But for the ignore watchos SDK, I'm still getting the same issue:

Ld /Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/MyProject.build/Dev\ Debug-watchsimulator/MyProjectWatch\ Watch\ App.build/Objects-normal/x86_64/Binary/MyProjectWatch\ Watch\ App normal x86_64 (in target 'MyProjectWatch Watch App' from project 'MyProject')
    cd /Users/canhtran/Documents/Projects/MyProject-com
    /Users/canhtran/Documents/Projects/MyProject-com/XCRC/xcld -target x86_64-apple-watchos7.0-simulator -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator9.1.sdk -L/Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/EagerLinkingTBDs -L/Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/watchsimulator -L/Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator9.1.sdk/usr/lib/swift -F/Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/EagerLinkingTBDs -F/Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator -F/Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/Alamofire-watchOS -F/Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/Arcane-watchOS -F/Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/AAAFoundationKit-watchOS -F/Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/AAANetworkKit-watchOS
    ......
  ld: 53888 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
polac24 commented 1 year ago

Maybe you are missing the * in the simulator name? (I corrected my PR description - had a typo there).

'exclude_sdks_configurations' => ['watchos*', 'watchsimulator*'],
canhth commented 1 year ago

Hi @polac24 , Thanks for correct that, I've added *. And now another error appears (both CI and my local machine):

❌  error: unable to spawn process '/Applications/Xcode-14.2.app/Contents/SharedFrameworks/XCBuild.framework/Versions/A/PlugIns/XCBBuildService.bundle/Contents/Frameworks/../../../../../../../../PlugIns/XCBSpecifications.ideplugin/Contents/Resources' (Permission denied) (in target 'SwiftyRSA-watchOS' from project 'SwiftyRSA')

Full logs:

    cd /Users/canhtran/Documents/Projects/MyProject-com/Pods
    /Applications/Xcode.app/Contents/SharedFrameworks/XCBuild.framework/Versions/A/PlugIns/XCBBuildService.bundle/Contents/Frameworks/../../../../../../../../PlugIns/XCBSpecifications.ideplugin/Contents/Resources -static -arch_only x86_64 -D -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/WatchSimulator.platform/Developer/SDKs/WatchSimulator9.1.sdk -L/Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/SwiftyRSA-watchOS -filelist /Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev\ Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/x86_64/SwiftyRSA.LinkFileList -framework Foundation -dependency_info /Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev\ Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/x86_64/SwiftyRSA_libtool_dependency_info.dat -o /Users/canhtran/Library/Developer/Xcode/DerivedData/MyProject-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev\ Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/x86_64/Binary/SwiftyRSA

error: unable to spawn process '/Applications/Xcode.app/Contents/SharedFrameworks/XCBuild.framework/Versions/A/PlugIns/XCBBuildService.bundle/Contents/Frameworks/../../../../../../../../PlugIns/XCBSpecifications.ideplugin/Contents/Resources' (Permission denied) (in target 'SwiftyRSA-watchOS' from project 'SwiftyRSA')
polac24 commented 1 year ago

Interesting, would setting SWIFT_EXEC=swiftc for the watchsimulator* sdk resolve it? If so, we have to set this "magical" value instead of an empty string to fallback to the "orignal" toolchain.

polac24 commented 1 year ago

I prepared a branch to verify if swiftc value fixes that.

canhth commented 1 year ago

Hi @polac24 , I think it didn't work, still has the same issue.

polac24 commented 1 year ago

Wow, that was the weirdest error I have seen recently.

I pushed a new commit: b89d98f4112f54ad127fbb84c9177862241b04ab to the branch. If you see a similar problem, probably we have to apply the same "fixes" for all other overrides (like LD -> ld etc.).

That fix sounds like a code smell, but it is the simplest workaround for Xcode's strange behavior.

canhth commented 1 year ago

Hi @polac24 , Thanks for your support. Seems the latest commit fixes the problem. My project can build now. I'll use your add-swiftc-disabled branch for testing in few days. Please help not to delete that branch.

polac24 commented 1 year ago

I will keep the old branch, but if you could switch to polac24:bartosz/20230413-override-exclusions (the one that hopefully will land on master), would ensure we are merging the right fix.

canhth commented 1 year ago

Hi @polac24 , Now everything working as expected. The Watch target is too small and we can completely ignore that.

But here is one case that I think we should improve.

Even though we set the git-clone depth in my CI job to a big number, but some branches contain a lot of commits and not sync with main branch.

Example: git-clone with depth=20 , but that branch actually needs depth=30. Then run pod_install...

Expected is just need to throw a warning or disable XCRemoteCache, not throw an error like this:

error: Prepare failed with error: Finding a common commit failed. Please try to call `git fetch origin`. [Error: statusError("status 1: ", 1)]

polac24 commented 1 year ago

Oh, so you use a shallow clone. Let me see how easy is that to add.

canhth commented 1 year ago

Hi @polac24 , The PR #199 has been merged to master. Do we plan to release a new version soon? If not, I'll generate from my side and use it first.

polac24 commented 1 year ago

Sure, can do that: 0.3.23.

canhth commented 1 year ago

Hi @polac24 , Sorry to put comment here, but I'm not sure if this error is related to the changes regarding handling missing common sha?

[13:07:12]: ▸ [XCRC] XCRemoteCache disabled with error: undefined method `product_ref_group' for <PBXBuildFile UUID=`1FA79B00000000`>:Xcodeproj::Project::Object::PBXBuildFile
[13:07:12]: ▸ Did you mean?  product_ref
[13:07:12]: ▸ /Users/********/.gem/ruby/2.7.0/gems/xcodeproj-1.22.0/lib/xcodeproj/project.rb:232:in `initialize_from_file': undefined method `product_ref_group' for <PBXBuildFile UUID=`1FA79B00000000`>:Xcodeproj::Project::Object::PBXBuildFile (NoMethodError)
polac24 commented 1 year ago

No, that is something else (and looks the error comes from the Xcodeproj library)

grigorye commented 11 months ago

I'm not sure if this is the same issue, but I encounter duplicate symbols with universal builds with certain frameworks, i.e. builds employing -destination 'generic/platform=iOS Simulator'. From what I could identify so far, the potential problem is that when caching is employed, particularly with static frameworks, the architecture-specific static library objects are substituted with (unexpectedly) fat binaries instead of thinned ones (as I observe without caching), hence "CreateUniversalBinary" build phase merges two fat binaries, apparently producing the duplicates (because per-arch stuff exists in both binaries).

Stripping out potentially sensitive stuff from the command invocation, when cache is employed, I see this, when (static) Foo.framework is built (linking it results in the problems later):

CreateUniversalBinary ./.DerivedData/MyApp/Build/Products/Debug-iphonesimulator/Foo/Foo.framework/Foo normal arm64\ x86_64 (in target 'Foo' from project 'Pods')
    cd ./Pods
    ./Pods/../XCRC/xclibtool -static ./.DerivedData/MyApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Foo.build/Objects-normal/arm64/Binary/Foo ./.DerivedData/MyApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Foo.build/Objects-normal/x86_64/Binary/Foo -o ./.DerivedData/MyApp/Build/Products/Debug-iphonesimulator/Foo/Foo.framework/Foo

while it's clearly seen that the binary that should be arm64-only is a fat one:

$ file ./.DerivedData/MyApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Foo.build/Objects-normal/arm64/Binary/Foo
./.DerivedData/MyApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Foo.build/Objects-normal/arm64/Binary/Foo: Mach-O universal binary with 2 architectures: [arm64:current ar archive] [x86_64:current ar archive]
./.DerivedData/MyApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Foo.build/Objects-normal/arm64/Binary/Foo (for architecture arm64):   current ar archive
./.DerivedData/MyApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Foo.build/Objects-normal/arm64/Binary/Foo (for architecture x86_64):  current ar archive

as well as the binary for x64_64:

$ file ./.DerivedData/MyApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Foo.build/Objects-normal/x86_64/Binary/Foo
./.DerivedData/MyApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Foo.build/Objects-normal/x86_64/Binary/Foo: Mach-O universal binary with 2 architectures: [arm64:current ar archive] [x86_64:current ar archive]
./.DerivedData/MyApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Foo.build/Objects-normal/x86_64/Binary/Foo (for architecture arm64):  current ar archive
./.DerivedData/MyApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Foo.build/Objects-normal/x86_64/Binary/Foo (for architecture x86_64): current ar archive

A bit of update on the above: I checked it further and it looks like the fat binary comes from the cached artifacts, i.e. it actually matches the one generated on producer. It's still a question why that binary is used in place of arch-specific binaries, and not the arch-specific binaries that could be probably cached as well.

grigorye commented 11 months ago

This fixes the case that I encounter: https://github.com/spotify/XCRemoteCache/pull/220

polac24 commented 11 months ago

This is strange that the flow reaches XCCreateBinary's code. For your command:

    ./Pods/../XCRC/xclibtool -static ./.DerivedData/MyApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Foo.build/Objects-normal/arm64/Binary/Foo ./.DerivedData/MyApp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Foo.build/Objects-normal/x86_64/Binary/Foo -o ./.DerivedData/MyApp/Build/Products/Debug-iphonesimulator/Foo/Foo.framework/Foo

the expected behaviour is that xclibtool (which mocks libtool) recognizes that it is a "universal binary phase" https://github.com/spotify/XCRemoteCache/blob/6a1335ea971df7b31c753b3977cd493b6598fd01/Sources/xclibtoolSupport/XCLibtoolHelper.swift#L66-L71 and thus fall into: https://github.com/spotify/XCRemoteCache/blob/6a1335ea971df7b31c753b3977cd493b6598fd01/Sources/XCRemoteCache/Commands/Libtool/XCLibtool.swift#L48-L49

As written https://github.com/spotify/XCRemoteCache/blob/6a1335ea971df7b31c753b3977cd493b6598fd01/Sources/XCRemoteCache/Commands/Libtool/XCCreateUniversalBinary.swift#L80-L85 XCCreateUniversalBinary will not invoke any Xcode's commands but just link the cached fat archive into the final output.

Summary

In your PR I see that you check for "-static", "-arch_only" args so probably you have different args. Can you provide the full list of libtool/lipo/xcld etc. commands in the target that is problematic for you? A reproducible project would be the best though

I guess we will need to add support for -arch_only which indeed is not supported (yet) in XCRemoteCache.

grigorye commented 11 months ago

In your PR I see that you check for "-static", "-arch_only" args so probably you have different args. Can you provide the full list of libtool/lipo/xcld etc. commands in the target that is problematic for you?

Yes, sorry, I omitted it from this very issue. The problem is not with CreateUnversalBinary per se, rather with the binaries that are handed over to it: they're not thin, rather fat ones (actually from what I saw, it's the same binary coming from the cache and generated via CreateUniversalBinary in producer mode). So what that PR addresses is the step with creation of the of those two binaries that are later handed as input into CreateUniversalBinary (that is not CreateUniversalBinary rather something else like Libtool or something - will check it again a bit later).

grigorye commented 11 months ago

XCCreateUniversalBinary will not invoke any Xcode's commands but just link the cached fat archive into the final output.

I see, yes, this should make it work (I also thought of it as a workaround), let me try to reproduce/check it.

grigorye commented 11 months ago

@polac24 I feel like I figured it out in the above case (I mean, why the workaround in CreateUnversalBinary does not work), https://github.com/spotify/XCRemoteCache/pull/221. That fix works as well, as an alternative to #220.

Just to let you know, I'm still not confident that XCRC placing the fat binaries instead of (expected) thin ones is not a bug: I would expect that at any stage, the binaries generated by XCRC should match the ones that are generated without caching/when caching. I'm new to the tool, though, so probably I miss something/it's another story.

canhth commented 11 months ago

Thanks a lot @grigorye and @polac24 🙇‍♂️ May I ask if will we have a new release soon which contains this new fix?

polac24 commented 11 months ago

Sure, release 0.3.27

canhth commented 10 months ago

Hi @polac24, When I try to remove this configuration 'exclude_sdks_configurations' => ['watchos*', 'watchsimulator*'], the old issue happen again.

Failed with: unsupportedMode. Args: ["/Users/canhtran/Documents/Projects/MyProject/XCRC/xclibtool", "-static", "/Users/canhtran/Library/Developer/Xcode/DerivedData/Binance-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/arm64/Binary/SwiftyRSA", "/Users/canhtran/Library/Developer/Xcode/DerivedData/Binance-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/i386/Binary/SwiftyRSA", "/Users/canhtran/Library/Developer/Xcode/DerivedData/Binance-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/x86_64/Binary/SwiftyRSA", "-o", "/Users/canhtran/Library/Developer/Xcode/DerivedData/Binance-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev Debug-watchsimulator/SwiftyRSA-watchOS/SwiftyRSA.framework/SwiftyRSA"]

Is there any configuration that I missed? 🤔

polac24 commented 10 months ago

Are you sure you are on v0.3.27? This has been recently fixed in #222

canhth commented 10 months ago

Confirm that I'm using the latest version 0.3.27 & cocoapods 0.0.18 😢

polac24 commented 10 months ago

What is the exact command that is invoked? A log from Xcode will help. I download 0.3.27 run xclibtool executable correctly (it fails because paths don't exist on my machine):

$ ./xclibtool  -static /Users/canhtran/Library/Developer/Xcode/DerivedData/Binance-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev\ Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/arm64/Binary/SwiftyRSA /Users/canhtran/Library/Developer/Xcode/DerivedData/Binance-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/i386/Binary/SwiftyRSA /Users/canhtran/Library/Developer/Xcode/DerivedData/Binance-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev\ Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/x86_64/Binary/SwiftyRSA -o /Users/canhtran/Library/Developer/Xcode/DerivedData/Binance-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/SwiftyRSA-watchOS/SwiftyRSA.framework/SwiftyRSA

error: /Applications/Xcode-14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't open file:....

Do you have the same error when running from terminal?Which Xcode do you use?

canhth commented 10 months ago

I'm using XCode version 14.3.1

Here are the screenshot and logs from my machine:

Screenshot 2023-08-16 at 17 06 52
Showing All Errors Only

Build target SwiftyRSA-watchOS of project SwiftyRSA with configuration Dev Debug

CreateUniversalBinary /Users/canhtran/Library/Developer/Xcode/DerivedData/MyApp-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/SwiftyRSA-watchOS/SwiftyRSA.framework/SwiftyRSA normal arm64\ i386\ x86_64 (in target 'SwiftyRSA-watchOS' from project 'SwiftyRSA')
    cd /Users/canhtran/Documents/Projects/MyApp-com/Pods
    /Users/canhtran/Documents/Projects/MyApp-com/Pods/../XCRC/xclibtool -static /Users/canhtran/Library/Developer/Xcode/DerivedData/MyApp-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev\ Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/arm64/Binary/SwiftyRSA /Users/canhtran/Library/Developer/Xcode/DerivedData/MyApp-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev\ Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/i386/Binary/SwiftyRSA /Users/canhtran/Library/Developer/Xcode/DerivedData/MyApp-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev\ Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/x86_64/Binary/SwiftyRSA -o /Users/canhtran/Library/Developer/Xcode/DerivedData/MyApp-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/SwiftyRSA-watchOS/SwiftyRSA.framework/SwiftyRSA

error: Failed with: unsupportedMode. Args: ["/Users/canhtran/Documents/Projects/MyApp-com/XCRC/xclibtool", "-static", "/Users/canhtran/Library/Developer/Xcode/DerivedData/MyApp-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/arm64/Binary/SwiftyRSA", "/Users/canhtran/Library/Developer/Xcode/DerivedData/MyApp-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/i386/Binary/SwiftyRSA", "/Users/canhtran/Library/Developer/Xcode/DerivedData/MyApp-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/x86_64/Binary/SwiftyRSA", "-o", "/Users/canhtran/Library/Developer/Xcode/DerivedData/MyApp-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev Debug-watchsimulator/SwiftyRSA-watchOS/SwiftyRSA.framework/SwiftyRSA"]

Failed with: unsupportedMode. Args: ["/Users/canhtran/Documents/Projects/MyApp-com/XCRC/xclibtool", "-static", "/Users/canhtran/Library/Developer/Xcode/DerivedData/MyApp-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/arm64/Binary/SwiftyRSA", "/Users/canhtran/Library/Developer/Xcode/DerivedData/MyApp-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/i386/Binary/SwiftyRSA", "/Users/canhtran/Library/Developer/Xcode/DerivedData/MyApp-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/x86_64/Binary/SwiftyRSA", "-o", "/Users/canhtran/Library/Developer/Xcode/DerivedData/MyApp-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev Debug-watchsimulator/SwiftyRSA-watchOS/SwiftyRSA.framework/SwiftyRSA"]

Build failed    16/08/2023, 16:47    57.1 seconds

Same output when I run this command:

.<MyXCRC_dir>/xclibtool  -static /Users/canhtran/Library/Developer/Xcode/DerivedData/MyApp-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev\ Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/arm64/Binary/SwiftyRSA /Users/canhtran/Library/Developer/Xcode/DerivedData/MyApp-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev\ Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/i386/Binary/SwiftyRSA /Users/canhtran/Library/Developer/Xcode/DerivedData/MyApp-hbydakxttvkkggdnfmcfqpdwplfx/Build/Intermediates.noindex/SwiftyRSA.build/Dev\ Debug-watchsimulator/SwiftyRSA-watchOS.build/Objects-normal/x86_64/Binary/SwiftyRSA -o /Users/canhtran/Library/Developer/Xcode/DerivedData/MyApp-hbydakxttvkkggdnfmcfqpdwplfx/Build/Products/Dev\ Debug-watchsimulator/SwiftyRSA-watchOS/SwiftyRSA.framework/SwiftyRSA
canhth commented 10 months ago

Thanks @polac24 , I tried with your patch and it works well 🙇‍♂️

canhth commented 10 months ago

All issue has been fixed now. I will close this issue. Thanks a lot @polac24 @grigorye 🙇‍♂️