Skip to content

Clean up rpaths of installed swift-format #683

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

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import PackageDescription
let package = Package(
name: "swift-format",
platforms: [
.iOS("13.0"),
.macOS("10.15")
.macOS("12.0"),
.iOS("13.0")
],
products: [
.executable(
Expand Down Expand Up @@ -144,7 +144,7 @@ func hasEnvironmentVariable(_ name: String) -> Bool {

// When building the toolchain on the CI, don't add the CI's runpath for the
// final build before installing.
var installAction: Bool { hasEnvironmentVariable("SOURCEKIT_LSP_CI_INSTALL") }
var installAction: Bool { hasEnvironmentVariable("SWIFTFORMAT_CI_INSTALL") }

/// Assume that all the package dependencies are checked out next to sourcekit-lsp and use that instead of fetching a
/// remote dependency.
Expand Down
24 changes: 3 additions & 21 deletions build-script-helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,33 +110,15 @@ def get_swiftpm_options(
swift_exec, cross_compile_config=cross_compile_config
)
build_os = build_target.split("-")[2]
if build_os.startswith("macosx"):
args += [
"-Xlinker",
"-rpath",
"-Xlinker",
"/usr/lib/swift",
]
args += [
"-Xlinker",
"-rpath",
"-Xlinker",
"@executable_path/../lib/swift/macosx",
]
args += [
"-Xlinker",
"-rpath",
"-Xlinker",
"@executable_path/../lib/swift-5.5/macosx",
]
else:
if not build_os.startswith("macosx"):
# Library rpath for swift, dispatch, Foundation, etc. when installing
args += [
"-Xlinker",
"-rpath",
"-Xlinker",
"$ORIGIN/../lib/swift/" + build_os,
]
args += ['--disable-local-rpath']

if cross_compile_host:
if build_os.startswith("macosx") and cross_compile_host.startswith("macosx-"):
Expand All @@ -151,7 +133,7 @@ def get_swiftpm_environment_variables(action: str):
env = dict(os.environ)
env["SWIFTCI_USE_LOCAL_DEPS"] = "1"
if action == "install":
env["SOURCEKIT_LSP_CI_INSTALL"] = "1"
env["SWIFTFORMAT_CI_INSTALL"] = "1"
return env


Expand Down