clangd does not work since precompiled headers were introduced #374
Labels
No labels
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/store
bug
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
RFD
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
ux
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#374
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?
Describe the bug
clangd is unable to deal with precompiled headers as they are tied to compiler internals, and so it now outputs errors like :
No type named 'string_view' in namestapce 'std'
Steps To Reproduce
meson setup build --wipe
Expected behavior
clangd not hallucinating errors ?
nix --version
outputAdditional context
I tried https://gerrit.lix.systems/c/lix/+/1383 but it seems that it does not really work
wait a minute, are you using a clang stdenv for development? if that's not the case, i think that's your problem. it also explains why i didn't notice it while working on this.
i think my preferred fix is to ship a .clangd that deletes gcc's pch args.
can we disable precompiled headers for non-clang devshells specifically, maybe with a warning or a
-without-lsp
variant? we tend to use clangd as lsp but gcc stdenv for compiling stuff primarily because we've had much worse experience with gcc bugs than clang bugs :/No, I'm using the gcc stdenv...
Unsure what the correct fix for this is; we tried:
Which should work, but does not, as confirmed by looking at the output of
clangd --check=src/libstore/filetransfer.cc
under cc1 args.relevant clang code, which i don't want to debug today:
8c5a7a1fc4/clang-tools-extra/clangd/ConfigCompile.cpp (L268-L279)
aff197ff21/clang-tools-extra/clangd/CompileCommands.cpp (L593)
We can do this
https://gerrit.lix.systems/c/lix/+/1403