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

[SR-4916] swift build not creating shared library on linux #5015

Closed
swift-ci opened this issue May 17, 2017 · 7 comments
Closed

[SR-4916] swift build not creating shared library on linux #5015

swift-ci opened this issue May 17, 2017 · 7 comments

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-4916
Radar None
Original Reporter tedgoddard (JIRA User)
Type Bug
Status Resolved
Resolution Invalid

Attachment: Download

Environment

swift-4.0-DEVELOPMENT-SNAPSHOT-2017-05-15-a-ubuntu16.04
swift-4.0-DEVELOPMENT-SNAPSHOT-2017-05-15-a-osx

Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug, Linux
Assignee None
Priority Medium

md5: 91c35ce2567dc0ed0a048bf9929a338f

Issue Description:

swift build is not creating the expected .so files on linux but does create .dylib files on MacOS.

Using https://swift.org/builds/swift-4.0-branch/ubuntu1604/swift-4.0-DEVELOPMENT-SNAPSHOT-2017-05-15-a/swift-4.0-DEVELOPMENT-SNAPSHOT-2017-05-15-a-ubuntu16.04.tar.gz

git clone https://github.com/PerfectExamples/Perfect-WebSocketsServer.git
cd Perfect-WebSocketsServer
swift build

Observe that no shared libraries are found in .build/debug on linux.

@ankitspd
Copy link
Member

The expected behaviour is to not create `so` and `dylibs`. Are you sure you're seeing the dylib with Swift 4 toolchain and not the default toolchain? Please provide output of `swift build -v`. Thanks!

@swift-ci
Copy link
Contributor Author

Comment by Ted Goddard (JIRA)

Thanks for your help. Yes, I see that this was not a clean build and does not complete on MacOS either (just the very tail):

swift-4-macos.txt

@swift-ci
Copy link
Contributor Author

Comment by Ted Goddard (JIRA)

Is it an incorrect package declaration that is causing

ld: library not found for -lCHTTPParser for architecture x86_64

@swift-ci
Copy link
Contributor Author

Comment by Ted Goddard (JIRA)

Such as this link declaration in the modulemap is no longer needed?

./.build/checkouts/Perfect-HTTPServer.git--6671958091389663080/Sources/CHTTPParser/include/module.modulemap

module CHTTPParser {
header "http_parser.h"
link "CHTTPParser"
export *
}

@swift-ci
Copy link
Contributor Author

Comment by Ted Goddard (JIRA)

Yes, removing those link modulemap directives allows the project to compile. Is this the correct approach?

@ankitspd
Copy link
Member

Yep, that's right. SwiftPM automatically manages the link statement (from v3.1).

@swift-ci
Copy link
Contributor Author

Comment by Ted Goddard (JIRA)

Thanks so much for your help. I will relay this to the library developer (PerfectlySoft).

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants