-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Sever the package dependency if using SwiftBuild Framework #8434
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
Sever the package dependency if using SwiftBuild Framework #8434
Conversation
The SwiftBuild project has a dependency on Swift Driver, which has a dependency on Swift Tools Support Core (STSC). Swift Package Manager (SwiftPM) executable targets also have a dependency on STSC. Sever SwiftPM package depenedency on STSC if the SWIFTPM_SWBUILD_FRAMEWORK environment variable is set so we can indirectly pull the STCS dependency on the dynamic libray that will be pulled in via SwiftDriver.
@swift-ci please test |
@swift-ci please test self hosted windows |
private func useSwiftBuildPackageDependency() -> Bool { | ||
return (ProcessInfo.processInfo.environment["SWIFTPM_SWBUILD_FRAMEWORK"] == nil && | ||
ProcessInfo.processInfo.environment["SWIFTPM_NO_SWBUILD_DEPENDENCY"] == nil) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a particular reason this uses a function instead of a simple let
binding? I also don't think private
is needed here, there's no chance this function could be used accidentally elsewhere, since multi-file package manifest is not a thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used in two places, so instead of duplicating the logic, I opted to put it in a function call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But is there a need to duplicate the logic with a let
binding? With a function the computation is duplicated since the function is invoked twice, while with a let
binding it would be computed only once.
The SwiftBuild project has a dependency on Swift Driver, which has a dependency on Swift Tools Support Core (STSC). Swift Package Manager (SwiftPM) executable targets also have a dependency on STSC.
Sever SwiftPM package depenedency on STSC if the
SWIFTPM_SWBUILD_FRAMEWORK
environment variable is set so we can indirectly pull the STCS dependency on the dynamic library that will be pulled in via SwiftDriver.