Skip to content

Throw specific error when missing linker flag #499

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

Closed
kevinhury opened this issue Jul 30, 2016 · 4 comments
Closed

Throw specific error when missing linker flag #499

kevinhury opened this issue Jul 30, 2016 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@kevinhury
Copy link

When adding a database package (MySQL, SQLite, etc) and building, it is required to add a linker flag. Currently it is not clear that a flag is required for the build to pass.

Adding MySQL package to Package.swift and vapor build produces this output:

Building Project [Failed]

Command:
swift build 1>&2

Error (1):
Compile Swift Module 'App' (2 sources)
Linking ./.build/debug/App
ld: library not found for -lmysqlclient for architecture x86_64
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: build had 1 command failures
swift-build: error: exit(1): /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-07-25-a.xctoolchain/usr/bin/swift-build-tool -f /Users/{USERNAME}/Desktop/Hello/.build/debug.yaml

Toolchain:
/Users/{USERNAME}/.swiftenv/shims/swift

A more specific error for the missing --mysql flag could improve clarity.

@tanner0101 tanner0101 added this to the 0.16 milestone Aug 1, 2016
@tanner0101 tanner0101 added the enhancement New feature or request label Aug 1, 2016
@tanner0101
Copy link
Member

Adding a vapor.json file to our dependencies that could hold linking dependencies could fix this.

{
    "link": ["mysql"]
}

@tanner0101 tanner0101 modified the milestones: 0.16, 0.17 Aug 4, 2016
@tanner0101
Copy link
Member

Compiling MySQL from source would also help with this and is possibly a better solution.

@charlesvinette
Copy link

Took me some time to figure this out, +1

@tanner0101 tanner0101 modified the milestones: 0.17, 0.18 Aug 31, 2016
@loganwright
Copy link
Member

Closing this in preference of vapor/toolbox#76, we can continue discussion there 👍

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

No branches or pull requests

4 participants