0

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:

  1. cntlm is 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);
  2. Environment variables are set as follows (cntlm is 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
  1. cURL works fine on the same 4 URLs in the error message allowing me to download the zip files. 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
  1. It seems to me that local implementation of networking lib of SwiftPM (SwiftNIO-based HTTPClient I guess [possible source]) does not respect environment variables, leading to failed attempts to connect to the public repos without proxy.
  2. 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...

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.