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

Don’t include the toolchain rpath when installing swift-format #680

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jan 23, 2024

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.

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.
@@ -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
Copy link
Member

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.

Copy link
Member Author

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 {
Copy link
Member

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.

Copy link
Member Author

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.

@ahoppen ahoppen merged commit 4d634f2 into swiftlang:main Jan 23, 2024
@ahoppen ahoppen deleted the ahoppen/no-toolchain-rpath branch January 23, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants