Repository navigation
fix(ios): silence third-party pod warnings in the Xcode Cloud archive - #1191
Merged
Merged
Conversation
Every Xcode Cloud archive reported about 30 warnings, none from our code: - Link steps warned "Search path '.../Metal.xctoolchain/usr/lib/swift/iphoneos' not found". CocoaPods and some podspecs add $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME) to LIBRARY_SEARCH_PATHS, and on Xcode Cloud TOOLCHAIN_DIR resolves to the Metal toolchain. post_install now drops that entry. The app targets iOS 15, whose Swift runtime is in /usr/lib/swift. This replaces the Xcode 15 DT_TOOLCHAIN_DIR rewrite, which the regex also covers. - Flutter plugin and Firebase sources (firebase_auth/core/storage, share_plus, device_info_plus) warned about deprecations, unused variables and so on. Pod targets now set GCC_WARN_INHIBIT_ALL_WARNINGS and SWIFT_SUPPRESS_WARNINGS.
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problem
The Xcode Cloud "Deploy to TestFlight | Archive - iOS" run reports about 30 warnings on every build (31 on #1160 and #1164, 29 on #1190). None of them come from our code:
Search path '.../Metal.xctoolchain/usr/lib/swift/iphoneos' not found, one per Swift pod plus the app..pub-cache: firebase_auth (deprecated APIs, unused variables,keyWindow), firebase_core (pointer types), firebase_storage (non-exhaustive switch, retroactiveErrorconformance), share_plus (keyWindow), device_info_plus (integer precision).libtool: warning: 'dummy.o' has no symbols.Cause
CocoaPods adds
"${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"to every Swift pod'sLIBRARY_SEARCH_PATHS, and the url_launcher_ios and shared_preferences_foundation podspecs add$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/, which also reachesPods-Runner. On Xcode Cloud the Metal toolchain comes first inTOOLCHAINS, soTOOLCHAIN_DIRpoints intoMetal.xctoolchain. That toolchain has nousr/lib/swift, so every link step warns.Change
In
flutter/ios/Podfilepost_install:$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)entry (either spelling, and the oldDT_TOOLCHAIN_DIRform) from the pod xcconfigs. The app targets iOS 15, which ships the Swift runtime in/usr/lib/swift, and/usr/lib/swiftand$(SDKROOT)/usr/lib/swiftstay in the search paths. This replaces the Xcode 15DT_TOOLCHAIN_DIR→TOOLCHAIN_DIRrewrite, which no podspec here needs any more.GCC_WARN_INHIBIT_ALL_WARNINGSandSWIFT_SUPPRESS_WARNINGSon pod targets. CocoaPods'inhibit_all_warnings!only covers Objective-C files, so it would leave the firebase_storage Swift warnings.Only third-party pod targets are affected. Warnings in our own Runner code still show up.
Verification
Local builds of the
Pods-Runnertarget (all plugin and Firebase pods,-sdk iphoneos, Release, Xcode 26.6, CocoaPods 1.17.0). The Metal toolchain is installed and put first inTOOLCHAINSto match Xcode Cloud, which makesTOOLCHAIN_DIRpoint intoMetal.xctoolchainthere too:TOOLCHAINSmastersearch path ... Metal.xctoolchain ... not found, 15 plugin warnings,dummy.o, Crashlytics duplicate-lc++The full app link (Runner plus the bazel-built backends) wasn't built locally. The Xcode Cloud archive on this PR is the end-to-end check.