Skip to content

Fix editable/debug build after StructVector API change and vector header split#451

Open
aaron-ang wants to merge 2 commits intoduckdb:mainfrom
aaron-ang:fix-editable-debug-build
Open

Fix editable/debug build after StructVector API change and vector header split#451
aaron-ang wants to merge 2 commits intoduckdb:mainfrom
aaron-ang:fix-editable-debug-build

Conversation

@aaron-ang
Copy link
Copy Markdown

@aaron-ang aaron-ang commented May 11, 2026

Summary

Three small fixes to make the editable / debug build (the one configured with DISABLE_UNITY = "1" in pyproject.toml, used when running the steps in CLAUDE.md) work end-to-end:

  1. StructVector::GetEntries now returns vector<Vector> & instead of vector<unique_ptr<Vector>> &duckdb/duckdb@4e5d5da6a6 "Make StructVector have the same layout as DataChunk (vector)". The two call sites in this repo still iterate via *children[i], which becomes a type error (no match for 'operator*' (operand type is 'duckdb::Vector')).
  2. ListVector / ArrayVector / StructVector / MapVector were moved into their own headers under duckdb/common/vector/. With unity disabled they are no longer pulled in transitively, so building fails with 'ListVector' has not been declared / 'ArrayVector' has not been declared / 'StructVector' has not been declared / 'MapVector' has not been declared (and follow-on 'VALID' / 'DUPLICATE_KEY' is not a member of 'duckdb::MapInvalidReason').
  3. .clangd points at build/clangd/, but the editable build writes compile_commands.json to build/debug/ (per the build-dir override in pyproject.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.).

cibuildwheel (CI release path) uses the default unity-enabled Release config and does not exercise issues 1 or 2, which is why this regression went unnoticed. Issue 3 is silent at build time and only shows up in the IDE.

Changes

  • Drop the deref in *struct_children[i] / *children[i] at the two StructVector::GetEntries call sites.
  • Add explicit #include for the four vector headers in the three files that reference those types.
  • Repoint .clangd CompilationDatabase from build/clangd to build/debug so it matches the actual editable build directory.

Test plan

  • Followed CLAUDE.md two-step editable build on a fresh .venv (uv sync --only-group build --no-install-project -p 3.13uv sync --no-build-isolation -v --reinstall -p 3.13). Build now succeeds.
  • .venv/bin/pytest tests/fast/spark/ against the resulting debug install: 300 passed, 4 skipped, 1 xfailed, 0 failures.
  • After the .clangd change, opening any project .cpp file in VS Code with the clangd extension resolves all duckdb/... and duckdb_python/... includes without a manual symlink.

Related

Pairs with duckdb/duckdb#22551 — a parallel upstream fix for ~15 missing create_*_info.hpp includes inside the submodule that also break debug builds (dynamic_cast to forward-declared types in D_ASSERT). This PR fixes the package-side issues; duckdb/duckdb#22551 fixes the engine-side issues. Once duckdb/duckdb#22551 lands and the submodule pin is bumped, this PR completes the debug-build fix on its own.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant