Ci/codeql manual build - #7
Draft
asonje wants to merge 4 commits into
Draft
Conversation
The svs extension only compiles against PostgreSQL, SVS and pgvector headers, so build-mode: none left CodeQL extracting src/*.c with no postgres.h, no SVS C API and no pgvector vector.h -- macros, typedefs and struct layouts all unresolved. Switch c-cpp to build-mode: manual and build the extension under the tracer with the environment the build guide already documents: docs/build_guide/config supplies PG_CONFIG and SVS_INSTALL_DIR, which are passed to make as the Makefile expects. The three dependency builds (install_postgres.sh, build_svs.sh, build_pgvector_vanilla.sh) run before codeql-action/init so the tracer wraps only this repository's make; running them afterwards would extract PostgreSQL and the SVS C++ library into the database as well. Their output is cached on the build scripts' hash, since a cold build of PostgreSQL 18 plus the SVS library dominates the job. Signed-off-by: Olasoji <olasoji.denloye@intel.com>
Signed-off-by: Olasoji <olasoji.denloye@intel.com>
asonje
force-pushed
the
ci/codeql-manual-build
branch
from
August 13, 2026 21:50
c2517b0 to
657c06d
Compare
The CodeQL job failed in build_svs.sh with
'MemoryBreakdown' in namespace 'svs::index::vamana' does not name a type
With SVS_RUNTIME_ENABLE_LVQ_LEANVEC=ON, bindings/c fetches a prebuilt SVS
archive and compiles against that archive's headers rather than the
adjacent include/. Outside GCC [11.2, 11.3) -- every Ubuntu runner -- the
archive it picks is the v0.4.0 release, whose headers predate
MemoryBreakdown, while bindings/c on dev/c-api calls
get_memory_breakdown().
Pinning SVS_URL does not help here: the only published archive carrying
the type is the LTO variant, and bindings/c links svs::svs_static_library,
whose LTO bytecode requires GCC 11.2 exactly. Building from the SVS source
tree instead compiles against local headers that match the bindings, with
no download and no ABI pin.
This costs the analysis nothing. The flag is a PRIVATE compile definition
of the svs_c_api target, and the installed C API header has no LVQ/LeanVec
ifdefs, so the symbols svs_wrapper.c uses stay declared and the extension
compiles identically. Only runtime lvq/leanvec index creation is affected,
and the job never loads the library. Revert to ON once SVS is fixed.
SVS_LVQ_LEANVEC is a config knob defaulting to ON, so local builds are
unchanged; the workflow overrides it and folds the value into the cache
key. build_svs.sh now wipes the build directory first, because SVS_URL is
a CACHE STRING and the fetched tree persists in _deps/svs-src, which would
otherwise pin the previous setting and make the change look inert.
Signed-off-by: Olasoji <olasoji.denloye@intel.com>
SVS_INSTALL defaulted to svs_install_public and the guard's error told you to run build_svs_public.sh. Neither exists anywhere in the repository, so a bare 'make' failed and its advice was a dead end. Point both at what the build guide actually produces, and correct the same stale default quoted in docs/dev/ARCHITECTURE.md. build_pgvector_vanilla.sh and build_svs_extension.sh were committed mode 644 while their four siblings are 755, so the ./script invocations in docs/build_guide/README.md failed with Permission denied. build_all.sh was unaffected -- it calls them via bash. Signed-off-by: Olasoji <olasoji.denloye@intel.com>
asonje
marked this pull request as draft
August 24, 2026 21:05
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.
Description
Use CodeQL manual build mode for c-cpp
Related Issues
Type of Change
Pre-Merge Checklist
Build
makecompletes without errors or warningsmake installcompletes successfullyTests
make installcheck) and TAP tests (test/t/) pass with no failurestest/sql/and/ortest/t/Documentation
docs/updated if architecture or usage changedTesting Notes