Skip to content

Exercise bootstrapping with the XCBuild codepath in build-using-self #7253

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 13 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
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
13 changes: 9 additions & 4 deletions Utilities/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ def add_global_args(parser):
def add_build_args(parser):
"""Configures the parser with the arguments necessary for build-related actions."""
add_global_args(parser)
parser.add_argument(
"--swift-build-path",
help="path to the prebuilt SwiftPM `swift-build` binary",
metavar="PATH")
parser.add_argument(
"--swiftc-path",
help="path to the swift compiler",
Expand Down Expand Up @@ -154,7 +158,7 @@ def add_build_args(parser):
default=[])
parser.add_argument(
"--cross-compile-config",
help="Swift flags to cross-compile SPM with itself")
help="Swift flags to cross-compile SwiftPM with itself")

def add_test_args(parser):
"""Configures the parser with the arguments necessary for the test action."""
Expand Down Expand Up @@ -220,8 +224,9 @@ def parse_build_args(args):

args.swiftc_path = get_swiftc_path(args)
args.clang_path = get_tool_path(args, "clang")
args.cmake_path = get_tool_path(args, "cmake")
args.ninja_path = get_tool_path(args, "ninja")
if not args.skip_cmake_bootstrap:
args.cmake_path = get_tool_path(args, "cmake")
args.ninja_path = get_tool_path(args, "ninja")
args.ar_path = get_tool_path(args, "ar")
args.ranlib_path = get_tool_path(args, "ranlib")
if args.cross_compile_hosts:
Expand Down Expand Up @@ -640,7 +645,7 @@ def build_swiftpm_with_swiftpm(args, integrated_swift_driver):
swiftpm_args.append(os.path.join(args.bootstrap_dir, "bin/swift-bootstrap"))
else:
note("Building SwiftPM (with a prebuilt swift-build)")
swiftpm_args.append(os.path.join(os.path.split(args.swiftc_path)[0], "swift-build"))
swiftpm_args.append(args.swift_build_path or os.path.join(os.path.split(args.swiftc_path)[0], "swift-build"))
swiftpm_args.append("--disable-sandbox")

# Enforce resolved versions to avoid stray dependencies that aren't local.
Expand Down
10 changes: 10 additions & 0 deletions Utilities/build-using-self
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,13 @@ cd IntegrationTests
# Perform package update in order to get the latest commits for the dependencies.
swift package update
$SWIFTPM_BIN_DIR/swift-test --parallel

if [ "$(uname)" == "Darwin" ]; then
cd ..
echo "Current working directory is ${PWD}"
echo "Bootstrapping with the XCBuild codepath..."
./Utilities/bootstrap build --release \
--cross-compile-hosts macosx-arm64 \
--skip-cmake-bootstrap \
--swift-build-path "${SWIFTPM_BIN_DIR}/swift-build"
fi