Fix editable/debug build after StructVector API change and vector header split#451
Open
aaron-ang wants to merge 2 commits intoduckdb:mainfrom
Open
Fix editable/debug build after StructVector API change and vector header split#451aaron-ang wants to merge 2 commits intoduckdb:mainfrom
aaron-ang wants to merge 2 commits intoduckdb:mainfrom
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.
2 tasks
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.
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.
Summary
Three small fixes to make the editable / debug build (the one configured with
DISABLE_UNITY = "1"inpyproject.toml, used when running the steps inCLAUDE.md) work end-to-end:StructVector::GetEntriesnow returnsvector<Vector> &instead ofvector<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')).ListVector/ArrayVector/StructVector/MapVectorwere moved into their own headers underduckdb/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')..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.).cibuildwheel(CI release path) uses the default unity-enabledReleaseconfig 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
*struct_children[i]/*children[i]at the twoStructVector::GetEntriescall sites.#includefor the four vector headers in the three files that reference those types..clangdCompilationDatabasefrombuild/clangdtobuild/debugso it matches the actual editable build directory.Test plan
CLAUDE.mdtwo-step editable build on a fresh.venv(uv sync --only-group build --no-install-project -p 3.13→uv 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..clangdchange, opening any project.cppfile in VS Code with the clangd extension resolves allduckdb/...andduckdb_python/...includes without a manual symlink.Related
Pairs with duckdb/duckdb#22551 — a parallel upstream fix for ~15 missing
create_*_info.hppincludes inside the submodule that also break debug builds (dynamic_castto forward-declared types inD_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.