When trying to run the following commands:
XCODE_OPTIONS="-scmProvider system -resolvePackageDependencies -disablePackageRepositoryCache"
xcodebuild clean $XCODE_OPTIONS -workspace $WORKSPACE -scheme $SCHEME
inside corporate intranet to build iOS app (no Package.swift file in project is present), I get the following error:
Command line invocation:
/Applications/Xcode_16.2.app/Contents/Developer/usr/bin/xcodebuild -scmProvider system -resolvePackageDependencies -disablePackageRepositoryCache clean -workspace SomeApp.xcworkspace -scheme SomeAppTest
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
Resolve Package Graph
failed downloading 'https://github.com/getsentry/sentry-cocoa/releases/download/8.52.1/Sentry.xcframework.zip' which is required by binary target 'Sentry': downloadError("Could not connect to the server.")failed downloading 'https://storage.mds.yandex.net/get-appmetrica-mobile-sdk/175948/YandexMobileMetrica-4.5.2-ios-spm-4cf9781b-4e3e-4674-bbb3-5ab28cc9869a.zip' which is required by binary target 'YandexMobileMetrica': downloadError("Could not connect to the server.")failed downloading 'https://github.com/getsentry/sentry-cocoa/releases/download/8.52.1/Sentry-Dynamic.xcframework.zip' which is required by binary target 'Sentry-Dynamic': downloadError("Could not connect to the server.")failed downloading 'https://storage.mds.yandex.net/get-appmetrica-mobile-sdk/50347/YandexMobileMetricaCrashes-4.5.2-ios-spm-3ac18632-911c-404d-8f4d-4d2a496ee5b7.zip' which is required by binary target 'YandexMobileMetricaCrashes': downloadError("Could not connect to the server.")fatalError
2025-06-10 13:59:51.959 xcodebuild[96745:70697693] Writing error result bundle to /tmp/ResultBundle_2025-10-06_13-59-0051.xcresult
xcodebuild: error: Could not resolve package dependencies:
failed downloading 'https://github.com/getsentry/sentry-cocoa/releases/download/8.52.1/Sentry.xcframework.zip' which is required by binary target 'Sentry': downloadError("Could not connect to the server.")
failed downloading 'https://storage.mds.yandex.net/get-appmetrica-mobile-sdk/175948/YandexMobileMetrica-4.5.2-ios-spm-4cf9781b-4e3e-4674-bbb3-5ab28cc9869a.zip' which is required by binary target 'YandexMobileMetrica': downloadError("Could not connect to the server.")
failed downloading 'https://github.com/getsentry/sentry-cocoa/releases/download/8.52.1/Sentry-Dynamic.xcframework.zip' which is required by binary target 'Sentry-Dynamic': downloadError("Could not connect to the server.")
failed downloading 'https://storage.mds.yandex.net/get-appmetrica-mobile-sdk/50347/YandexMobileMetricaCrashes-4.5.2-ios-spm-3ac18632-911c-404d-8f4d-4d2a496ee5b7.zip' which is required by binary target 'YandexMobileMetricaCrashes': downloadError("Could not connect to the server.")
fatalError
Details to consider:
cntlmis configured as a local proxy to connect to public resources and is working as expected (SwiftPM manages to clone all required repos of non-binary dependencies in advance);- Environment variables are set as follows (
cntlmis running on port 8081):
HTTPS_PROXY=http://127.0.0.1:8081
HTTP_PROXY=http://127.0.0.1:8081
all_proxy=http://127.0.0.1:8081
http_proxy=http://127.0.0.1:8081
https_proxy=http://127.0.0.1:8081
- cURL works fine on the same 4 URLs in the error message allowing me to download the
zipfiles. I even tried to slip downloaded archives in the following dirs with no luck:
$HOME/Library/Developer/Xcode/DerivedData/SomeApp-.../SourcePackages/artifacts/sentry-cocoa/Sentry
$HOME/Library/Developer/Xcode/DerivedData/SomeApp-.../SourcePackages/artifacts/sentry-cocoa/Sentry-Dynamic
$HOME/Library/Developer/Xcode/DerivedData/SomeApp-.../SourcePackages/artifacts/metrica-sdk-ios/YandexMobileMetrica
$HOME/Library/Developer/Xcode/DerivedData/SomeApp-.../SourcePackages/artifacts/metrica-sdk-ios/YandexMobileMetricaCrashes
- It seems to me that local implementation of networking lib of SwiftPM (
SwiftNIO-basedHTTPClientI guess [possible source]) does not respect environment variables, leading to failed attempts to connect to the public repos without proxy. - Working environment is a shared macOS GitLab runner on Darwin, I have no sudo/can not ssh to the machine for debug.
I would greatly appreciate any help with this issue! Been stuck with it for a bad 2 weeks...