Skip to content

Add a flag to enable-new-runtime-build that enables the new runtime build #79804

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
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
2 changes: 1 addition & 1 deletion utils/build-presets.ini
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ skip-test-sourcekit-lsp
skip-test-swiftpm
skip-test-llbuild

extra-cmake-options=-DSWIFT_ENABLE_NEW_RUNTIME_BUILD=YES
enable-new-runtime-build

[preset: buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx,flto]
mixin-preset=buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx
Expand Down
3 changes: 3 additions & 0 deletions utils/build_swift/build_swift/driver_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,9 @@ def create_argument_parser():
option('--swift-freestanding-is-darwin', toggle_true,
help='True if the freestanding platform is a Darwin one.')

option('--enable-new-runtime-build', toggle_true,
help='True to enable the new runtime build.')

# -------------------------------------------------------------------------
in_group('Options to select projects')

Expand Down
2 changes: 2 additions & 0 deletions utils/build_swift/tests/expected_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@
'llvm_install_components': defaults.llvm_install_components(),
'clean_install_destdir': False,
'use_linker': None,
'enable_new_runtime_build': False,
}


Expand Down Expand Up @@ -893,4 +894,5 @@ class BuildScriptImplOption(_BaseOption):

StrOption('--llvm-install-components'),
ChoicesOption('--use-linker', dest='use_linker', choices=['gold', 'lld']),
EnableOption('--enable-new-runtime-build', dest='enable_new_runtime_build'),
]
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ def __init__(self, args, toolchain, source_dir, build_dir):

self._handle_swift_debuginfo_non_lto_args()

self.cmake_options.extend(
self._enable_new_runtime_build)

@classmethod
def product_source_name(cls):
"""product_source_name() -> str
Expand Down Expand Up @@ -288,6 +291,11 @@ def _enable_stdlib_symbol_graphs(self):
return [('SWIFT_STDLIB_BUILD_SYMBOL_GRAPHS:BOOL',
self.args.build_stdlib_docs)]

@property
def _enable_new_runtime_build(self):
return [('SWIFT_ENABLE_NEW_RUNTIME_BUILD:BOOL',
self.args.enable_new_runtime_build)]

def _handle_swift_debuginfo_non_lto_args(self):
if ('swift_debuginfo_non_lto_args' not in self.args
or self.args.swift_debuginfo_non_lto_args is None):
Expand Down
9 changes: 6 additions & 3 deletions utils/swift_build_support/tests/products/test_swift.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def setUp(self):
swift_freestanding_is_darwin=False,
build_swift_private_stdlib=True,
swift_tools_ld64_lto_codegen_only_for_supporting_targets=False,
build_stdlib_docs=False)
build_stdlib_docs=False,
enable_new_runtime_build=False)

# Setup shell
shell.dry_run = True
Expand Down Expand Up @@ -122,7 +123,8 @@ def test_by_default_no_cmake_options(self):
'-DSWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_CROSS_COMPILING=FALSE',
'-DSWIFT_TOOLS_LD64_LTO_CODEGEN_ONLY_FOR_SUPPORTING_TARGETS:BOOL=FALSE',
'-USWIFT_DEBUGINFO_NON_LTO_ARGS',
'-DSWIFT_STDLIB_BUILD_SYMBOL_GRAPHS:BOOL=FALSE'
'-DSWIFT_STDLIB_BUILD_SYMBOL_GRAPHS:BOOL=FALSE',
'-DSWIFT_ENABLE_NEW_RUNTIME_BUILD:BOOL=FALSE',
]
self.assertEqual(set(swift.cmake_options), set(expected))

Expand Down Expand Up @@ -157,7 +159,8 @@ def test_swift_runtime_tsan(self):
'-DSWIFT_SHOULD_BUILD_EMBEDDED_STDLIB_CROSS_COMPILING=FALSE',
'-DSWIFT_TOOLS_LD64_LTO_CODEGEN_ONLY_FOR_SUPPORTING_TARGETS:BOOL=FALSE',
'-USWIFT_DEBUGINFO_NON_LTO_ARGS',
'-DSWIFT_STDLIB_BUILD_SYMBOL_GRAPHS:BOOL=FALSE'
'-DSWIFT_STDLIB_BUILD_SYMBOL_GRAPHS:BOOL=FALSE',
'-DSWIFT_ENABLE_NEW_RUNTIME_BUILD:BOOL=FALSE',
]
self.assertEqual(set(swift.cmake_options), set(flags_set))

Expand Down