Skip to content

Commit 0f0c492

Browse files
committed
[CMake] Fatal error when bootstrapping is not "hosttools"
and Swift parser integration is enabled. If swift parser integration is enabled, SwiftSyntax libraries are always built with host tools. Other SwiftCompilerSources modules must use the same runtime with parser libraries.
1 parent 2a2787b commit 0f0c492

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,10 @@ if(SWIFT_PATH_TO_EARLYSWIFTSYNTAX_BUILD_DIR)
953953
else()
954954
set(SWIFT_SWIFT_PARSER TRUE)
955955
include(${SWIFT_PATH_TO_EARLYSWIFTSYNTAX_TARGETS})
956+
957+
if(SWIFT_HOST_VARIANT_SDK STREQUAL "LINUX" AND NOT BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS")
958+
message(FATAL_ERROR "Only BOOTSTRAPPING=HOSTTOOLS is supported in Linux when Swift parser integration is enabled")
959+
endif()
956960
endif()
957961
endif()
958962

tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,8 @@ function(add_sourcekit_swift_runtime_link_flags target path HAS_SWIFT_MODULES)
132132

133133
file(RELATIVE_PATH relative_rtlib_path "${path}" "${SWIFTLIB_DIR}/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
134134
list(APPEND RPATH_LIST "$ORIGIN/${relative_rtlib_path}")
135-
136-
if(ASKD_BOOTSTRAPPING_MODE STREQUAL "HOSTTOOLS")
137-
list(APPEND RPATH_LIST "${host_lib_dir}")
138-
endif()
135+
# NOTE: SourceKit components are NOT executed before stdlib is built.
136+
# So there's no need to add RUNPATH to builder's runtime libraries.
139137

140138
elseif(ASKD_BOOTSTRAPPING_MODE STREQUAL "BOOTSTRAPPING")
141139
get_bootstrapping_swift_lib_dir(bs_lib_dir "")

0 commit comments

Comments
 (0)