clangd 23 module builder: one failed module (hello.test) blanks ALL completions — "Failed to compile src/test.cppm" while the project toolchain builds it fine
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 58/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cpp
- Lĩnh vực
- compilers, developer-experience
Hướng nghiên cứu
Start with the serve-time module-hints pipeline: locate where mcppls builds module hints (the log lines about 'routed to mcppls's own engine' and 'clangd could not build module') and where a failed module's -fmodule-file hints are assembled into the flags handed to clangd. Read how a build failure currently propagates into the hint set, and where a per-module exclusion could keep completions alive (Ask 1). For Ask 2, reproduce with mcppls serve --log=verbose on the reported project to surface the underlying clang diagnostic for src/test.cppm; mcppls check src/test.cppm and a mcpp build comparison isolate the clangd 23 vs 22 flag mismatch. Done = one unbuildable module no longer blanks completions, and either the compile error is explained or the flag mismatch is filed/documented.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Environment
- mcppls 0.0.11 payload (bundled clangd 23.1.0, kit
mcppls-kit-libcxx-23.1.0-x86_64-unknown-linux-gnu), installed via xim - Project built by mcpp 2026.10.5.2 with toolchain clang 22.1.8 / libc++ 22.1.8 (
mcpp buildpasses) - Linux x86_64, editor Neovim 0.12.5 via the mcppls-nvim plugin (plain LSP client, no other completion plugins)
Project shape
src/
main.cpp import std; import hello.greet; import hello.test; import hello.hhh; import hello.test.ccc;
greet.cppm export module hello.greet; …
test.cppm export module hello.test; import std; export namespace hello { auto test() { std::println("hello"); } }
hhh.cppm / xxxx.cppm / test/ccc.cppm …
mcpp.toml, compile_commands.json (mcpp-written)
What happens
clangd's module builder fails on hello.test and, from that point on, every textDocument/completion is answered with 0 items instantly — std::, std::ve, hello::, all of them. The response arrives in ~1 ms with no error (err == nil), status keeps reporting ready, and no diagnostic is shown to the user, so it just looks like "completion is dead".
Server log (mcppls 0.0.11, serve pipeline):
[warning] clangd (…/test/mcpp/hello): E[…] Failed to build module hello.test; due to Failed to compile …/src/test.cppm. Use '--log=verbose' to view detailed failure reasons. …
[warning] 2 files routed to mcppls's own engine (…): 1 module cannot be prepared because hello.test failed: Failed to compile …/src/test.cppm
[warning] clangd could not build module hello.test (…): Failed to compile …/src/test.cppm
[warning] clangd (…) has kept a core busy for 30 s on main.cpp, which it is not building; restarting it
[warning] clangd (…): E[…] Transport error: Input/output error
Key data points
- The project toolchain compiles it fine.
mcpp build(clang 22.1.8) passes; the failure is specific to clangd 23.1's own module-hints builder (build database flags come from the clang 22.1.8 cdb, with-resource-dirpointed at clangd 23 and-fmodule-filehints into the workspacemodule-hints/). mcppls check src/test.cppmpasses (clangd exit 0) — the failure only shows up in the serve-time hints pipeline, which makes it invisible to the check tooling.- Counter-experiment isolates it. A copy of the same project with
import hello.test;dropped (andtest.cppmremoved), everything else identical:std::ve→std::vector,hello::→greet, completions fully alive. - The failure cascades through the hints chain: with
hello.testunbuildable, dependent-fmodule-file=hello.test=…pcm/std.pcmhints reference pcms that never get produced (module file not foundwhen the prime files are compiled manually), so evenimport stdcompletions die — well beyond the one broken module.
Asks
- Graceful degradation: when one module fails to build, exclude it from the hint set and keep serving completions for the rest of the project (today one bad module blanks
std::and every other scope, which reads as "LSP is broken" to the user, with nothing on screen). - Root-cause the clangd 23.1 compile failure of this module — at default log level the underlying clang error is not surfaced (
--log=verbosehint comes from clangd itself). I can run the session with--log=verbose/--debug-modules-builderand attach the diagnostic bundle — tell me which you prefer.
Happy to provide the full project (it is ~6 small files) if useful.
- Ngôn ngữ chính
- C++
- Star
- 25
- Fork
- 2
- Merge trung bình
- 21 giờ 5 phút
- Pull request đã merge (30 ngày)
- 13
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Sunrisepeak/mcpp-language-server
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Sunrisepeak/mcpp-language-server#80 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Sunrisepeak/mcpp-language-server#66 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 1/100
Sunrisepeak/mcpp-language-server#77 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Sunrisepeak/mcpp-language-server#71 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
Sunrisepeak/mcpp-language-server#59 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Sunrisepeak/mcpp-language-server
Issue tương tự
-
#2754 make deepseek api not workĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
xiaoyifang/goldendict-ng#3148 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
triton-inference-server/server#9069 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 4 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100