Skip to content

[Bootstrap] Bootstrap & test with the integrated Swift driver. #2759

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
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
25 changes: 21 additions & 4 deletions Utilities/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def build(args):
build_yams(args)
build_swift_driver(args)
build_swiftpm_with_cmake(args)
build_swiftpm_with_swiftpm(args)
build_swiftpm_with_swiftpm(args,integrated_swift_driver=False)

def test(args):
"""Builds SwiftPM, then tests itself."""
Expand All @@ -301,6 +301,19 @@ def test(args):
# Test SwiftPM.
call_swiftpm(args, cmd)

# Build SwiftPM with the integrated driver.
note("Bootstrap with the integrated Swift driver")
build_swiftpm_with_swiftpm(args,integrated_swift_driver=True)

# Test SwiftPM with the integrated driver. Only the build and
# functional tests are interesting.
integratedDriverCmd = cmd
integratedDriverCmd.append("--use-integrated-swift-driver")
if args.filter:
integratedDriverCmd.append("--filter")
integratedDriverCmd.append("BuildTests;FunctionalTests")
call_swiftpm(args, integratedDriverCmd)

def install(args):
"""Builds SwiftPM, then installs its build products."""
build(args)
Expand Down Expand Up @@ -506,16 +519,20 @@ def build_swiftpm_with_cmake(args):
add_rpath_for_cmake_build(args, os.path.join(args.yams_build_dir, "lib"))
add_rpath_for_cmake_build(args, os.path.join(args.swift_driver_build_dir, "lib"))

def build_swiftpm_with_swiftpm(args):
def build_swiftpm_with_swiftpm(args, integrated_swift_driver):
"""Builds SwiftPM using the version of SwiftPM built with CMake."""
note("Building SwiftPM (with swift-build)")

call_swiftpm(args, [
swiftpm_args = [
"SWIFT_EXEC=" + args.swiftc_path,
"SWIFTPM_PD_LIBS=" + os.path.join(args.bootstrap_dir, "pm"),
os.path.join(args.bootstrap_dir, "bin/swift-build"),
"--disable-sandbox",
])
]
if integrated_swift_driver:
swiftpm_args.append("--use-integrated-swift-driver")

call_swiftpm(args, swiftpm_args)

# Setup symlinks that'll allow using swiftpm from the build directory.
symlink_force(args.swiftc_path, os.path.join(args.target_dir, args.conf, "swiftc"))
Expand Down