#233·witr

[Feature]: Support the LoongArch (龙芯) architecture

Author: xuxiaowei-com-cnCreated Sep 1, 2026Updated Sep 1, 2026
Labelsenhancement

Is your feature request related to a problem?

Yes. witr currently only publishes release binaries for amd64 and arm64 (.goreleaser.yml), and both the install script and the manual download instructions reject LoongArch machines:

$ curl -fsSL https://raw.githubusercontent.com/pranshuparmar/witr/main/install.sh | bash
Unsupported architecture: loongarch64

LoongArch (loong64) is a mature, widely deployed architecture in China (Loongson 龙芯 3A5000/3A6000 and newer) and is supported by mainstream distributions such as Loongnix, Deepin, UOS, Kylin, Arch Linux, Fedora and the Debian loong64 port. Users on these machines cannot install witr from the official release assets.

Describe the solution you'd like

Add Linux/LoongArch support end to end:

  • Releases: add linux_loong64 to the GoReleaser build targets so release binaries (and the deb/rpm/apk packages) are published for LoongArch.
  • Install script: detect loongarch64/loong64 in install.sh and download witr-linux-loong64.
  • CI: cross-compile linux/loong64 in the smoke tests and lint the linux/loong64 build in the PR checks so regressions are caught.
  • Docs: document loong64 in the README platform matrix, manual install steps, the Nix flake systems and the contributor cross-compile checklist.

Additional context

  • The Go toolchain has supported GOOS=linux GOARCH=loong64 since Go 1.19; witr already requires Go 1.25, so no toolchain change is needed.
  • witr's per-platform Go files are selected by GOOS (*_linux.go), so the linux/loong64 build reuses the existing Linux code path unchanged.
  • Verified locally: GOOS=linux GOARCH=loong64 CGO_ENABLED=0 go build ./cmd/witr produces a valid statically-linked LoongArch ELF binary.
  • GitHub-hosted runners are x86_64/arm64, so the CI check cross-compiles and inspects the artifact instead of executing it.