swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.62k stars 10.37k forks source link

iOS App won't be built on Xcode with the My Toolchain #69713

Open codetronik opened 1 year ago

codetronik commented 1 year ago

The error below occurs when building a swift app in Xcode. The target device is iPhone12 mini Objective C App builds well.

Unsupported Configuration
The Swift standard library from the toolchain cannot be used on devices. Select a macOS or simulator run destination instead, or use a dirrent toolchain that only provides the compiler.

The options for compiling the toolchain are as follows.

utils/build-script --skip-build-benchmarks --skip-watchos --skip-tvos --swift-darwin-supported-arch=arm64 --sccache --release-debuginfo --swift-disable-dead-stripping --install-destdir=/Users/kei/111/swift/utils/swift-nightly-install --install-llvm --install-swift --install-lldb --install-llbuild --install-swiftpm --install-swift-driver --install-swiftsyntax --install-playgroundsupport --install-sourcekit-lsp --install-swiftformat --install-swiftdocc --build-swift-static-sdk-overlay --darwin-toolchain-display-name=CodeLabyrinth --darwin-toolchain-display-name-short=CodeLabyrinth --darwin-toolchain-name=CodeLabyrinth --darwin-toolchain-version=1.0 --darwin-toolchain-alias=Local --darwin-toolchain-bundle-identifier=CodeLabyrinth --darwin-toolchain-require-use-os-runtime=0 --install-prefix=/Library/Developer/Toolchains/CodeLabyrinth.xctoolchain/usr --install-symroot=/Users/kei/111/swift/utils/swift-nightly-symroot --darwin-install-extract-symbols ‘--swift-install-components=autolink-driver;back-deployment;compiler;clang-resource-dir-symlink;libexec;stdlib;sdk-overlay;static-mirror-lib;toolchain-tools;license;sourcekit-xpc-service;swift-remote-mirror;swift-remote-mirror-headers’ ‘--llvm-install-components=llvm-ar;llvm-cov;llvm-profdata;IndexStore;clang;clang-resource-headers;compiler-rt;clangd;dsymutil;LTO;clang-features-file’ --swift-primary-variant-sdk=IOS --installable-package=/Users/kei/111/swift/utils/CodeLabyrinth.tar.gz --symbols-package=/Users/kei/111/swift/utils/CodeLabyrinth-symbols.tar.gz --build-subdir=buildbot_osx  --ios --tvos --watchos --swift-stdlib-build-type=Release ‘--llvm-targets-to-build=X86;ARM;AArch64’ --swift-darwin-supported-arch “$(uname -m)”

Am I missing something? And the above build method does not generate arm64e-apple-ios related files. arm64-apple-ios is created.

AT5HK commented 8 months ago

I have the same problem. I could only get it to work by building the app using xcodebuild like so: xcodebuild -sdk iphoneos17.2 -toolchain org.swift.5101202403041a putting the build in my deriveddata folder of xcode for the app and then running Product > perform action > run without building on Xcode.