Skip to content

Commit 4261066

Browse files
author
Alex Denisov
committed
Swift: package whole toolchain instead of just resource dir
1 parent 9745ded commit 4261066

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

pkg_swift_llvm.py

+5-6
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):
@@ -196,6 +194,7 @@ def main(opts):
196194
os.mkdir(tmp)
197195
llvm_build_tree = next(opts.build_tree.glob("llvm-*"))
198196
swift_build_tree = next(opts.build_tree.glob("swift-*"))
197+
toolchain_dir = next(opts.build_tree.glob("toolchain-*/codeql-toolchain"))
199198
earlyswiftsyntax_build_tree = next(opts.build_tree.glob("earlyswiftsyntax-*"))
200199
configured = configure_dummy_project(tmp, prefixes=[llvm_build_tree, swift_build_tree,
201200
earlyswiftsyntax_build_tree / "cmake" / "modules"])
@@ -206,7 +205,7 @@ def main(opts):
206205
export_libs(exported, libs, swift_build_tree)
207206
export_headers(exported, opts.swift_source_tree, llvm_build_tree, swift_build_tree)
208207
export_sdk(exported / "sdk", opts.swift_source_tree, swift_build_tree)
209-
export_resource_dir(exported / "resource-dir", swift_build_tree)
208+
export_toolchain(exported / "toolchain", toolchain_dir)
210209

211210
zip_dir(exported, opts.output)
212211

swift-build-presets

+3-1
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)