PerfectlySoft / Perfect

Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and more…)
https://www.perfect.org
Apache License 2.0
13.83k stars 944 forks source link

Cannot swift build #262

Closed UNIQUEXJ closed 6 years ago

UNIQUEXJ commented 6 years ago

run "swift build"

error: terminated(72): xcrun --sdk macosx --find xctest output:

RockfordWei commented 6 years ago

Before building, try which swift && swift --version, which should display some output like this:

$ which swift && swift --version
/usr/bin/swift
Apple Swift version 4.1.2 (swiftlang-902.0.54 clang-902.0.39.2)
Target: x86_64-apple-darwin17.6.0

If confirmed a proper swift toolchain, try:

$ git clone https://github.com/PerfectlySoft/PerfectLib.git && cd PerfectLib && swift build

If nothing wrong, it should look like:

Cloning into 'PerfectLib'...
remote: Counting objects: 7235, done.
remote: Total 7235 (delta 0), reused 0 (delta 0), pack-reused 7235
Receiving objects: 100% (7235/7235), 5.30 MiB | 68.00 KiB/s, done.
Resolving deltas: 100% (4097/4097), done.
Compile Swift Module 'PerfectLib' (9 sources)
UNIQUEXJ commented 6 years ago

Apple Swift version 4.2 (swiftlang-1000.0.16.7 clang-1000.10.25.3) Target: x86_64-apple-darwin17.7.0

RockfordWei commented 6 years ago

I'd also tried Swift 4.2 and it worked like a charm:

$ which swift && swift --version
/usr/bin/swift
Apple Swift version 4.2 (swiftlang-1000.0.16.7 clang-1000.10.25.3)
Target: x86_64-apple-darwin17.6.0

$ git clone https://github.com/PerfectlySoft/PerfectLib.git && cd PerfectLib && swift build
Cloning into 'PerfectLib'...
remote: Counting objects: 7235, done.
remote: Total 7235 (delta 0), reused 0 (delta 0), pack-reused 7235
Receiving objects: 100% (7235/7235), 5.30 MiB | 896.00 KiB/s, done.
Resolving deltas: 100% (4097/4097), done.
Compile Swift Module 'PerfectLib' (9 sources)

Nothing wrong with it. Can you please try swift build -v and paste all outputs?

UNIQUEXJ commented 6 years ago

liujiangdeMacBook-Pro:PerfectLib unique$ swift build -v xcrun --sdk macosx --show-sdk-path xcrun --sdk macosx --show-sdk-platform-path xcrun --find clang xcrun --sdk macosx --find xctest error: terminated(72): xcrun --sdk macosx --find xctest output:

RockfordWei commented 6 years ago

It is not an issue. please sign in our slack http://perfect.ly to get instant support. See you in #中文频道

aplekhanov commented 6 years ago

Seems like you are using Xcode beta, so rename it from Xcode-beta to just Xcode or you can select Xcode-beta by command: sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer

lixinhao2333 commented 6 years ago

/usr/bin/swift Apple Swift version 4.2 (swiftlang-1000.0.37.1 clang-1000.10.44) Target: x86_64-apple-darwin18.0.0 lixinhaodeiMac:~ lixinhao$ swift build -v xcrun --sdk macosx --show-sdk-path xcrun --sdk macosx --show-sdk-platform-path xcrun --find clang xcrun --sdk macosx --find xctest error: terminated(72): xcrun --sdk macosx --find xctest output: what's the problem .I need help

xiaote2016 commented 6 years ago

$ sudo xcode-select -switch /Applications/Xcode.app/ $ xcode-select -p /Applications/Xcode.app/Contents/Developer 这个是正确的处理

sahilmgandhi commented 6 years ago

I had the same issue as @UNIQUEXJ and I ran the following to make it work:

sudo xcode-select --reset swift build

ooftv commented 6 years ago

thanks @sahilmgandhi , that worked for me

marcasteroid commented 5 years ago

Got same error after XCode update, while building IBM-Kitura project. Thanks @sahilmgandhi

demofly commented 5 years ago

Seems like you are using Xcode beta, so rename it from Xcode-beta to just Xcode or you can select Xcode-beta by command: sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer

On the stable Xcode 10.1 the next command helps:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer