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-6190] PackageDescription target generated by SwiftPM should use $(TOOLCHAIN_DIR) in OTHER_SWIFT_FLAGS instead of absolute path #4934

Closed
norio-nomura opened this issue Oct 20, 2017 · 2 comments
Labels

Comments

@norio-nomura
Copy link
Contributor

Previous ID SR-6190
Radar None
Original Reporter @norio-nomura
Type Bug
Status Resolved
Resolution Done
Environment

Swift 4.0
swift-DEVELOPMENT-SNAPSHOT-2017-10-17-a

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

md5: 05bafd94859d72410122e3e6c227b77d

Issue Description:

TOOLCHAINS=swift swift package generate-xcodeproj generates PackageDescription target with setting:

OTHER_SWIFT_FLAGS = "-swift-version 4 -I /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2017-10-17-a.xctoolchain/usr/lib/swift/pm/4 -target x86_64-apple-macosx10.10 -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk"

and this causes error on import PackageDescription with Xcode:

Module compiled with Swift 4.1 cannot be imported in Swift 4.0.1: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2017-10-17-a.xctoolchain/usr/lib/swift/pm/4/PackageDescription.swiftmodule

For avoiding this, SwiftPM should use $(TOOLCHAIN_DIR) in OTHER_SWIFT_FLAGS instead of absolute path resolved on running swift package generate-xcodeproj.

TOOLCHAIN_DIR will point suitable path on using Xcode:

$ DEVELOPER_DIR=/Applications/Xcode.app xcodebuild -showBuildSettings|grep -E '\s+TOOLCHAIN_DIR'
    TOOLCHAIN_DIR = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
$ DEVELOPER_DIR=/Applications/Xcode-beta.app xcodebuild -showBuildSettings|grep -E '\s+TOOLCHAIN_DIR'
    TOOLCHAIN_DIR = /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
$ TOOLCHAINS=swift xcodebuild -showBuildSettings|grep -E '\s+TOOLCHAIN_DIR'
    TOOLCHAIN_DIR = /Library/Developer/Toolchains/swift-4.0-RELEASE.xctoolchain
$ TOOLCHAINS=org.swift.3020171017a xcodebuild -showBuildSettings|grep -E '\s+TOOLCHAIN_DIR'
    TOOLCHAIN_DIR = /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2017-10-17-a.xctoolchain
@aciidgh
Copy link
Contributor

aciidgh commented Dec 12, 2017

#1414

@norio-nomura
Copy link
Contributor Author

I confirmed that this issue has been resolved on swift-4.1-DEVELOPMENT-SNAPSHOT-2018-01-15-a.
Thanks! 🙂

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from swiftlang/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

2 participants