Repository navigation
mcppls-clangd 0.0.12: declared directive recovery and const-view fixes; workers tolerate an unbuilt command directory - #3
Merged
Conversation
…correctness, proved on its final bytes mcpp-language-server keeps two workarounds for defects this series fixes: WA-CLANGD-001 (a file with `import hello.` never finishes, UP-01) and WA-CLANGD-010 (misc-const-correctness suggests const for a view whose const begin() is not viable, UP-22). It retires a workaround for an engine only when the engine's verified identity declares the fix, as it already does for module-directive-diagnostic-ranges. engine.json now declares module-directive-recovery and const-correctness-views, each proved on the final package bytes: the in-tree module-directive-recovery lit session must answer (stock clangd 23.1 hangs on it), and ci/const_views_canary.py, a self-contained view with a constrained const begin(), must report only its positive control (stock clangd 23.1 also reports the view).
…exist yet
mcpp-language-server's mcpp-emit-package-std fixture showed it: mcpp names the
standard library unit's command directory in its build cache, which does not
exist before the first build. The Linux module worker returned the failed
VFS::setCurrentWorkingDirectory as an error, so std and every importer of it
failed to build ("module worker failed: No such file or directory"), where
stock clangd's in-process build reports "VFS: failed to set CWD" and goes on.
The worker now does what ThreadsafeFS::view does; a PrerequisiteModulesTests
case builds a module from a request whose directory is missing.
…ot exist getFullPath() asserts the file it names exists; the unbuilt command directory is the one path the case needs to be missing.
The first build-test on main after the 0.0.12 merge had no floor cache in its scope and was cancelled at 90 minutes; a cold Ubuntu 20.04 build of clang and clangd takes about three hours on a hosted runner.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The 0.0.12 engine fixes two upstream defects that mcpp-language-server still works around: WA-CLANGD-001 (
import hello.hangs the file, UP-01) and WA-CLANGD-010 (misc-const-correctness suggests const for a view whose const begin() is not viable, UP-22). The product retires a workaround only when the engine's verified identity declares the fix, so engine.json now declaresmodule-directive-recoveryandconst-correctness-views.Each feature is proved on the final package bytes, the same way the existing three are:
module-directive-recovery.testLSP session must answer every request. Locally, stock clangd 23.1 times out after 20 s with no answer, and this engine answers all four.ci/const_views_canary.pyuses a self-contained view with a constrainedconst begin()and must report only its positive control. Locally, stock clangd 23.1 reportsViewandPlain, and this engine reports onlyPlain.No LLVM code changes, so the patched tree and the binaries are the same as #2. The v0.0.12 release is re-cut from this commit so that the product pins an engine that declares these features.
Worker fix found by the product conformance run. On Linux the module worker treated a command directory that does not exist yet as fatal. mcpp's standard-library unit names its not-yet-created build cache, so in mcpp-language-server's
mcpp-emit-package-stdfixture std and every importer failed to build (module worker failed: No such file or directory). With stock clangd's in-process build the same fixture passes. The worker now does whatThreadsafeFS::viewdoes: it reportsVFS: failed to set CWDand goes on. A PrerequisiteModulesTests case covers it. The patched tree is nowdfe2f25a…, and only 0017 (code + test) and 0025 (test) differ from the regrouped series.