cloudflare / cloudflare/cloudflared

🐛 RISCV64 Compilation not supported

Open
#1,348 0 comments 6 reactions 0 assignees View on GitHub
Priority: Normal Type: Bug
Dominant language
Go
Stars
15.6k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
RISC-V compilation is not supported, even though a minor change can unblock it. So, I'd make it a bug report, rather than a feature request.

**To Reproduce**
Steps to reproduce the behavior:
1. Download the official Golang toolchain for RISC-V
2. Set `GOROOT_BOOTSTRAP` to this go toolchain, e.g., `$HOME/go`
3. Manually execute the commands in https://github.com/cloudflare/cloudflared/blob/master/.teamcity/install-cloudflare-go.sh
4. Clone this repo
5. Set `GOPATH` to the compiled cloudflare-flavored go, e.g., `/tmp/go`
6. Run `make cloudflared`
7. Then we get an error `This system's architecture riscv64 isn't supported` from here https://github.com/cloudflare/cloudflared/blob/1f3e3045adba24d855eb8287e521a089909345cb/Makefile#L78

**Expected behavior**
Compiling from source for RISC-V machines is supported.

**Environment and versions**
- OS: Linux Debian
- Architecture: riscv64
- Version: master at 1f3e304

**Simple Fix**

I just appended two lines

```
else ifeq ($(LOCAL_ARCH),riscv64)
TARGET_ARCH ?= riscv64
```

Then everything went smoothly and the compiled `cloudflared` worked great.

If you are willing to accept a PR, I can make one in no time.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.