Skip to content

Commit f3c3cb5

Browse files
committed
[Regex] Really build _RegexParser without resilience.
This was originally attempted with swiftlang#58810 but `_RegexParser` still ended up being built with library evolution enabled because the `-enable-library-evolution` flag is added to the command line after calling `add_swift_target_library` and therefore stripping the flag out of `SWIFT_COMPILE_FLAGS` does nothing. The `IS_FRAGILE` flag was introduced to support building C++ interop overlay modules without library evolution and it can now be used to prevent `_RegexParser` from being built with library evolution. Resolves rdar://93067204
1 parent 166d059 commit f3c3cb5

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

stdlib/public/RegexParser/CMakeLists.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ foreach(source ${_MATCHING_ENGINE_SOURCES})
2222
endforeach()
2323
message(STATUS "Using Experimental String Processing library for _RegexParser (${SWIFT_PATH_TO_STRING_PROCESSING_SOURCE}).")
2424

25-
set(SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS_NO_RESILIENCE)
26-
string(REGEX REPLACE "-enable-library-evolution" ""
27-
SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS_NO_RESILIENCE
28-
"${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}")
29-
30-
add_swift_target_library(swift_RegexParser ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
25+
# The parser module can be fragile (does not use library evolution) because its
26+
# only dependents are _StringProcessing and RegexBuilder and it's version-locked
27+
# with those modules.
28+
add_swift_target_library(swift_RegexParser ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB IS_FRAGILE
3129
"${MATCHING_ENGINE_SOURCES}"
3230

3331
SWIFT_MODULE_DEPENDS_LINUX Glibc
@@ -42,7 +40,6 @@ add_swift_target_library(swift_RegexParser ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} I
4240
C_COMPILE_FLAGS
4341
-Dswift_RegexParser_EXPORTS
4442
SWIFT_COMPILE_FLAGS
45-
${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS_NO_RESILIENCE}
4643
# Workaround until `_RegexParser` is imported as implementation-only
4744
# by `_StringProcessing`.
4845
-Xfrontend -disable-implicit-string-processing-module-import

0 commit comments

Comments
 (0)