swift build


(Dave Yost) #1

This happens with the swift in Xcode 7.3 on 10.11.4, and it happens with the swift I just built from http://github.com/apple/swift

$ /path/to/bin/swift build
error: unable to invoke subcommand: /path-to/bin/swift-build (No such file or directory)
$

There is no file called “swift-build” anywhere on my system.

How do I fix this?

Thanks


(Shawn Erickson) #2

It isn't very clear what you have done or what you are actually doing. The
path "path/to/bin/swift build" doesn't make much sense, it must be an
example trying to imply you need to supply the path to the actual swift
command on your system.

Review https://github.com/apple/swift-package-manager/blob/master/README.md.

On my system with Xcode 7.3 installed as well as the 03-01 swift snapshot...

[shawnce:~/]
[1:539]> xcodebuild -version
Xcode 7.3
Build version 7D175

[shawnce:~/]
[1:540]> xcrun --find swift
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift

[shawnce:~/]
[1:541]> swift --version
Apple Swift version 2.2 (swiftlang-703.0.18.1 clang-703.0.29)
Target: x86_64-apple-macosx10.9

[shawnce:~/]
[1:542]> swift build
error: unable to invoke subcommand:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build
(No such file or directory)

[shawnce:~/]
[1:543]> export TOOLCHAINS=swift

[shawnce:~/]
[1:544]> xcrun --find swift
/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-03-01-a.xctoolchain/usr/bin/swift

[shawnce:~/]
[1:545]> swift --version
Apple Swift version 3.0-dev (LLVM b361b0fc05, Clang 11493b0f62, Swift
24a0c3de75)
Target: x86_64-apple-macosx10.9

[shawnce:~/]
[1:554]> swift build
error: no Package.swift file found << which is expect since I don't have a
package in this directory.

···

On Sun, Apr 3, 2016 at 6:51 PM Dave Yost via swift-users < swift-users@swift.org> wrote:

This happens with the swift in Xcode 7.3 on 10.11.4, and it happens with
the swift I just built from http://github.com/apple/swift

$ /path/to/bin/swift build
error: unable to invoke subcommand: /path-to/bin/swift-build (No such file
or directory)
$

There is no file called “swift-build” anywhere on my system.

How do I fix this?

Thanks
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


(Daniel Dunbar) #3

If you build swift yourself you need to point directly at swift-build. Most people grab the pre-built toolchains from swift.org to start trying things out. Have you seen the instructions here:
  https://swift.org/download/#using-downloads

- Daniel

···

On Apr 3, 2016, at 7:27 PM, Shawn Erickson via swift-users <swift-users@swift.org> wrote:

It isn't very clear what you have done or what you are actually doing. The path "path/to/bin/swift build" doesn't make much sense, it must be an example trying to imply you need to supply the path to the actual swift command on your system.

Review https://github.com/apple/swift-package-manager/blob/master/README.md.

On my system with Xcode 7.3 installed as well as the 03-01 swift snapshot...

[shawnce:~/]
[1:539]> xcodebuild -version
Xcode 7.3
Build version 7D175

[shawnce:~/]
[1:540]> xcrun --find swift
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift

[shawnce:~/]
[1:541]> swift --version
Apple Swift version 2.2 (swiftlang-703.0.18.1 clang-703.0.29)
Target: x86_64-apple-macosx10.9

[shawnce:~/]
[1:542]> swift build
error: unable to invoke subcommand: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build (No such file or directory)

[shawnce:~/]
[1:543]> export TOOLCHAINS=swift

[shawnce:~/]
[1:544]> xcrun --find swift
/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-03-01-a.xctoolchain/usr/bin/swift

[shawnce:~/]
[1:545]> swift --version
Apple Swift version 3.0-dev (LLVM b361b0fc05, Clang 11493b0f62, Swift 24a0c3de75)
Target: x86_64-apple-macosx10.9

[shawnce:~/]
[1:554]> swift build
error: no Package.swift file found << which is expect since I don't have a package in this directory.

On Sun, Apr 3, 2016 at 6:51 PM Dave Yost via swift-users <swift-users@swift.org <mailto:swift-users@swift.org>> wrote:
This happens with the swift in Xcode 7.3 on 10.11.4, and it happens with the swift I just built from http://github.com/apple/swift

$ /path/to/bin/swift build
error: unable to invoke subcommand: /path-to/bin/swift-build (No such file or directory)
$

There is no file called “swift-build” anywhere on my system.

How do I fix this?

Thanks
_______________________________________________
swift-users mailing list
swift-users@swift.org <mailto:swift-users@swift.org>
https://lists.swift.org/mailman/listinfo/swift-users
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


(Dave Yost) #4

