Skip to content

Commit 7418b42

Browse files
committed
Add a flag to enable-new-runtime-build that enables the new runtime build.
What is nice about this is that by not using extra-cmake-args, we can avoid passing this into LLVM as well when attempting to reproduce failures on the bots (thus avoiding having to rebuild LLVM as well).
1 parent 0997a7e commit 7418b42

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed

utils/build-presets.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ skip-test-sourcekit-lsp
669669
skip-test-swiftpm
670670
skip-test-llbuild
671671

672-
extra-cmake-options=-DSWIFT_ENABLE_NEW_RUNTIME_BUILD=YES
672+
enable-new-runtime-build
673673

674674
[preset: buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx,flto]
675675
mixin-preset=buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx

utils/build_swift/build_swift/driver_arguments.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,9 @@ def create_argument_parser():
703703
option('--swift-freestanding-is-darwin', toggle_true,
704704
help='True if the freestanding platform is a Darwin one.')
705705

706+
option('--enable-new-runtime-build', toggle_true,
707+
help='True to enable the new runtime build.')
708+
706709
# -------------------------------------------------------------------------
707710
in_group('Options to select projects')
708711

utils/build_swift/tests/expected_options.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@
336336
'llvm_install_components': defaults.llvm_install_components(),
337337
'clean_install_destdir': False,
338338
'use_linker': None,
339+
'enable_new_runtime_build': False,
339340
}
340341

341342

@@ -893,4 +894,5 @@ class BuildScriptImplOption(_BaseOption):
893894

894895
StrOption('--llvm-install-components'),
895896
ChoicesOption('--use-linker', dest='use_linker', choices=['gold', 'lld']),
897+
EnableOption('--enable-new-runtime-build', dest='enable_new_runtime_build'),
896898
]

utils/swift_build_support/swift_build_support/products/swift.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ def __init__(self, args, toolchain, source_dir, build_dir):
101101

102102
self._handle_swift_debuginfo_non_lto_args()
103103

104+
self.cmake_options.extend(
105+
self._enable_new_runtime_build)
106+
104107
@classmethod
105108
def product_source_name(cls):
106109
"""product_source_name() -> str
@@ -288,6 +291,11 @@ def _enable_stdlib_symbol_graphs(self):
288291
return [('SWIFT_STDLIB_BUILD_SYMBOL_GRAPHS:BOOL',
289292
self.args.build_stdlib_docs)]
290293

294+
@property
295+
def _enable_new_runtime_build(self):
296+
return [('SWIFT_ENABLE_NEW_RUNTIME_BUILD:BOOL',
297+
self.args.enable_new_runtime_build)]
298+
291299
def _handle_swift_debuginfo_non_lto_args(self):
292300
if ('swift_debuginfo_non_lto_args' not in self.args
293301
or self.args.swift_debuginfo_non_lto_args is None):

utils/swift_build_support/tests/products/test_swift.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ def setUp(self):
7272
swift_freestanding_is_darwin=False,
7373
build_swift_private_stdlib=True,
7474
swift_tools_ld64_lto_codegen_only_for_supporting_targets=False,
75-
build_stdlib_docs=False)
75+
build_stdlib_docs=False,
76+
enable_new_runtime_build=False)
7677

7778
# Setup shell
7879
shell.dry_run = True
@@ -122,7 +123,8 @@ def test_by_default_no_cmake_options(self):
122123
'-DSWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_CROSS_COMPILING=FALSE',
123124
'-DSWIFT_TOOLS_LD64_LTO_CODEGEN_ONLY_FOR_SUPPORTING_TARGETS:BOOL=FALSE',
124125
'-USWIFT_DEBUGINFO_NON_LTO_ARGS',
125-
'-DSWIFT_STDLIB_BUILD_SYMBOL_GRAPHS:BOOL=FALSE'
126+
'-DSWIFT_STDLIB_BUILD_SYMBOL_GRAPHS:BOOL=FALSE',
127+
'-DSWIFT_ENABLE_NEW_RUNTIME_BUILD:BOOL=FALSE',
126128
]
127129
self.assertEqual(set(swift.cmake_options), set(expected))
128130

@@ -157,7 +159,8 @@ def test_swift_runtime_tsan(self):
157159
'-DSWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_CROSS_COMPILING=FALSE',
158160
'-DSWIFT_TOOLS_LD64_LTO_CODEGEN_ONLY_FOR_SUPPORTING_TARGETS:BOOL=FALSE',
159161
'-USWIFT_DEBUGINFO_NON_LTO_ARGS',
160-
'-DSWIFT_STDLIB_BUILD_SYMBOL_GRAPHS:BOOL=FALSE'
162+
'-DSWIFT_STDLIB_BUILD_SYMBOL_GRAPHS:BOOL=FALSE',
163+
'-DSWIFT_ENABLE_NEW_RUNTIME_BUILD:BOOL=FALSE',
161164
]
162165
self.assertEqual(set(swift.cmake_options), set(flags_set))
163166

0 commit comments

Comments
 (0)