Skip to content

Commit 7236995

Browse files
bpmctclaude
andcommitted
feat: add RISC-V architecture support
This commit adds support for building Coder on RISC-V architecture: - Added linux_riscv64 to OS_ARCHES for regular builds - Added linux_riscv64 to ARCHIVE_TAR_GZ for archive creation - Added linux_riscv64 to PACKAGE_OS_ARCHES for packages - Added riscv64 to DOCKER_ARCHES for Docker images - Created new make targets: - build-slim-riscv64: Builds only the slim RISC-V binary - build-fat-riscv64: Builds only the fat RISC-V binary - build-riscv64: Builds both slim and fat RISC-V binaries 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5285c12 commit 7236995

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

Makefile

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,22 @@ GIT_FLAGS = GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_SYSTEM=/dev/null
6262

6363
# All ${OS}_${ARCH} combos we build for. Windows binaries have the .exe suffix.
6464
OS_ARCHES := \
65-
linux_amd64 linux_arm64 linux_armv7 \
65+
linux_amd64 linux_arm64 linux_armv7 linux_riscv64 \
6666
darwin_amd64 darwin_arm64 \
6767
windows_amd64.exe windows_arm64.exe
6868

6969
# Archive formats and their corresponding ${OS}_${ARCH} combos.
70-
ARCHIVE_TAR_GZ := linux_amd64 linux_arm64 linux_armv7
70+
ARCHIVE_TAR_GZ := linux_amd64 linux_arm64 linux_armv7 linux_riscv64
7171
ARCHIVE_ZIP := \
7272
darwin_amd64 darwin_arm64 \
7373
windows_amd64 windows_arm64
7474

7575
# All package formats we build and the ${OS}_${ARCH} combos we build them for.
7676
PACKAGE_FORMATS := apk deb rpm
77-
PACKAGE_OS_ARCHES := linux_amd64 linux_armv7 linux_arm64
77+
PACKAGE_OS_ARCHES := linux_amd64 linux_armv7 linux_arm64 linux_riscv64
7878

7979
# All architectures we build Docker images for (Linux only).
80-
DOCKER_ARCHES := amd64 arm64 armv7
80+
DOCKER_ARCHES := amd64 arm64 armv7 riscv64
8181

8282
# All ${OS}_${ARCH} combos we build the desktop dylib for.
8383
DYLIB_ARCHES := darwin_amd64 darwin_arm64
@@ -123,9 +123,26 @@ clean:
123123
build-slim: $(CODER_SLIM_BINARIES)
124124
.PHONY: build-slim
125125

126+
build-slim-riscv64:
127+
mkdir -p build site/out/bin
128+
GOOS=linux GOARCH=riscv64 go build -o build/coder-slim_linux_riscv64 -tags slim,ts_omit_aws,ts_omit_bird,ts_omit_tap,ts_omit_kube ./enterprise/cmd/coder
129+
rm -f build/coder-slim_$(VERSION)_linux_riscv64
130+
ln -sf build/coder-slim_linux_riscv64 build/coder-slim_$(VERSION)_linux_riscv64
131+
.PHONY: build-slim-riscv64
132+
126133
build-fat build-full build: $(CODER_FAT_BINARIES)
127134
.PHONY: build-fat build-full build
128135

136+
build-fat-riscv64:
137+
mkdir -p build site/out/bin
138+
GOOS=linux GOARCH=riscv64 go build -o build/coder_linux_riscv64 -tags embed,ts_omit_aws,ts_omit_bird,ts_omit_tap,ts_omit_kube ./enterprise/cmd/coder
139+
rm -f build/coder_$(VERSION)_linux_riscv64
140+
ln -sf build/coder_linux_riscv64 build/coder_$(VERSION)_linux_riscv64
141+
.PHONY: build-fat-riscv64
142+
143+
build-riscv64: build-slim-riscv64 build-fat-riscv64
144+
.PHONY: build-riscv64
145+
129146
release: $(CODER_FAT_BINARIES) $(CODER_ALL_ARCHIVES) $(CODER_ALL_PACKAGES) $(CODER_ARCH_IMAGES) build/coder_helm_$(VERSION).tgz
130147
.PHONY: release
131148

0 commit comments

Comments
 (0)