build: use CRoaring amalgamation sources - #2556
Conversation
|
/label status/waiting-for-review |
|
Automated pull request review completed. Review effort: Submitted 2 inline comments. |
Merge Protections🟢 All 2 merge protections satisfied — ready to merge. Show 2 satisfied protections🟢 Require kind label
🟢 Require version label
|
9bfea01 to
da90bac
Compare
LHT129
left a comment
There was a problem hiding this comment.
This is a well-executed build-system improvement that reduces CRoaring dependency download size by ~98.8% (from ~100 MB to ~1.2 MB) by switching from the full source archive to the three official amalgamation assets.
Summary of changes:
extern/roaringbitmap/roaringbitmap.cmake: ReplacedFetchContentwith manualfile(DOWNLOAD)for the three amalgamation files (roaring.c,roaring.h,roaring.hh), with SHA-256 verification and deterministic caching. Manually creates theroaringtarget with matching upstream properties (C11, SOVERSION, AVX disable, etc.).cmake/VSAGOptions.cmake: UpdatedDOWNLOAD_DIRdocstring to reflect broader usage beyondExternalProject.docs/: Updated both English and Chinese offline-build guides to document the CRoaring-specific override behavior (directory/base URL instead of single archive).
What I checked:
- Correctness: The amalgamation files are verified with pinned SHA-256 hashes. The download function handles cached, mirrored, local, and upstream fallback paths correctly. The
roaringtarget properties match upstream behavior. - Security:
TLS_VERIFY ONis set. Hashes are pinned. No command injection vectors. - Compatibility:
vsag_roaring_headersnow points to the amalgamation root directory (whereroaring.handroaring.hhlive), which is correct for the single-file layout. Theroaring-headers/roaring-headers-cppINTERFACE targets are retained for upstream name compatibility. - Documentation: Both EN and ZH guides accurately describe the new override behavior.
One minor note (posted as inline comment): The roaring target does not set POSITION_INDEPENDENT_CODE. This is fine for the shared-library path, but static-library consumers embedding VSAG in a shared library may benefit from adding it. Non-blocking.
Overall this PR is in good shape. The existing inline discussion about the INTERFACE targets has been resolved with an explanatory comment.
vsag-bot
left a comment
There was a problem hiding this comment.
Automated inline review completed.
Review effort: medium (190 changed lines across 4 files).
Submitted 2 inline comments.
Reviewed commit da90bac.
da90bac to
61341fa
Compare
61341fa to
9a9f237
Compare
vsag-bot
left a comment
There was a problem hiding this comment.
Automated inline review completed.
Review effort: medium (208 changed lines across 4 files).
Submitted 2 inline comments.
Reviewed commit 9a9f237.
Signed-off-by: Xiangyu Wang <wxy407827@antgroup.com> Assisted-by: OpenAI Codex:gpt-5
9a9f237 to
c3a9079
Compare
LHT129
left a comment
There was a problem hiding this comment.
This iteration looks clean. All previously raised issues have been addressed:
- The
roaring-headers/roaring-headers-cppinterface targets are retained with a comment documenting the compatibility purpose. - The
EXPECTED_HASHfatal-error-on-first-URL issue has been resolved by switching to manual SHA-256 verification with multi-URL fallback. - The
download_logis now emitted atVERBOSElevel for all download attempts. - The AVX/AVX512 disable definitions are now
PRIVATEon the amalgamationroaringtarget. - Archive-form override compatibility is preserved with the
roaringbitmap_archive_overridedetection branch. - Documentation correctly scopes the new directory/base-URL form to
mainand notes the archive-only form for release lines.
No new issues found in this push.
Change Type
Linked Issue
Not applicable: this is a
kind/improvementdependency-download optimization.What Changed
(
roaring.c,roaring.h, androaring.hh) instead of the full sourcearchive.
hashes and retain deterministic
DOWNLOAD_DIRcaching.MD5 while keeping normal builds on the smaller standalone assets.
roaringtarget while preserving VSAG's include,link, AVX-disable, PIC/static/shared, warning, and install/export behavior.
offline-build guides.
The observed dependency transfer falls from 100,717,067 bytes for the former
v3.0.1 source archive to 1,232,827 bytes for the three official release assets:
99,484,240 fewer bytes (98.775950%, or 81.696x smaller).
Test Evidence
make fmtmake lintmake testmake cov, run tests, and collect coverageTest details:
The clean download cache contains only the three expected assets and no
CRoaring archive. Their exact sizes and SHA-256 hashes match the official
v3.0.1 release metadata.
Compatibility Impact
roaringtarget and<roaring.hh>API, and the standalone assets contain the complete v3.0.1implementation and C++ wrapper.
rather than one large archive; explicit legacy archive overrides remain
supported.
Performance and Concurrency Impact
runtime behavior is unchanged.
Documentation Impact
README.mdDEVELOPMENT.mdCONTRIBUTING.mdRisk and Rollback
upstream amalgamation; Linux GCC, sanitizer, shared/static, AVX-disabled, and
older-CMake paths were exercised, and existing macOS CI provides the dynamic
AppleClang check.
integration.
Checklist
kind/improvement)build integration is covered by the clean configure/build evidence above)
optional
[skip ci]prefix)