new(cockroachdb): distributed SQL with Pebble storage engine#13122
Open
tannevaled wants to merge 4 commits into
Open
new(cockroachdb): distributed SQL with Pebble storage engine#13122tannevaled wants to merge 4 commits into
tannevaled wants to merge 4 commits into
Conversation
Add recipe for cockroachdb/cockroach v26.x. CockroachDB is a Go-based
distributed SQL database that uses Pebble (a pure-Go RocksDB rewrite) as
its storage engine, avoiding the C++ rocksdb / cgo build complexity that
plagues TiKV.
Build path: since v23 cockroach moved fully to bazel; the legacy
`make buildoss` target no longer exists. The recipe builds the
`cockroach-short` bazel target via bazelisk, which excludes the
embedded JS web UI but produces a fully functional `cockroach` binary
(this is the maintainer-recommended "lean" build).
Notes:
- github source tarballs lack a .git dir; stub stamp.sh injects the
version into bazel's stable-status so the binary reports v{{version}}
- cross-references: Arch AUR PKGBUILD (v19, legacy make), nixpkgs
23.1 (gave up on source builds), and upstream docs/building.md.
cockroachdb does not publish GitHub releases; it only pushes git tags. The default github: <org>/<repo> resolves to .../releases/tags which returns an empty list, leading to "no versions parsed". Switch to .../tags so version resolution finds v26.2.1 and friends.
bazel's default sandbox masks /toolchain/gcc on the host, which pkgx's gcc wrapper script tries to exec at runtime, causing: gcc: line 25: /toolchain/gcc: No such file or directory Use --spawn_strategy=local to bypass the sandbox; the bazel build then runs against the same toolchain pantry already wired up. Same pattern is conceptually equivalent to starpls's --action_env hack but works when actual cgo compilation is needed (cockroach has jemalloc, geos and proj as c-deps).
bazel's --incompatible_strict_action_env (enabled in cockroach's .bazelrc) wipes HOME/PATH from spawned compile actions. pkgx's gcc wrapper at $HOME/toolchain/bin/gcc execs $HOME/toolchain/<tool>, so HOME=='' degrades to /toolchain/gcc and exits 127. Drop the HOME override (was clobbering pantry's prepared toolchain location), preserve the build shell's HOME/PATH and forward both to bazel via --action_env. Also use a 'EOSTAMP' heredoc with sed substitution so the stamp script does not expand $() at write time in the wrong shell context.
This was referenced May 31, 2026
Open
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.
Summary
Add a pantry recipe for cockroachdb/cockroach — a Go-based distributed
SQL database that uses Pebble (pure-Go RocksDB rewrite) as its storage
engine, sidestepping the C++ rocksdb / cgo build hell that complicates
alternatives such as TiKV.
cockroach-shortbazel target viabazelisk, which producesa fully functional
cockroachbinary without the embedded JS DB Console(the maintainer-recommended "lean" build, cf.
docs/building.md).USE_BAZEL_VERSIONto match the in-tree.bazelversion(7.6.0).stamp.shis injected to satisfy bazel'sworkspace_status_commandfrom a tarball checkout that has no.git/.Build notes
make buildosstarget referenced in older Arch AUR PKGBUILDsno longer exists in v23+ — the top-level
GNUmakefileis a thin wrapperaround
./dev(bazel).upstream binary tarballs — we choose the source-build path instead
(HARD RULE: no vendoring).
since v23), upstream
docs/building.md.Test plan
pkgx +github.com/cockroachdb/cockroach -- cockroach versionreports v26.2.1cockroach start-single-node --insecureboots a SQL listener🤖 Generated with Claude Code