Skip to content

feat: add slim binary release variant - #858

Open
apstndb wants to merge 3 commits into
issue-778-goreleaser-scaffoldfrom
feat/issue-778-slim-binary-workplan
Open

feat: add slim binary release variant#858
apstndb wants to merge 3 commits into
issue-778-goreleaser-scaffoldfrom
feat/issue-778-slim-binary-workplan

Conversation

@apstndb

@apstndb apstndb commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • add cmd/spanner-mycli-slim, a second main package that registers no optional features
  • keep the root binary as the full variant with GEMINI/LLM, BigQuery, and CQL
  • publish distinct full and slim GoReleaser builds and archives
  • test full/slim statement registration and document source/release builds
  • document a reproducible controlled relative-size comparison

This uses separate main packages rather than build tags, so ordinary go test ./..., vet, and lint continue to compile both variants. It is stacked on the GoReleaser scaffold cleanup in #789.

The primary rationale is least capability: users who do not need the optional statement families can choose a binary that does not link their client and protocol dependencies. This narrows the shipped process's optional runtime surface. It does not reduce the repository's go.mod, source, CI, or dependency-maintenance surface, and it is not a security or vulnerability-free guarantee.

Size evidence

Built as a controlled relative comparison with the same Go toolchain and target, CGO_ENABLED=0, -trimpath, and -s -w. These are not claims of byte identity with GoReleaser archives:

Target Full Slim Reduction
darwin/arm64 58,887,538 bytes 50,564,274 bytes 8,323,264 bytes (14.13%)
linux/amd64 60,424,352 bytes 51,798,176 bytes 8,626,176 bytes (14.28%)

Validation

  • goreleaser check --config .goreleaser.yaml
  • full and slim runtime surface checks
  • version and installation-source ldflags checks for both binaries
  • controlled full/slim builds for darwin/arm64 and linux/amd64
  • go test -short ./...
  • make check with golangci-lint v2.13.2
  • git diff --check issue-778-goreleaser-scaffold...HEAD

Follow-ups

Registration-time mutation-policy enforcement and feature-package completion construction are separate seam-contract gaps and are not required to link the slim binary. They remain separate follow-ups rather than expanding this release-artifact change.

Depends on #789.

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown

Code Metrics Report

📊 View detailed coverage report (available for 7 days)

main (b7c135d) #858 (29d185e) +/-
Coverage 74.0% 74.0% -0.1%
Code to Test Ratio 1:1.3 1:1.3 +0.0
Test Execution Time 1m42s 1m43s +1s
Details
  |                     | main (b7c135d) | #858 (29d185e) |  +/-  |
  |---------------------|----------------|----------------|-------|
- | Coverage            |          74.0% |          74.0% | -0.1% |
  |   Files             |             94 |             95 |    +1 |
  |   Lines             |           8093 |           8096 |    +3 |
  |   Covered           |           5993 |           5993 |     0 |
+ | Code to Test Ratio  |          1:1.3 |          1:1.3 |  +0.0 |
  |   Code              |          18876 |          18885 |    +9 |
+ |   Test              |          26133 |          26180 |   +47 |
- | Test Execution Time |          1m42s |          1m43s |   +1s |

Code coverage of files in pull request scope (88.5% → 87.5%)

Files Coverage +/- Status
cmd/spanner-mycli-slim/main.go 50.0% +50.0% affected
internal/mycli/memefish_parser.go 76.9% -23.1% affected
internal/mycli/statement_processing.go 91.3% +1.2% affected
internal/mycli/statements_split_points.go 84.6% -1.0% affected
main.go 50.0% +50.0% modified

Reported by octocov

Describe the full-versus-slim build as a relative-size check with
identical CGO, stripping, and target settings, not as byte-identical
GoReleaser output. Use feature-specific flags/system variables so
BigQuery omissions are not under-described.
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.

1 participant