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

Can't invoke swift build #213

Closed
eimantas opened this issue Mar 3, 2016 · 21 comments
Closed

Can't invoke swift build #213

eimantas opened this issue Mar 3, 2016 · 21 comments

Comments

@eimantas
Copy link

eimantas commented Mar 3, 2016

I have latest release of swift 2.2 (march 1st as of this writing). When running make on ubuntu 14.04 in the root of kitura, i get an error:

swift build
error: unable to invoke subcommand: /home/eimantas/src/swift-2.2/usr/bin/swift-build (No such file or directory)
make: [make] Error 2 (ignored)

Any help is appreciated.

@shmuelk
Copy link
Collaborator

shmuelk commented Mar 3, 2016

@eimantas Please install an appropriate Swift 3.0 driver. 02/08 for the master branch of Kitura or 02/25 for the develop branch.

@eimantas
Copy link
Author

eimantas commented Mar 3, 2016

I'm using 02/25 image of Swift on Linux Ubntu 14.04 and attempting to build using the given command in README.md, but this is the new error that I get:

error: The dependency graph could not be satisfied because an update to `https://github.com/IBM-Swift/Kitura-router.git' is required

@eimantas
Copy link
Author

eimantas commented Mar 3, 2016

Okay, so I managed to push a bit further. I removed everything from Packages/ subdirectory and reran the build command:

swift build -Xcc -fblocks

After recloning all dependencies and starting building the project it got stuck on building KituraSys dependency:

swift build
Compiling Swift Module 'LoggerAPI' (1 sources)
Compiling Swift Module 'SwiftyJSON' (2 sources)
Compiling Swift Module 'BlueSocket' (3 sources)
Compiling Swift Module 'KituraSys' (4 sources)
/home/eimantas/src/swilnius/Packages/Kitura-Sys-0.3.1/Sources/KituraSys/SysUtils.swift:17:8: error: no such module 'Dispatch'
import Dispatch
       ^
/home/eimantas/src/swilnius/Packages/Kitura-Sys-0.3.1/Sources/KituraSys/SysUtils.swift:17:8: error: no such module 'Dispatch'
import Dispatch
       ^
/home/eimantas/src/swilnius/Packages/Kitura-Sys-0.3.1/Sources/KituraSys/SysUtils.swift:17:8: error: no such module 'Dispatch'
import Dispatch
       ^
/home/eimantas/src/swilnius/Packages/Kitura-Sys-0.3.1/Sources/KituraSys/SysUtils.swift:17:8: error: no such module 'Dispatch'
import Dispatch
       ^
<unknown>:0: error: build had 1 command failures

I have applied the swift dispatch library patch before going further, but it seems that there's still something lacking here.

@vadimeisenbergibm
Copy link
Contributor

The error probably means that you do not have dispatch directory in /usr/local/include/ . Please make sure that you run sudo make install in swift-corelibs-libdispatch and that dispatch directory is created in /usr/local/include/.

@eimantas
Copy link
Author

eimantas commented Mar 3, 2016

I see. Is there a way to pass the linker a flag where it can find the Dispatch library? Since the library was configured with certain prefix which defines non-standard swift location.

@vadimeisenbergibm
Copy link
Contributor

Yes - you can add flags to swift build command to pass compiler/linker options, e.g -Xswiftc -I/usr/local/include -Xlinker -L/usr/local/lib.

@eimantas
Copy link
Author

eimantas commented Mar 3, 2016

so this is weird. I have verified that libdispatch is present in /usr/local/lib and ran the commands. Got the following output:

$ cd /usr/local/lib                                                                                                                                             ⏎
$ ls -l libdispatch*
-rwxr-xr-x 1 root root   1026 Mar  3 14:01 libdispatch.la
-rwxr-xr-x 1 root root 871255 Mar  3 14:01 libdispatch.so
$ cd ~/kitura
$ swift build -Xcc -fblocks -Xlinker -I/usr/local/lib -Xswiftc -I/usr/local/include
Compiling Swift Module 'LoggerAPI' (1 sources)
Compiling Swift Module 'BlueSocket' (3 sources)
Compiling Swift Module 'SwiftyJSON' (2 sources)
Compiling Swift Module 'KituraSys' (4 sources)
/home/eimantas/kitura/Packages/Kitura-Sys-0.3.1/Sources/KituraSys/SysUtils.swift:17:8: error: no such module 'Dispatch'
import Dispatch
       ^
/home/eimantas/kitura/Packages/Kitura-Sys-0.3.1/Sources/KituraSys/SysUtils.swift:17:8: error: no such module 'Dispatch'
import Dispatch
       ^
/home/eimantas/kitura/Packages/Kitura-Sys-0.3.1/Sources/KituraSys/SysUtils.swift:17:8: error: no such module 'Dispatch'
import Dispatch
       ^
/home/eimantas/kitura/Packages/Kitura-Sys-0.3.1/Sources/KituraSys/SysUtils.swift:17:8: error: no such module 'Dispatch'
import Dispatch
       ^

@eimantas
Copy link
Author

eimantas commented Mar 3, 2016

Verified:

$ cd /usr/local/include
$ ls -l dispatch
total 192
drwxr-xr-x 2 root root  4096 Mar  3 14:01 .
drwxr-xr-x 4 root root  4096 Mar  3 13:58 ..
-rw-r--r-- 1 root root  4536 Mar  3 14:01 base.h
-rw-r--r-- 1 root root 17716 Mar  3 14:01 block.h
-rw-r--r-- 1 root root 11014 Mar  3 14:01 data.h
-rw-r--r-- 1 root root  1631 Mar  3 14:01 dispatch.h
-rw-r--r-- 1 root root  8508 Mar  3 14:01 group.h
-rw-r--r-- 1 root root  4905 Mar  3 14:01 introspection.h
-rw-r--r-- 1 root root 25826 Mar  3 14:01 io.h
-rw-r--r-- 1 root root 14487 Mar  3 14:01 object.h
-rw-r--r-- 1 root root  2629 Mar  3 14:01 once.h
-rw-r--r-- 1 root root 34672 Mar  3 14:01 queue.h
-rw-r--r-- 1 root root  3300 Mar  3 14:01 semaphore.h
-rw-r--r-- 1 root root 26610 Mar  3 14:01 source.h
-rw-r--r-- 1 root root  2976 Mar  3 14:01 time.h

@eimantas
Copy link
Author

eimantas commented Mar 3, 2016

The path to swift is following:

/home/eimantas/src/swift-3.0/usr/bin

@kfbishop
Copy link

kfbishop commented Mar 3, 2016

Could the build do a quick check swift --version and show appropriate error message if < 3.0. I think overt hand-holding can greatly improve first time explorers.

@eimantas
Copy link
Author

eimantas commented Mar 3, 2016

FWIW:

$ swift --version
Swift version 3.0-dev (LLVM b361b0fc05, Clang 11493b0f62, Swift fc261045a5)
Target: x86_64-unknown-linux-gnu

@mars-rover
Copy link

Your /use/local/include has no dispatch library, just some header files

@eimantas
Copy link
Author

eimantas commented Mar 3, 2016

I thought include is supposed to have header files. And /usr/local/lib has all the binaries. No?

@vadimeisenbergibm
Copy link
Contributor

@eimantas My mistake regarding /usr/local/include - please verify that dispatch directory exists in

<path-to-swift>/usr/lib/swift.

Step 4 of README should install it there.

@eimantas
Copy link
Author

eimantas commented Mar 3, 2016

@vadimeisenbergibm it's not there. Should I attempt recompiling and reinstalling the libdispatch? I'm pretty sure I defined prexis as <path-to-swift-dir>

@vadimeisenbergibm
Copy link
Contributor

@eimantas yes, make sure that you provide the correct path to config command.

@chrisozenne
Copy link
Contributor

I am having the same problem on OS X with the latest Swift 2.2 from March 1st.
swift build error: unable to invoke subcommand: /Library/Developer/Toolchains/swift-2.2-SNAPSHOT-2016-03-01-a.xctoolchain/usr/bin/swift-build (No such file or directory)

I saw the comments above about installing the appropriate Swift 3.0 driver -- where can I find this?

@vadimeisenbergibm
Copy link
Contributor

@chrisozenne Please install Swift 3.0 snapshot, 8th of February for the master branch of Kitura or 25th of February for the develop branch.

@chrisozenne
Copy link
Contributor

Took me a while to figure this out - I could not find the Swift 3.0 snapshot because it's not called Swift 3.0, it's just called "Swift Development Snapshot" on Swift.org.

@vadimeisenbergibm
Copy link
Contributor

@chrisozenne Correct, sorry, I should have mentioned that.

@eimantas
Copy link
Author

eimantas commented Mar 4, 2016

Okay, I got it working! I got a "Hello world!"!!!11!!! I followed the instructions on the develop branch and it works great!

Thanks everyone for support!

For anyone bumping in to the same issue: I got it working with 02/25 development snapshot (which is named 2.2, but actually is future 3.0 version of Swift). Follow the instructions on develop branch.

@eimantas eimantas closed this as completed Mar 4, 2016
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

6 participants