Skip to content

Commit 3cf47d4

Browse files
committed
Force enabling SwiftCompilerSources in the build
This means that `bootstrapping=off` cannot be used anymore. Also, make `hosttools` the default bootstrapping mode on Darwin This change also enables SwiftCompilerSources in lldb on Windows. #73322
1 parent a9d80ce commit 3cf47d4

File tree

7 files changed

+14
-45
lines changed

7 files changed

+14
-45
lines changed

CMakeLists.txt

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,6 @@ option(SWIFT_TOOLS_LD64_LTO_CODEGEN_ONLY_FOR_SUPPORTING_TARGETS
343343

344344
option(BOOTSTRAPPING_MODE [=[
345345
How to build the swift compiler modules. Possible values are
346-
OFF: build without swift modules
347346
HOSTTOOLS: build with a pre-installed toolchain
348347
BOOTSTRAPPING: build with a 2-stage bootstrapping process
349348
BOOTSTRAPPING-WITH-HOSTLIBS: build with a 2-stage bootstrapping process,
@@ -352,7 +351,7 @@ How to build the swift compiler modules. Possible values are
352351
`SWIFT_NATIVE_SWIFT_TOOLS_PATH` (non-Darwin only)
353352
CROSSCOMPILE-WITH-HOSTLIBS: build with a bootstrapping-with-hostlibs compiled
354353
compiler, provided in `SWIFT_NATIVE_SWIFT_TOOLS_PATH`
355-
]=] OFF)
354+
]=] HOSTTOOLS)
356355

