swiftlang / swift-package-manager

The Package Manager for the Swift Programming Language
Apache License 2.0
9.74k stars 1.34k forks source link

[SR-4282] Cannot link KituraNet #5061

Closed Bouke closed 7 years ago

Bouke commented 7 years ago
Previous ID SR-4282
Radar None
Original Reporter @Bouke
Type Bug
Status Closed
Resolution Invalid
Environment macOS 10.12.3, swift-DEVELOPMENT-SNAPSHOT-2017-03-17-a
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Package Manager | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 6afb834834de21d1e2225f8c662ee349

Issue Description:

When including KituraNet as a dependency;

# Package.swift

import PackageDescription
let package = Package(
    name: "HAP",
    targets: [
    ],
    dependencies: [
        .Package(url: "https://github.com/IBM-Swift/Kitura-net.git", majorVersion: 1, minor: 6),
    ]
)

Building fails...

swift build
Fetching https://github.com/IBM-Swift/Kitura-net.git
Fetching https://github.com/IBM-Swift/BlueSSLService.git
Fetching https://github.com/IBM-Swift/CCurl.git
Fetching https://github.com/IBM-Swift/LoggerAPI.git
Fetching https://github.com/IBM-Swift/BlueSocket.git
Cloning https://github.com/IBM-Swift/BlueSocket.git
Resolving https://github.com/IBM-Swift/BlueSocket.git at 0.12.36
Cloning https://github.com/IBM-Swift/LoggerAPI.git
Resolving https://github.com/IBM-Swift/LoggerAPI.git at 1.6.0
Cloning https://github.com/IBM-Swift/BlueSSLService.git
Resolving https://github.com/IBM-Swift/BlueSSLService.git at 0.12.26
Cloning https://github.com/IBM-Swift/Kitura-net.git
Resolving https://github.com/IBM-Swift/Kitura-net.git at 1.6.2
Cloning https://github.com/IBM-Swift/CCurl.git
Resolving https://github.com/IBM-Swift/CCurl.git at 0.2.3
Compile CHTTPParser utils.c
Compile CHTTPParser http_parser.c
Compile Swift Module 'LoggerAPI' (1 sources)
Compile Swift Module 'Socket' (3 sources)
Compile Swift Module 'SSLService' (1 sources)
Compile Swift Module 'KituraNet' (34 sources)
Compile Swift Module 'HAP' (1 sources)
Linking ./.build/debug/HAP
ld: library not found for -lCHTTPParser 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
error: terminated(1): /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2017-03-17-a.xctoolchain/usr/bin/swift-build-tool -f /Users/bouke/Developer/Bug/.build/debug.yaml
aciidgh commented 7 years ago

The link statement in modulemap is no longer supported and is managed by SwiftPM, removing that line will fix the problem:
https://github.com/IBM-Swift/Kitura-net/blob/master/Sources/CHTTPParser/include/module.modulemap#L20

Bouke commented 7 years ago

That resolved the issue, thanks!