-
Notifications
You must be signed in to change notification settings - Fork 237
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
Don’t include the toolchain rpath when installing swift-format #680
Conversation
When installing swift-format on Linux, we don’t want it to have an absolute rpath to where the stdlib was installed on the builder machine.
c4e2118
to
7b6dc0e
Compare
@@ -106,7 +124,8 @@ let package = Package( | |||
.product(name: "ArgumentParser", package: "swift-argument-parser"), | |||
.product(name: "SwiftSyntax", package: "swift-syntax"), | |||
.product(name: "SwiftParser", package: "swift-syntax"), | |||
] | |||
], | |||
linkerSettings: swiftformatLinkSettings |
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.
Can this be made into a function that returns the desired value, so that its definition can be moved down to the bottom of the file? That way there's no noise before the package definition itself that average users don't care about.
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.
My goal was to keep the structure similar to that of sourcekit-lsp’s Package.swift and swift-syntax’s Package.swift for consistency across the toolchain packages.
I think moving those variables to be functions at the bottom of the file might be a good idea but I’d like to try that across all three packages first and see if it works for all of them. I’ll do it in a follow-up PR.
@@ -14,6 +14,24 @@ | |||
import Foundation | |||
import PackageDescription | |||
|
|||
// MARK: - Parse build arguments | |||
|
|||
func hasEnvironmentVariable(_ name: String) -> Bool { |
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.
You can also update the SWIFTCI_USE_LOCAL_DEPS
env var lookup at the bottom of the file to use this.
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.
Good catch. I’ll do it in a follow-up PR.
When installing swift-format on Linux, we don’t want it to have an absolute rpath to where the stdlib was installed on the builder machine.