我目前正在測驗 Xcode Cloud 作為 Apple 私有 beta 計劃的成員,并在嘗試為我的專案在云上存檔/構建(任何操作)時遇到問題。
該專案是一個相當基本的 SwiftUI 應用程式,具有 CocoaPods 依賴項。
這很奇怪,因為同一個專案在我的本地機器上成功構建和歸檔。我在 Workflow 編輯器中使用了與本地 Xcode 版本相同的 macOS 和 Xcode 版本。
如何解決此錯誤?
uj5u.com熱心網友回復:
自定義 shell 腳本限制
TL;博士
Apple 通過僅允許shell腳本作為ci_post_clone.sh. 您的 Pods 專案在此檔案夾之外有一個自定義 shell 腳本,該腳本不是由這些 CI 腳本之一觸發的,因此沒有運行權限。ci_pre_xcodebuild.shci_post_xcodebuild.shci_scripts
此特定問題的解決方案是:
- (技術上)重構您的構建腳本階段以將 shell 腳本檔案行內到運行腳本中。
- (推薦,但并非總是可行)如果可用,請使用 CocoaPod 的 Swift Package 版本。
- (解決方法)將 CocoaPod 降級到沒有外部 shell 腳本的版本。
參考
從
Solution 2 (recommended, but not always possible)
Add the Swift Package version of the CocoaPod as a dependency following Apple's documentation.
Solution 3 (workaround)
Downgrade your CocoaPod to a version without external shell scripts.
Notes
As you can tell from the amount of effort required to workaround custom shell script build phases with Xcode Cloud, I suggest raising an issue on the specific CocoaPod repository to migrate away from custom shell script files. These kinds of steps make using Xcode Cloud very painful.
As Xcode Cloud adoption grows it is entirely possible that individual CocoaPods no longer reference custom shell script files. I don't see Apple opening up their infrastructure to enable arbitrary shell script execution because this is a security risk, and to be honest, should have been prevented on other CI providers too.
I can also see how hassles like these to include legacy CocoaPods dependencies could accelerate more projects to migrate to SPM. SPM is already popular, and will likely become more popular as Apple ensures first-class integration.
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/433743.html
上一篇:如何在Swift中使用UIImagePickerController旋轉cameraOverlayView上的影像
