Skip to content

fix hex package build outside a git checkout (#17) - #19

Merged
benoitc merged 1 commit into
masterfrom
fix-hex-package-build
Jul 25, 2026
Merged

benoitc merged 1 commit into
masterfrom
fix-hex-package-build

Conversation

@benoitc

@benoitc benoitc commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #17.

The git submodule update --init --recursive compile pre_hook ran unconditionally, so it died with fatal: not a git repository on a hex tarball and aborted the build. The hook is unnecessary: the only submodules are snappy's googletest and benchmark, and build-snappy.cmake disables both.

The second part of the report is fixed too. When find_package(Snappy) fails, SNAPPY_INCLUDE_DIR keeps its SNAPPY_INCLUDE_DIR-NOTFOUND value and was still used as an include directory, so cmake failed the generate step on hosts without system snappy. Include dirs and link libs are now collected from the _FOUND variables, which also cover the bundled builds. lz4 had the same bug, and zstd with -DWITH_BUNDLE_ZSTD=OFF.

Neither failure was visible in CI, which always checks out with submodules: recursive and forces WITH_BUNDLE_LZ4/SNAPPY=ON. A new package job builds a git-less tree with no bundled overrides and no system snappy/lz4 installed.

The `git submodule update --init --recursive` compile pre_hook ran
unconditionally and aborted the build on a hex tarball, which is not a
git checkout. The hook is not needed: the only submodules are snappy's
googletest and benchmark, and build-snappy.cmake disables both.

Also stop passing unresolved compression paths to the generator. When
find_package fails, SNAPPY_INCLUDE_DIR keeps its `-NOTFOUND` value and
was still used as an include directory, so cmake failed the generate
step on hosts without system snappy. Include dirs and link libs are now
collected from the `_FOUND` variables, which cover the bundled builds
too. Same fix for lz4 and zstd.

Add a CI job that builds a git-less tree with no bundled overrides, so
neither failure can come back unnoticed.
@benoitc
benoitc merged commit 7d8b027 into master Jul 25, 2026
9 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.

Hex package 3.1.1 fails to build: pre_hook 'git submodule update' dies outside a git checkout

1 participant