Skip to content

Commit c0033f2

Browse files
committed
Clean up rpaths of installed swift-format
- Don’t explicitly add rpaths to `/usr/lib/swift`, `@executable_path/../lib/swift/macosx` and `@executable_path/../lib/swift-5.5/macosx` on Darwin. I don’t know what they were needed for but they don’t seem to be necessary. Also standard Swift command line tools created from Xcode don’t contain these rpaths. - Increase the deployment target to macOS 12.0. This removes an rpath in the built binary that is an absolute path to the toolchain on the host, which was used to build swift-format. rdar://121400644
1 parent 4d634f2 commit c0033f2

File tree

2 files changed

+3
-22
lines changed

2 files changed

+3
-22
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ if installAction {
3535
let package = Package(
3636
name: "swift-format",
3737
platforms: [
38-
.iOS("13.0"),
39-
.macOS("10.15")
38+
.macOS("12.0"),
39+
.iOS("13.0")
4040
],
4141
products: [
4242
.executable(

build-script-helper.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -110,26 +110,7 @@ def get_swiftpm_options(
110110
swift_exec, cross_compile_config=cross_compile_config
111111
)
112112
build_os = build_target.split("-")[2]
113-
if build_os.startswith("macosx"):
114-
args += [
115-
"-Xlinker",
116-
"-rpath",
117-
"-Xlinker",
118-
"/usr/lib/swift",
119-
]
120-
args += [
121-
"-Xlinker",
122-
"-rpath",
123-
"-Xlinker",
124-
"@executable_path/../lib/swift/macosx",
125-
]
126-
args += [
127-
"-Xlinker",
128-
"-rpath",
129-
"-Xlinker",
130-
"@executable_path/../lib/swift-5.5/macosx",
131-
]
132-
else:
113+
if not build_os.startswith("macosx"):
133114
# Library rpath for swift, dispatch, Foundation, etc. when installing
134115
args += [
135116
"-Xlinker",

0 commit comments

Comments
 (0)