Repository navigation
Conversation
The target was EXCLUDE_FROM_ALL, so a plain cmake --build never produced libSwiftCompilerPlugin.a and cmake --install died at Sources/SwiftCompilerPlugin/cmake_install.cmake:41. Every other library in Sources/ builds by default; this one was the outlier. Verified: fresh configure + build + install to a prefix now completes, and libSwiftCompilerPlugin.a lands in lib/swift/host alongside the rest. Fixes swiftlang#3438
rintaro
left a comment
There was a problem hiding this comment.
libSwiftCompilerPlugin.a lands in lib/swift/host alongside the rest.
We do not want libSwiftCompilerPlugin in the toolchain and that is exactly the reason we added EXCLUDE_FROM_ALL iirc.
If the generated install rules including it is the problem, is it possible to fix that instead?
Per review, building SwiftCompilerPlugin by default was the wrong fix: EXCLUDE_FROM_ALL is intentional to keep it out of the toolchain. Instead, add_swift_syntax_library() now skips the install and export rules for targets marked EXCLUDE_FROM_ALL, so cmake --install no longer references the never-built libSwiftCompilerPlugin.a.
bunnysayzz
left a comment
There was a problem hiding this comment.
Fair point, that was the wrong fix. Reworked it per your suggestion: reverted the EXCLUDE_FROM_ALL removal, and instead add_swift_syntax_library now skips the install/export rules for targets marked EXCLUDE_FROM_ALL. So cmake --install no longer references the never-built lib, and it stays out of the toolchain. Pushed.
rintaro
left a comment
There was a problem hiding this comment.
Thank you! Overall looks fine, but I have one suggestion, what do you think?
|
|
||
| # Add a new host library with the given name. | ||
| function(add_swift_syntax_library name) | ||
| cmake_parse_arguments(ASHL "EXCLUDE_FROM_ALL" "" "" ${ARGN}) |
There was a problem hiding this comment.
Instead of parsing ARGN, I think it's cleaner to read the target property after add_library:
i.e.
get_target_property(ASHL_EXCLUDE_FROM_ALL ${target} EXCLUDE_FROM_ALL)
if(NOT ASHL_EXCLUDE_FROM_ALL)
....There was a problem hiding this comment.
good call, switched it to get_target_property. pushed.
|
@swift-ci Please test |
|
@swift-ci Please test Linux |
Fixes #3438.
Root cause: Sources/SwiftCompilerPlugin/CMakeLists.txt marked the target EXCLUDE_FROM_ALL, so a plain cmake --build never produced libSwiftCompilerPlugin.a while the generated install rules still referenced it. cmake --install died at Sources/SwiftCompilerPlugin/cmake_install.cmake:41. Every other library under Sources/ builds by default; this one was the outlier.
Fix: drop EXCLUDE_FROM_ALL (one line). Verified on macOS with the Xcode CLT toolchain: fresh Ninja Release configure + build + install to a prefix now completes end to end, and libSwiftCompilerPlugin.a lands in lib/swift/host alongside the rest.
Note: as jcm93 found, the install still only moves bare .a files with no headers or package config, so downstream findability is a possible follow-up. This PR fixes the reported crash; happy to extend if maintainers want the fuller install story here.