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-12235] swift package experimental-api-diff: swift-api-digester: Unknown command line argument '-L'. #4588

Closed
benlangmuir opened this issue Feb 19, 2020 · 5 comments
Labels

Comments

@benlangmuir
Copy link
Member

Previous ID SR-12235
Radar rdar://problem/59655510
Original Reporter @benlangmuir
Type Bug
Status Resolved
Resolution Done
Environment

swift-5.2-DEVELOPMENT-SNAPSHOT-2020-02-18-a

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

md5: 4a7e18b8a3e631afae3dd592d89d6e84

Issue Description:

Playing with experimental-api-diff in a recent 5.2 toolchain I get an error about passing -L to swift-api-digester.

swift package -v experimental-api-diff 74b2921d51a6eca08048f55e5d64afffc70278d5
[500/500] Linking sourcekit-lsp
swift-api-digester: Unknown command line argument '-L'.  Try: '/Users/blangmuir/Library/Developer/Toolchains/swift-5.2-DEVELOPMENT-SNAPSHOT-2020-02-18-a.xctoolchain/usr/bin/swift-api-digester --help'
swift-api-digester: Did you mean '  -F'?
swift-api-digester: Unknown command line argument '/System/Volumes/Data/Xcodes/YE/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib'.  Try: '/Users/blangmuir/Library/Developer/Toolchains/swift-5.2-DEVELOPMENT-SNAPSHOT-2020-02-18-a.xctoolchain/usr/bin/swift-api-digester --help'

This comes from:

public func createAPIDigesterArgs() -> [String] {
        let buildPath = buildParameters.buildPath.pathString
        var arguments = ["-I", buildPath]

        arguments += buildParameters.toolchain.extraSwiftCFlags
   ...
}

Where the extra arguments contain

        if let sdkPaths = Destination.sdkPlatformFrameworkPaths(environment: environment) {
            extraCCFlags += ["-F", sdkPaths.fwk.pathString]
            extraSwiftCFlags += ["-F", sdkPaths.fwk.pathString]
            extraSwiftCFlags += ["-I", sdkPaths.lib.pathString]
            extraSwiftCFlags += ["-L", sdkPaths.lib.pathString]
        }
@benlangmuir
Copy link
Member Author

I'm not sure if swiftpm should strip this path, or if the api-digester should learn to ignore options it doesn't care about. I see we're also adding spaces in -I/foo/bar to make it -I /foo bar, again because the api-digester doesn't parse arguments the same as the compiler.

@hborla
Copy link
Member

hborla commented Feb 21, 2020

@swift-ci create

@weissi
Copy link
Member

weissi commented Feb 17, 2021

similar or same as SR-12319

@swift-ci
Copy link
Contributor

Comment by Owen Voorhees (JIRA)

This was fixed in #3359 (though there's still some room to refactor the flag computation using the driver's new support for swift-api-digester)

@weissi
Copy link
Member

weissi commented Jul 27, 2021

Fantastic, thank you!

@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
Labels
Projects
None yet
Development

No branches or pull requests

4 participants