Skip to content

Conversation

@egorzhdan
Copy link
Contributor

This makes the requirement to have RegexParser build enabled more obvious to someone not familiar with ASTGen.

This also removes the dummy target that was triggering build failures: certain Swift code in ASTGen was using #if canImport(_CompilerRegexParser) to determine whether RegexParser is available, and the dummy target was causing this to always resolve to true. That obscured the underlying reason for compilation errors:

ASTGen/Sources/ASTGen/Regex.swift:51:30: error: cannot find 'swiftCompilerLexRegexLiteral' in scope

This makes the requirement to have RegexParser build enabled more obvious to someone not familiar with ASTGen.

This also removes the dummy target that was triggering build failures: certain Swift code in ASTGen was using `#if canImport(_CompilerRegexParser)` to determine whether RegexParser is available, and the dummy target was causing this to always resolve to true. That obscured the underlying reason for compilation errors:
```
ASTGen/Sources/ASTGen/Regex.swift:51:30: error: cannot find 'swiftCompilerLexRegexLiteral' in scope
```
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

else()
# Dummy target for dependencies
add_custom_target(_CompilerRegexParser)
if(NOT SWIFT_BUILD_REGEX_PARSER_IN_COMPILER)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we may want to allow the case where SWIFT_BUILD_SWIFT_SYNTAX is false, as add_pure_swift_host_library will bail without creating a target, and it looks like we force SWIFT_BUILD_REGEX_PARSER_IN_COMPILER off in that case:

swift/CMakeLists.txt

Lines 815 to 818 in 7ea2b3d

if(SWIFT_BUILD_REGEX_PARSER_IN_COMPILER AND NOT SWIFT_BUILD_SWIFT_SYNTAX)
message(WARNING "Force setting SWIFT_BUILD_REGEX_PARSER_IN_COMPILER=OFF because Swift parser integration is disabled")
set(SWIFT_BUILD_REGEX_PARSER_IN_COMPILER OFF)
endif()

cc @rintaro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants