Open jckarter opened 6 years ago
Paging @harlanhaskins
Targets that depend on these headers should declare a dependency on swift-syntax-generated-headers, but this gets hairy when dealing with transitive dependencies.
to fix this specific issue, add
DEPENDS swift-syntax-generated-headers
to lib/ClangImporter/CMakeLists.txt.
Though this is a very unsaitsfying fix because It Keeps Happening.
That implies that we're setting it as the wrong kind of dependency at the Parse level, no? CMake knows how to deal with transitive dependencies.
The issue is that it depends on headers, which aren’t ever added to the targets, and the dependency of ClangImporter on Parse only implies it needs to link with it. So even though Parse depends on swift-syntax-generated-headers, ClangImporter doesn’t necessarily have to build Parse (and the header dependency) before building its own object files.
Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 31043061a7a901681bc39307465d705dIssue Description:
In a clean build, parts of the system that rely on Syntax's generated headers can lose the race against the headers getting generated:
This can be worked around by explicitly doing
ninja swift/Syntax/SyntaxKind.h
then resuming the rest of the build, but there ought to be a dependency here.