On my 10.11.4 with /Applications/Xcode.app version 7.3,
here is what I get when I run the commands you ran:

$ xcodebuild -version
warning: failed to load toolchain 'swift': Could not find toolchain: swiftXcode 7.3
Build version 7D175
$
$ xcrun --find swift
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift
$
$ swift --version
Apple Swift version 2.2 (swiftlang-703.0.18.1 clang-703.0.29)
Target: x86_64-apple-macosx10.9
$
$ swift build
error: unable to invoke subcommand: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build (No such file or directory)
$
$ export TOOLCHAINS=swift
$
$ xcrun --find swift
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift
$
$ swift --version
Apple Swift version 2.2 (swiftlang-703.0.18.1 clang-703.0.29)
Target: x86_64-apple-macosx10.9
$
$ swift build
error: unable to invoke subcommand: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build (No such file or directory)
$

···

On 2016-04-03, at 7:27 PM, Shawn Erickson <shawnce@gmail.com> wrote:

[1:539]> xcodebuild -version
Xcode 7.3
Build version 7D175

[shawnce:~/]
[1:540]> xcrun --find swift
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift

[shawnce:~/]
[1:541]> swift --version
Apple Swift version 2.2 (swiftlang-703.0.18.1 clang-703.0.29)
Target: x86_64-apple-macosx10.9

[shawnce:~/]
[1:542]> swift build
error: unable to invoke subcommand: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build (No such file or directory)

[shawnce:~/]
[1:543]> export TOOLCHAINS=swift

[shawnce:~/]
[1:544]> xcrun --find swift
/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-03-01-a.xctoolchain/usr/bin/swift

[shawnce:~/]
[1:545]> swift --version
Apple Swift version 3.0-dev (LLVM b361b0fc05, Clang 11493b0f62, Swift 24a0c3de75)
Target: x86_64-apple-macosx10.9

[shawnce:~/]
[1:554]> swift build


(Dave Yost) #5

Thanks. I’ve got it now.

I reported several suggestions for the Getting Started and Download instructions.

Dave

···

On 2016-04-03, at 7:37 PM, Daniel Dunbar <daniel_dunbar@apple.com> wrote:

If you build swift yourself you need to point directly at swift-build. Most people grab the pre-built toolchains from swift.org <http://swift.org/> to start trying things out. Have you seen the instructions here:
  https://swift.org/download/#using-downloads

- Daniel

On Apr 3, 2016, at 7:27 PM, Shawn Erickson via swift-users <swift-users@swift.org <mailto:swift-users@swift.org>> wrote:

It isn't very clear what you have done or what you are actually doing. The path "path/to/bin/swift build" doesn't make much sense, it must be an example trying to imply you need to supply the path to the actual swift command on your system.

Review https://github.com/apple/swift-package-manager/blob/master/README.md.

On my system with Xcode 7.3 installed as well as the 03-01 swift snapshot...

[shawnce:~/]
[1:539]> xcodebuild -version
Xcode 7.3
Build version 7D175

[shawnce:~/]
[1:540]> xcrun --find swift
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift

[shawnce:~/]
[1:541]> swift --version
Apple Swift version 2.2 (swiftlang-703.0.18.1 clang-703.0.29)
Target: x86_64-apple-macosx10.9

[shawnce:~/]
[1:542]> swift build
error: unable to invoke subcommand: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build (No such file or directory)

[shawnce:~/]
[1:543]> export TOOLCHAINS=swift

[shawnce:~/]
[1:544]> xcrun --find swift
/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-03-01-a.xctoolchain/usr/bin/swift

[shawnce:~/]
[1:545]> swift --version
Apple Swift version 3.0-dev (LLVM b361b0fc05, Clang 11493b0f62, Swift 24a0c3de75)
Target: x86_64-apple-macosx10.9

[shawnce:~/]
[1:554]> swift build
error: no Package.swift file found << which is expect since I don't have a package in this directory.

On Sun, Apr 3, 2016 at 6:51 PM Dave Yost via swift-users <swift-users@swift.org <mailto:swift-users@swift.org>> wrote:
This happens with the swift in Xcode 7.3 on 10.11.4, and it happens with the swift I just built from http://github.com/apple/swift

$ /path/to/bin/swift build
error: unable to invoke subcommand: /path-to/bin/swift-build (No such file or directory)
$

There is no file called “swift-build” anywhere on my system.

How do I fix this?

Thanks
_______________________________________________
swift-users mailing list
swift-users@swift.org <mailto:swift-users@swift.org>
https://lists.swift.org/mailman/listinfo/swift-users
_______________________________________________
swift-users mailing list
swift-users@swift.org <mailto:swift-users@swift.org>
https://lists.swift.org/mailman/listinfo/swift-users