Skip to content

Build from source

Toolchain, pinned versions and build commands.

This page describes the pgetcd repository layout, the current root-module dependencies, release build commands, and verification suites. The current tree is untagged; the v0.1.0-rc2 candidate remains documented in Releases. To start a local development tenant after building, see Quick start.

Repository layout

PathResponsibility
cmd/pgetcdGateway binary entry point (--tenant-config, --version, and internal test modes)
internal/gateway, internal/watchetcd v3 gRPC service handlers, Watch session multiplexing, and bounded event delivery
internal/pgstore, internal/pgprobeCertified SQL publication pool, transaction boundaries, and PostgreSQL state probes
internal/tenant, internal/tenantservice, internal/transportTenant JSON validation, readiness lifecycle, and mTLS listeners
extension/pg_etcd.c, extension/pg_kvcoreC/PGXS PostgreSQL extension, revision/Txn engine, _tail_v2, and Lease background workers
versions.lock.json, go.mod, go.sumPinned upstream reference versions and Go module checksums
tests/, scripts/SQL suites, official client probes, Watch race tests, and historical gate checkers

Toolchain and pinned versions

The current root tree after the 2026-11-11 dependency refresh requires the following versions:

ComponentPinned versionNotes
Go1.27.4Static gateway compilation (CGO_ENABLED=0)
PostgreSQL18.6 (REL_18_6)Server headers (postgresql-server-dev-18) and pg_config for PGXS
etcd Go API and clientv3v3.7.3Uses standard google.golang.org/protobuf bindings
gRPC / protobufv1.85.0 / v1.36.12Upstream generated protobuf bindings are consumed directly; protoc is not required for builds
pgxv5.12.0PostgreSQL wire driver and connection pool
Supporting modulesgrpc-gateway v2.33.0; x/net v0.62.0; x/sync v0.25.0; x/sys v0.50.0; x/text v0.44.0The complete selected module graph is recorded in go.mod and go.sum
Reference servers (test only)etcd v3.6.15, v3.7.2; Kubernetes v1.36.4, v1.37.1Locked in versions.lock.json for differential and storage probes

The reference-server modules under tests/ keep these versions because they are compatibility inputs. They are separate from the root gateway module.

Build commands

Gateway (pgetcd)

Build a development binary for the local host:

go build -o .cache/docs-dev/pgetcd ./cmd/pgetcd

Build a reproducible static Linux binary (used for the v0.1.0-rc1 and v0.1.0-rc2 archives on amd64 and arm64):

CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags "-s -w" -o pgetcd ./cmd/pgetcd
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -trimpath -ldflags "-s -w" -o pgetcd ./cmd/pgetcd

PostgreSQL extension (pg_etcd)

Compile and install the C/PGXS extension against your target PostgreSQL 18 installation:

make -C extension PG_CONFIG=/path/to/postgresql/bin/pg_config
make -C extension PG_CONFIG=/path/to/postgresql/bin/pg_config install

This installs lib/pg_etcd.so, share/extension/pg_etcd.control, and share/extension/pg_etcd--0.1.0.sql. To build inside a clean Debian 13 container (postgres:18.6), install build-essential and postgresql-server-dev-18 first and run make -C extension. Note that binaries compiled on Debian 13 require glibc 2.38 or newer; compile directly on the target distribution when targeting EL8/EL9, Debian 12, or Ubuntu 22.04.

Verification commands

On 2026-11-11, the current untagged tree passed go build ./cmd/..., go test ./..., and go vet ./... on macOS arm64 with Go 1.27.4. The pgx refresh also required the legacy batch-error adapter to implement pgx.BatchResults.Tx(). This local check does not replace the Linux release checklist for a future candidate.

CommandScope
go build ./cmd/...Compile gateway and helper commands; passed on the current macOS arm64 tree on 2026-11-11
go vet ./...Static analysis across all non-isolated packages; passed on the current macOS arm64 tree on 2026-11-11
go test ./...Unit and package tests; passed on the current macOS arm64 tree on 2026-11-11
make -C extension PG_CONFIG=...Compile pg_etcd.so with zero warnings
python3 tests/sql/run-p1-native.pySpin up an isolated temporary PostgreSQL cluster and run the SQL ABI test suites
python3 tests/sql/run-p1-multidb.pyVerify 8-database Lease worker supervision and tenant isolation on a temporary cluster
Note

The repository also contains make p0-gate, make p1-gate, and make p2-gate targets that audit archived evidence from the 2026-10-08 frozen candidate, as well as P3 native/cgroup tests isolated behind -tags pgetcd_p3. For v0.1.0-rcN, follow the lean release regression checklist described in Status.

Scan to open this page
https://mimus.pgsty.com/docs/etcd/operations/build/