apollographql / apollo-ios

📱  A strongly-typed, caching GraphQL client for iOS, written in Swift.
https://www.apollographql.com/docs/ios/
MIT License
3.86k stars 714 forks source link

make build-apollo-xc-framework fail with Error 70 #3427

Closed Karram-Ayman closed 5 hours ago

Karram-Ayman commented 3 weeks ago

Summary

Following creating xcframework from https://github.com/apollographql/apollo-ios-xcframework?tab=readme-ov-file make script fail 9 times out of 10 tries with Error 70

Version

1.14.1

Steps to reproduce the behavior

  1. Clone repo
  2. Run make build-apollo-xc-framework

Logs

Runing RegisterExecutionPolicyException /Users/a/Library/Developer/Xcode/DerivedData/Apollo-btbrgifwrrzzezcxjrmbkksenqto/Build/Intermediates.noindex/ArchiveIntermediates/Apollo/InstallationBuildProductsLocation/Users/a/Objects/Apollo.o (in target 'Apollo' from project 'Apollo' at path '/Users/a/Downloads/apollo-ios-xcframework-main/apollo-ios/Package.swift')
    cd /Users/a/Downloads/apollo-ios-xcframework-main/apollo-ios
    builtin-RegisterExecutionPolicyException /Users/a/Library/Developer/Xcode/DerivedData/Apollo-btbrgifwrrzzezcxjrmbkksenqto/Build/Intermediates.noindex/ArchiveIntermediates/Apollo/InstallationBuildProductsLocation/Users/a/Objects/Apollo.o

** ARCHIVE SUCCEEDED **

xcodebuild -create-xcframework -output ./build/Apollo.xcframework -framework ./build/iphonesimulator.xcarchive/Products/Library/Frameworks/Apollo.framework -framework ./build/iphoneos.xcarchive/Products/Library/Frameworks/Apollo.framework
error: the path does not point to a valid framework: /Users/a/Downloads/apollo-ios-xcframework-main/build/iphonesimulator.xcarchive/Products/Library/Frameworks/Apollo.framework
make: *** [build-apollo-xc-framework] Error 70

Anything else?

Even though ARCHIVE SUCCEEDED and build folder is been created with iphoneos.xcarchive and iphonesimulator.xcarchive still, failure happen with [build-apollo-xc-framework] Error 70 and xcframework been created

BobaFetters commented 3 weeks ago

Thanks for the report @Karram-Ayman , to help with investigating can you also tell me what version of Xcode/Xcode command line tools you are running?

Karram-Ayman commented 3 weeks ago

Hi @BobaFetters thank you for checking here is my Xcode and command line version Xcode 15.1 Build version 15C65

Karram-Ayman commented 3 weeks ago

@BobaFetters I am not sure if this helps but most of the time this works only if I open my terminal and do not use the script and call in my terminal step by step sometimes it does the same error but not as often as the script

I also try to call this before rm -rf ~/Library/Developer/Xcode/Archives/*

Then xcodebuild archive -configuration Release -project "Apollo.xcodeproj" -scheme "Apollo" -destination 'generic/platform=iOS Simulator' -archivePath "./build/iphonesimulator.xcarchive" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES

Then xcodebuild archive -configuration Release -project "Apollo.xcodeproj" -scheme "Apollo" -destination 'generic/platform=iOS' -archivePath "./build/iphoneos.xcarchive" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES

Then xcodebuild -create-xcframework -output ./build/Apollo.xcframework -framework ./build/iphonesimulator.xcarchive/Products/Library/Frameworks/Apollo.framework -framework ./build/iphoneos.xcarchive/Products/Library/Frameworks/Apollo.framework

calvincestari commented 3 weeks ago

Based on the number of search results for xcodebuild error 70 I don't think this is apollo-xc-framework specific. It looks like a combination of some other external factors.

Karram-Ayman commented 1 week ago

Hi @BobaFetters is there any plan to support building xcframework for ApolloTestSupport in https://github.com/apollographql/apollo-ios-xcframework?

calvincestari commented 1 week ago

No plans at the moment @Karram-Ayman. If there is enough of a use case and it's of benefit to the large part of the community then we can consider it.

Karram-Ayman commented 1 week ago

Thanks for getting back to me @calvincestari

BobaFetters commented 7 hours ago

@Karram-Ayman I have a PR up to fix another issue, and from what I can tell it also fixes this issue, not 100% sure still what was causing this but once we do another release this should be fixed.

Also we have had some other inquiries about ApolloTestSupport support so I am going to look into getting that added as well

github-actions[bot] commented 5 hours ago

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.