🐛 RISCV64 Compilation not supported

Open Beginner friendly
#1,348 0 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
go
Domain
build-system

Research direction

Start at the architecture selection in Makefile around line 78 and review the reported riscv64 branch. Run the documented RISC-V setup and make cloudflared; done means the build completes and produces a working cloudflared binary on riscv64.

Written by the indexing model from the issue text.

Description

Priority: Normal Type: Bug

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.

Dominant language
Go
Stars
15.8k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cloudflare/cloudflared

All issues in cloudflare/cloudflared

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.