357356
option(BRIDGING_MODE [=[
358357
How swift-C++ bridging code is compiled:
@@ -736,18 +735,6 @@ option(SWIFT_ENABLE_BACKTRACING
736735
set(SWIFT_DARWIN_DEPLOYMENT_VERSION_MACCATALYST "14.5" CACHE STRING
737736
"Minimum deployment target version for macCatalyst")
738737

739-
# A tempoarary hack: force enabling HOSTTOOLS mode on Windows.
740-
# Right now, SwiftCompilerSources cannot be enabled for lldb because on Windows
741-
# swift and lldb are built in a unified build and there is a missing dependency
742-
# on swiftrt.
743-
# Swift and lldb are configured with the same cmake invocation and therefore
744-
# enabling bootstrapping for swift and disabling it for lldb only works by
745-
# hardcoding the bootstrapping mode in the cmake file.
746-
# https://github.com/apple/swift/issues/73322
747-
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
748-
set(BOOTSTRAPPING_MODE "HOSTTOOLS")
749-
endif()
750-
751738
#
752739
# End of user-configurable options.
753740
#
@@ -910,6 +897,10 @@ set(SWIFT_MAIN_INCLUDE_DIR "${SWIFT_SOURCE_DIR}/include")
910897
set(SWIFT_SHIMS_INCLUDE_DIR "${SWIFT_SOURCE_DIR}/stdlib/public/SwiftShims")
911898
set(SWIFT_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/include")
912899

900+
if (NOT BOOTSTRAPPING_MODE)
901+
message(FATAL_ERROR "turning off bootstrapping is not supported anymore")
902+
endif()
903+
913904
set(SWIFT_RUNTIME_OUTPUT_INTDIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin")
914905
set(SWIFT_LIBRARY_OUTPUT_INTDIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib")
915906
if("${SWIFT_NATIVE_SWIFT_TOOLS_PATH}" STREQUAL "")

test/lit.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,10 @@ if 'swift_evolve' in lit_config.params:
896896
if not 'swift_driver' in lit_config.params:
897897
config.available_features.add("cplusplus_driver")
898898

899+
# SwiftCompilerSources are now always enabled:
900+
# TODO: remove all the `REQUIRES: swift_in_compiler` in tests
901+
config.available_features.add('swift_in_compiler')
902+
899903
# Check if we need to run lit tests using the legacy driver or the new driver
900904
# The default for existing test runs is to use the legacy driver.
901905
# The new driver is tested separately.

test/lit.site.cfg.in

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -166,16 +166,6 @@ config.swift_stdlib_enable_objc_interop = "@SWIFT_STDLIB_ENABLE_OBJC_INTEROP@" =
166166
# Configured in DarwinSDKs.cmake
167167
config.freestanding_sdk_name = "@SWIFT_SDK_FREESTANDING_LIB_SUBDIR@"
168168

169-
if "@BOOTSTRAPPING_MODE@" != "OFF":
170-
config.available_features.add('swift_in_compiler')
171-
172-
if "@BOOTSTRAPPING_MODE@" == 'HOSTTOOLS':
173-
config.available_features.add('hosttools_mode')
174-
elif "@BOOTSTRAPPING_MODE@" == 'BOOTSTRAPPING':
175-
config.available_features.add('bootstrapping_mode')
176-
elif "@BOOTSTRAPPING_MODE@" == 'BOOTSTRAPPING-WITH-HOSTLIBS':
177-
config.available_features.add('bootstrapping_with_hostlibs_mode')
178-
179169
if '@SWIFT_BUILD_SWIFT_SYNTAX@' == 'TRUE':
180170
config.available_features.add('swift_swift_parser')
181171

utils/build-presets.ini

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -952,15 +952,6 @@ mixin-preset=
952952
buildbot_linux
953953
mixin_buildbot_linux,no_test
954954

955-
[preset: buildbot_linux,no_test,bootstrapping_off]
956-
mixin-preset=
957-
buildbot_linux,no_test
958-
959-
skip-early-swift-driver
960-
skip-early-swiftsyntax
961-
962-
bootstrapping=off
963-
964955
[preset: buildbot_linux,no_assertions,no_test]
965956
mixin-preset=
966957
buildbot_linux,no_assertions

utils/build-script-impl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -381,15 +381,8 @@ function true_false() {
381381

382382
function to_bootstrapping_mode() {
383383
case "$1" in
384-
false | FALSE | 0)
385-
echo "OFF"
386-
;;
387-
true | TRUE | 1 | "")
388-
if [[ "$(uname -s)" == "Darwin" ]] ; then
389-
echo "BOOTSTRAPPING-WITH-HOSTLIBS"
390-
else
391-
echo "BOOTSTRAPPING"
392-
fi
384+
false | FALSE | 0 | "")
385+
echo "HOSTTOOLS"
393386
;;
394387
*)
395388
echo `toupper $1`

utils/build.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,7 @@ function Build-BuildTools($Arch) {
10561056
SWIFT_INCLUDE_APINOTES = "NO";
10571057
SWIFT_INCLUDE_DOCS = "NO";
10581058
SWIFT_INCLUDE_TESTS = "NO";
1059+
BOOTSTRAPPING_MODE = "HOSTTOOLS";
10591060
"cmark-gfm_DIR" = "$($Arch.ToolchainInstallRoot)\usr\lib\cmake";
10601061
}
10611062
}
@@ -1148,6 +1149,7 @@ function Build-Compilers() {
11481149
SWIFT_PATH_TO_STRING_PROCESSING_SOURCE = "$SourceCache\swift-experimental-string-processing";
11491150
SWIFT_PATH_TO_SWIFT_SDK = (Get-PinnedToolchainSDK);
11501151
"cmark-gfm_DIR" = "$($Arch.ToolchainInstallRoot)\usr\lib\cmake";
1152+
BOOTSTRAPPING_MODE = "HOSTTOOLS";
11511153
})
11521154
}
11531155
}
@@ -1383,6 +1385,7 @@ function Build-Runtime([Platform]$Platform, $Arch) {
13831385
SWIFT_PATH_TO_LIBDISPATCH_SOURCE = "$SourceCache\swift-corelibs-libdispatch";
13841386
SWIFT_PATH_TO_STRING_PROCESSING_SOURCE = "$SourceCache\swift-experimental-string-processing";
13851387
CMAKE_SHARED_LINKER_FLAGS = @("/INCREMENTAL:NO", "/OPT:REF", "/OPT:ICF");
1388+
BOOTSTRAPPING_MODE = "HOSTTOOLS";
13861389
}
13871390
}
13881391

validation-test/lit.site.cfg.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,6 @@ config.swift_stdlib_enable_objc_interop = "@SWIFT_STDLIB_ENABLE_OBJC_INTEROP@" =
145145
# Configured in DarwinSDKs.cmake
146146
config.freestanding_sdk_name = "@SWIFT_SDK_FREESTANDING_LIB_SUBDIR@"
147147

148-
if "@BOOTSTRAPPING_MODE@" != "OFF":
149-
config.available_features.add('swift_in_compiler')
150-
151148
# Let the main config do the real work.
152149
config.test_exec_root = os.path.dirname(os.path.realpath(__file__))
153150
lit_config.load_config(config, "@SWIFT_SOURCE_DIR@/validation-test/lit.cfg")

0 commit comments

Comments
 (0)