Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the build system by disabling tests, examples, tools, and Python bindings by default, while introducing a new ENABLE_MOCKIMPL option and a dev make target for full developer builds. Feedback indicates that changing the default for VSAG_ENABLE_TESTS causes a regression in the cov target, which now requires explicit test enablement. Additionally, it is recommended to explicitly disable AddressSanitizer in the test target to ensure consistency and avoid potential CMake cache persistence issues.
There was a problem hiding this comment.
Pull request overview
This PR slims the default CMake/Makefile build configuration by disabling optional components (tests, examples, tools, Python bindings, and mockimpl) by default, while adding an explicit make dev target to restore the prior “full developer” build behavior.
Changes:
- Default build flags in
Makefileandcmake/VSAGOptions.cmakenow default optional components toOFF. - Added
ENABLE_MOCKIMPLand gatedmockimpl/inclusion behind it. - Added
make devand updated test/sanitizer/distribution build paths to explicitly enable the components they require. - Updated
DEVELOPMENT.mdto document new default build behavior and options.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Makefile | Changes default build toggles to OFF, adds dev, and updates test/sanitizer/dist targets to opt-in to tests/mockimpl explicitly. |
| DEVELOPMENT.md | Documents the new default-minimal make debug, the new make dev, and lists key CMake toggles (including ENABLE_MOCKIMPL). |
| CMakeLists.txt | Gates mockimpl/ subdirectory on ENABLE_MOCKIMPL (and not Apple). |
| cmake/VSAGOptions.cmake | Updates default option values for examples/tests and introduces ENABLE_MOCKIMPL. |
Comments suppressed due to low confidence (1)
Makefile:67
make testconfigures the build directory via-B${DEBUG_BUILD_DIR}, but the test execution commands are hard-coded to./build/.... IfDEBUG_BUILD_DIRis overridden (or ifbuild/contains stale binaries), this target can run the wrong executables or fail. Please switch the invoked paths to${DEBUG_BUILD_DIR}/tests/...and${DEBUG_BUILD_DIR}/mockimpl/...to match the configured build directory.
cmake ${VSAG_CMAKE_ARGS} -B${DEBUG_BUILD_DIR} -DCMAKE_BUILD_TYPE=Debug -DENABLE_CCACHE=ON -DENABLE_TESTS=ON -DENABLE_MOCKIMPL=ON
cmake --build ${DEBUG_BUILD_DIR} --parallel ${COMPILE_JOBS}
./build/tests/unittests -d yes ${UT_FILTER} --allow-running-no-tests ${UT_SHARD}
./build/tests/functests -d yes ${UT_FILTER} --allow-running-no-tests ${UT_SHARD}
./build/mockimpl/tests_mockimpl -d yes ${UT_FILTER} --allow-running-no-tests ${UT_SHARD}
ee55286 to
707176a
Compare
707176a to
3afd66f
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
Makefile:110
lintandfix-lintare declared with.PHONEYinstead of.PHONY, so make will not treat them as phony targets. This can cause these targets to be skipped if a file namedlintorfix-lintexists. Rename.PHONEYto.PHONYfor both targets.
.PHONEY: lint
lint: ## Check coding styles defined in `.clang-tidy`.
@./scripts/linters/run-clang-tidy-15.sh -p build-release/ -use-color -source-filter '^.*vsag\/src.*(?<!_test)\.cpp$$' -j ${COMPILE_JOBS}
.PHONEY: fix-lint
Signed-off-by: Xiangyu Wang <[email protected]>
3afd66f to
567fd6a
Compare
Change Type
Linked Issue
What Changed
make debugbuild by disabling tests, examples, tools, Python bindings, andmockimplby default.117to42using the same CMake help-based counting rule, for a reduction of75targets.ENABLE_MOCKIMPLto makemockimplan explicit opt-in build component.make devto preserve the previous full developer build with tests, examples, tools, Python bindings, andmockimplenabled.make test,make cov, sanitizer, and distribution test paths to explicitly enable the targets they require.Catch2in slim default builds unlessENABLE_TESTS=ON.DEVELOPMENT.mdto document the new default build behavior and build options.Test Evidence
make fmtmake lintmake testmake cov, run tests, and collect coverageTest details:
Compatibility Impact
mockimplnow require explicit enablement or themake devtarget.Performance and Concurrency Impact
Documentation Impact
README.mdDEVELOPMENT.mdCONTRIBUTING.mdRisk and Rollback
707176afto restore the previous default build configuration and removemake dev/ENABLE_MOCKIMPL.Checklist
[skip ci]prefix)