Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swift compile error (custom toolchain) #69987

Open
codetronik opened this issue Nov 20, 2023 · 5 comments
Open

swift compile error (custom toolchain) #69987

codetronik opened this issue Nov 20, 2023 · 5 comments

Comments

@codetronik
Copy link

When I try to build an ios app on Xcode, I get the error below.
Could not parse Swift versions from: Swift version 5.9 (swift-5.9-RELEASE)

I checked the version of custom toolchain.

% /Library/Developer/Toolchains/My.xctoolchain/usr/bin/swift --version
Swift version 5.9 (swift-5.9-RELEASE)
Target: arm64-apple-macosx13.0

Below is the version of the Xcode's original toolchain.

% swift --version
swift-driver version: 1.87.1 Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
Target: arm64-apple-macosx13.0

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?

@WindowsMEMZ
Copy link
Contributor

Maybe you can try utils/build-toolchain script.

@FengDeng
Copy link

if you use build-script , add "Apple" in version string.
image

@Naville
Copy link

Naville commented Apr 29, 2024

Maybe you can try utils/build-toolchain script.

@WindowsMEMZ Do you happen to know which command in build-toolchain is responsible? We use custom build-script based buildsystem and encountered the exact same issue

grepping through Swift sourcecode doesn't seem to show where that error comes from or the regex used for the version detection

@Naville
Copy link

Naville commented Apr 30, 2024

complier-vendor=apple is the reason

@WindowsMEMZ
Copy link
Contributor

Maybe you can try utils/build-toolchain script.

@WindowsMEMZ Do you happen to know which command in build-toolchain is responsible? We use custom build-script based buildsystem and encountered the exact same issue

grepping through Swift sourcecode doesn't seem to show where that error comes from or the regex used for the version detection

build-toolchain actually calls the build-script inside. You can open this script by text editor to see how it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants