Skip to content

fix(build): pin croaring, nlohmann_json, spdlog, cpr, sqlpp23 fetches - #1082

Merged
wgtmac merged 1 commit into
apache:mainfrom
gty404:fix/pin-fetchcontent-hashes
Nov 5, 2026
Merged

wgtmac merged 1 commit into
apache:mainfrom
gty404:fix/pin-fetchcontent-hashes

Conversation

@gty404

@gty404 gty404 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Five FetchContent downloads in cmake_modules/IcebergThirdpartyToolchain.cmake (croaring, nlohmann_json, spdlog, cpr, sqlpp23) had no integrity pin, unlike Arrow, nanoarrow, and utf8proc in the same file.
  • nlohmann_json gets a URL_HASH (its tarball is a stable uploaded release asset, same pattern as Arrow/nanoarrow/utf8proc).
  • The other four (croaring, spdlog, cpr, sqlpp23) use GitHub's auto-generated tag-archive endpoint (archive/refs/tags/*.tar.gz), which is not byte-stable across requests — the same tag download returned different checksums across repeated requests, so it can't be pinned with URL_HASH. These switch to GIT_REPOSITORY + GIT_TAG pinned to the tag's full commit SHA, the same pattern already used in this file for Avro, googletest, and google_benchmark.
  • Mirror overrides (ICEBERG_*_URL env vars) are still honored.

@gty404
gty404 force-pushed the fix/pin-fetchcontent-hashes branch from 6de16db to 41435ca Compare November 2, 2026 11:11
These FetchContent downloads had no integrity pin, unlike Arrow,
nanoarrow, and utf8proc in the same file, so a tampered archive or
mirror would be compiled unverified. nlohmann_json keeps a URL_HASH
(its tarball is a stable uploaded release asset). The other four use
GitHub's auto-generated tag-archive endpoint, which is not byte-stable
across requests and cannot be hash-pinned reliably (confirmed: the
same tag download returned different checksums on different
requests), so they switch to GIT_REPOSITORY + GIT_TAG pinned to the
tag's full commit SHA, the same pattern already used here for Avro,
googletest, and google_benchmark.
@gty404
gty404 force-pushed the fix/pin-fetchcontent-hashes branch from 41435ca to c9c507d Compare November 2, 2026 11:49
@gty404 gty404 changed the title fix(build): pin SHA256 hashes for FetchContent dependency downloads fix(build): pin croaring, nlohmann_json, spdlog, cpr, sqlpp23 fetches Nov 2, 2026
set(ENABLE_ROARING_TESTS OFF)
set(ENABLE_ROARING_MICROBENCHMARKS OFF)

# GitHub's auto-generated tag-archive tarball is not byte-stable across

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's wired, do we have this problem in our gh actions? I can't reproduce this locally, Could you explain how you got this issue?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hit it in this PR's own CI, not hypothetical: https://github.com/apache/iceberg-cpp/actions/runs/41434821884/job/125242025243 — the v4.7.1 tarball failed URL_HASH 6 times in a row with 6 different checksums, then Each download failed!.

Reproduced manually too: fetched https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v4.7.1.tar.gz 3x plus once via codeload.github.com directly — 4 different SHA256 each time, none matching what I'd pinned. GitHub's tag-archive endpoint just isn't byte-stable across requests; only uploaded release assets (like nlohmann_json's) are.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the details.

@wgtmac

wgtmac commented Nov 5, 2026

Copy link
Copy Markdown
Member

Thanks @gty404 for fixing this and @zhjwpku for the review!

@wgtmac
wgtmac merged commit 44a4e98 into apache:main Nov 5, 2026
14 checks passed
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.

3 participants