Skip to content

Add riscv64 to GoReleaser build matrix and Docker images - #295

Open
rajeshgangam wants to merge 2 commits into
charmbracelet:mainfrom
rajeshgangam:add-riscv64
Open

Add riscv64 to GoReleaser build matrix and Docker images#295
rajeshgangam wants to merge 2 commits into
charmbracelet:mainfrom
rajeshgangam:add-riscv64

Conversation

@rajeshgangam

Copy link
Copy Markdown

Summary

  • Add riscv64 to goarch in all goreleaser configs
  • Add ignore rules for unsupported OS/arch combinations (darwin/riscv64, windows/riscv64, etc.)
  • Add linux/riscv64 Docker platform builds and include riscv64 images in multi-arch Docker manifests

Go cross-compiles to linux/riscv64 natively with CGO_ENABLED=0, so no toolchain changes are needed.

Verified on native riscv64 hardware (BananaPi F3, SpacemiT K1) by @gounthar in #283 — gum, vhs, and glow all build and run without source changes.

Configs updated

Config Binary Docker
goreleaser-full.yaml
goreleaser.yaml
goreleaser-simple.yaml
goreleaser-glow.yaml
goreleaser-semi.yaml
goreleaser-sequin.yaml
goreleaser-soft-serve.yaml
goreleaser-vhs.yaml

Fixes #283

Add riscv64 to goarch in all goreleaser configs with appropriate
ignore rules for unsupported OS/arch combinations (darwin, windows,
and where applicable freebsd and other BSDs).

For configs with Docker support, add linux/riscv64 platform builds
and include riscv64 images in all multi-arch Docker manifests.

Go cross-compiles to linux/riscv64 natively with CGO_ENABLED=0.
Verified: gum, vhs, and glow all build and run on riscv64 hardware.

Fixes charmbracelet#283
@gounthar

Copy link
Copy Markdown

Thanks for picking this up, @rajeshgangam.

One thing I noticed while reading through: in goreleaser-glow.yaml, goreleaser-semi.yaml, and goreleaser-soft-serve.yaml, the riscv64 dockers: build entry got added twice. The two blocks are identical, both producing ...:v{{ .Version }}-riscv64 on --platform=linux/riscv64. The other configs (goreleaser-full.yaml, goreleaser-vhs.yaml, goreleaser.yaml) only declare it once, which matches how amd64/arm64/armv7 are each declared a single time.

Removing the second riscv64 block in those three files should do it. Otherwise goreleaser ends up building and pushing the same tag twice during a release, and goreleaser check won't flag it since the schema is still valid.

The rest reads well to me: the per-file ignore rules line up with each config's goos list, and the manifest entries cover both docker.io and ghcr.io.

Once you've pushed a fix, I'm happy to test the resulting linux/riscv64 binaries and Docker images on a BananaPi F3. I have one here, so I can confirm gum/vhs/glow actually run.

The riscv64 Docker block was accidentally added twice in
goreleaser-glow.yaml, goreleaser-semi.yaml, and
goreleaser-soft-serve.yaml. Remove the duplicates.
@rajeshgangam

Copy link
Copy Markdown
Author

Thanks for catching that! Removed the duplicate riscv64 Docker entries from all three files.

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.

Add riscv64 to GoReleaser build matrix

2 participants