• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nats-io / nats-server / 13428056167 / 1
83%
main: 83%

Build:
DEFAULT BRANCH: main
Ran 20 Feb 2025 05:45AM UTC
Files 57
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Feb 2025 02:06AM UTC coverage: 85.525% (+0.004%) from 85.521%
13428056167.1

push

github

web-flow
Explicitly set go toolchain in goreleaser config (#6420)

## Details
We have reproducible binaries,
[rpms/debs](https://github.com/nats-io/nats-server/pull/6359) and
[archives](https://github.com/nats-io/nats-server/pull/6299).
And `goreleaser.yml` holds [all the
knobs](https://goreleaser.com/customization/builds/go/) that can be
tuned to build the binary.

The only thing that affects the build and is not defined in the
goreleaser config is the go toolchain version.
Currently, we set the version of the go toolchain that is used for
releases in Travis:

<https://github.com/nats-io/nats-server/blob/<a class=hub.com/nats-io/nats-server/commit/5e6017135b4b1d333b435ff55b720275a39bb7af">5e6017135/.travis.yml#L11-L12>

<https://github.com/nats-io/nats-server/blob/5e6017135b4b1d333b435ff55b720275a39bb7af/.travis.yml#L67>

I spent some time [trying to understand the behavior of go and toolchain
directives](https://alexbozhenko.github.io/posts/2024-12-19-understand-go-toolchain-directive-or-your-money-back/).
I think setting the toolchain used for releases in .goreleser.yml would
make it more explicit and future-proof.


With this change, any human or script who has `go>1.21.0` and goreleaser
installed can checkout the repo at any commit, run one command, and get
binaries that will be _exactly_ as if we were cutting a release on that
commit.

```
goreleaser build --snapshot --clean --single-target
```

Several places would benefit from not having to worry about keeping
toolchain and all the go build flags in sync:

* get-nats.io(already uses gorelaser, but toolchain used to build
depends on the build host):

<https://github.com/ConnectEverything/client-tools/blob/eba999ac9/build-nightlies.sh#L184-L188>
* <redacted> number of private repos

If we land this, we can update the above places to use `goreleaser
build`, thus making sure we use _exactly the same_ binary everywhere,
and forever forget about managing/updating go versions in other places
that need to build the binary

## Reprodu... (continued)

69113 of 80810 relevant lines covered (85.53%)

882966.0 hits per line

Source Files on job 13428056167.1
  • Tree
  • List 57
  • Changed 45
  • Source Changed 12
  • Coverage Changed 20
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 13428056167
  • cad5114b on github
  • Prev Job for on main (#13405581651.1)
  • Next Job for on main (#13450211566.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc