Skip to content

Commit a04cd96

Browse files
committed
Swift: package whole toolchain instead of just resource dir
1 parent 5be53b7 commit a04cd96

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

pkg_swift_llvm.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,11 @@ def export_sdk(tgt, swift_source_tree, swift_build_tree):
133133
shutil.copytree(swift_source_tree / "stdlib" / "public" / "SwiftShims" / "swift" / "shims",
134134
tgt / "usr" / "lib" / "swift" / "shims",
135135
ignore=shutil.ignore_patterns('CMakeLists.txt'))
136-
shutil.copytree(swift_build_tree/ "lib" / "swift",
137-
tgt / "resource-dir")
138136

139137

140-
def export_resource_dir(tgt, swift_build_tree):
141-
print("assembling resource dir")
142-
shutil.copytree(swift_build_tree/ "lib" / "swift", tgt)
138+
def export_toolchain(tgt, toolchain_dir):
139+
print("assembling toolchain")
140+
shutil.copytree(toolchain_dir, tgt)
143141

144142

145143
def export_stdlibs(exported_dir, swift_build_tree):
@@ -194,6 +192,7 @@ def main(opts):
194192
os.mkdir(tmp)
195193
llvm_build_tree = next(opts.build_tree.glob("llvm-*"))
196194
swift_build_tree = next(opts.build_tree.glob("swift-*"))
195+
toolchain_dir = next(opts.build_tree.glob("toolchain-*/codeql-toolchain"))
197196
earlyswiftsyntax_build_tree = next(opts.build_tree.glob("earlyswiftsyntax-*"))
198197
configured = configure_dummy_project(tmp, prefixes=[llvm_build_tree, swift_build_tree,
199198
earlyswiftsyntax_build_tree / "cmake" / "modules"])
@@ -204,7 +203,7 @@ def main(opts):
204203
export_libs(exported, libs, swift_build_tree)
205204
export_headers(exported, opts.swift_source_tree, llvm_build_tree, swift_build_tree)
206205
export_sdk(exported / "sdk", opts.swift_source_tree, swift_build_tree)
207-
export_resource_dir(exported / "resource-dir", swift_build_tree)
206+
export_toolchain(exported / "toolchain", toolchain_dir)
208207

209208
zip_dir(exported, opts.output)
210209

swift-build-presets

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ enable-experimental-string-processing
2323
swift-enable-experimental-string-processing=1
2424

2525
no-assertions
26-
2726
reconfigure
2827

28+
install-swift
29+
install-prefix=/codeql-toolchain
30+
2931
[preset: codeql-release]
3032
mixin-preset=codeql-baseline
3133
release

0 commit comments

Comments
 (0)