clang-scan-deps before LLVM 19 has no -o, so with an LLVM 18 toolchain every C++ source fails its scan #52
Labels
No labels
bug
claude:blocked
claude:done
claude:failed
claude:in-progress
claude:ready
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Catcrafts/Crafter.Build#52
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Since 6.4.2 a build reads what each
.cppmand.cppdeclares and imports withclang-scan-deps -format=p1689 -o <file> -- <compile command>. clang-scan-deps has had-osince LLVM 19: the option is inclang/tools/clang-scan-deps/Opts.tdatllvmorg-19.1.0and not atllvmorg-18.1.8. LLVM 18's clang-scan-deps exits 1 on an option it does not know (ParseArgsin itsClangScanDeps.cpp). So with an LLVM 18 toolchain, named byCRAFTER_BUILD_LLVM_DIRor found first onPATHoutside the Flatpak, every build with a C++ source would fail at its first scan. Nothing says which LLVM releases crafter-build supports.Not run: no LLVM 18 was at hand. The Flatpak carries LLVM 23.1.2 and the development machine has 23.1.3, and both scan. LLVM 18's clang-scan-deps does write the make-style dependency file of
-MD -MFin P1689 mode (MakeformatOutputPathin itsClangScanDeps.cpp), which the scan cache needs.Line numbers refer to
578a1da(6.4.2).Where
implementations/Crafter.Build-Clang.cpp:1155,ScanSource: the scan's command,-obefore--.implementations/Crafter.Build-Platform.cpp:707,RunCommandChecked: every build step runs as<command> 2>&1throughpopen.AGENTS.template.md:43: the prerequisites name clang-scan-deps, and no release.Proposal
State LLVM 19 as the oldest release crafter-build supports, in the prerequisites of AGENTS.template.md.
GetToolchain()could also refuse an older clang with one message, asBuild()reports a missing compiler once rather than per unit.The other way is to take the description from clang-scan-deps' standard output, which every release writes it to. The redirect would have to sit in a subshell,
( clang-scan-deps … > <file> ):RunCommandCheckedappends2>&1after the command, and<command> > <file> 2>&1would send the errors into the file too.Not looked at
Whether anything else in crafter-build needs a newer LLVM than 18.