Skip to content

Migration to SwiftpM’s new boostrap script #28710

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
Dec 12, 2019
Merged
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
21 changes: 8 additions & 13 deletions utils/swift_build_support/swift_build_support/products/swiftpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,28 @@ def should_build(self, host_target):

def run_bootstrap_script(self, action, host_target, additional_params=[]):
script_path = os.path.join(
self.source_dir, 'Utilities', 'bootstrap')
self.source_dir, 'Utilities', 'new-bootstrap')
toolchain_path = self.install_toolchain_path()
swiftc = os.path.join(toolchain_path, "usr", "bin", "swiftc")
sbt = os.path.join(toolchain_path, "usr", "bin", "swift-build-tool")

llbuild_src = os.path.join(os.path.dirname(self.source_dir), "llbuild")

# FIXME: We require llbuild build directory in order to build. Is
# there a better way to get this?
build_root = os.path.dirname(self.build_dir)
llbuild_build_dir = os.path.join(
build_root, '%s-%s' % ("llbuild", host_target))

helper_cmd = [script_path]

if action != "build":
helper_cmd.append(action)
helper_cmd = [script_path, action]

if self.is_release():
helper_cmd.append("--release")

helper_cmd += [
"--swiftc", swiftc,
"--sbt", sbt,
"--build", self.build_dir,
"--llbuild-source-dir", llbuild_src,
"--llbuild-build-dir", llbuild_build_dir,
"--swiftc-path", swiftc,
"--clang-path", self.toolchain.cc,
"--cmake-path", self.toolchain.cmake,
"--ninja-path", self.toolchain.ninja,
"--build-dir", self.build_dir,
"--llbuild-build-dir", llbuild_build_dir
]
helper_cmd.extend(additional_params)

Expand Down