Point .clangd CompilationDatabase at the editable build directory#451
Point .clangd CompilationDatabase at the editable build directory#451aaron-ang wants to merge 2 commits into
Conversation
…der split The submodule pin pulls in two DuckDB changes that break the editable/debug build configured with DISABLE_UNITY=1 (see pyproject.toml editable overrides): 1. StructVector::GetEntries now returns vector<Vector>& instead of vector<unique_ptr<Vector>>& (duckdb commit 4e5d5da6a6 "Make StructVector have the same layout as DataChunk"). Drop the dereference at the two call sites that iterated the entries with *children[i]. 2. ListVector / ArrayVector / StructVector / MapVector were moved into their own headers under duckdb/common/vector/. Without unity these are no longer pulled in transitively, so add explicit includes. cibuildwheel builds (the CI release path) use unity and don't hit either issue, which is why this regression went unnoticed.
The editable build (configured in pyproject.toml) writes compile_commands.json to build/debug/, but .clangd has been pointing at build/clangd/, which is never populated. Result: clangd cannot find the compile DB and reports 'file not found' on every project header. Align .clangd with the actual editable build-dir so the IDE picks up the existing compile_commands.json without an extra symlink.
|
Closing in favor of #453 |
|
Hi @evertlammerts, heads-up that on a fresh checkout of Happy to reopen or re-scope if a different approach is preferred (e.g. documenting the symlink in |
Summary
.clangdpoints atbuild/clangd/, but the editable build writescompile_commands.jsontobuild/debug/(per thebuild-diroverride inpyproject.toml). Result: clangd has no compile DB to read and reports'file not found'on every project header in any IDE that uses clangd (VS Code, CLion, etc.).Repointing
.clangdatbuild/debugaligns it with the actual editable build-dir so the IDE picks up the existingcompile_commands.jsonwithout a manual symlink.Notes
Earlier revisions of this PR also patched
StructVector::GetEntriesderef sites innumpy_scan.cpp/python_conversion.cppand addedduckdb/common/vector/*.hppincludes across three files. Those have since landed via #453 (the variegata merge), so this PR is now a single-line.clangdchange.The remaining upstream-side breakage of the editable / Debug build — missing
create_*_info.hppincludes that causedynamic_castto forward-declared types inD_ASSERT— is tracked separately in duckdb/duckdb#22551. Once that lands and the submodule pin is bumped, the editable build perCLAUDE.mdwill be green end-to-end.Test plan
.cppfile in VS Code with the clangd extension resolves allduckdb/...andduckdb_python/...includes against the existingbuild/debug/compile_commands.json— no symlink needed.