Skip to content

RISC-V support #7781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DavidBurela opened this issue Nov 19, 2020 · 4 comments
Closed

RISC-V support #7781

DavidBurela opened this issue Nov 19, 2020 · 4 comments
Labels
kind/enhancement A net-new feature or improvement to an existing feature

Comments

@DavidBurela
Copy link

RISC-V CPUs are becoming a hot topic, especially in the conversation of decentralization + Open Hardware.
Ensuring that go-ipfs can compile for the target architecture would be a good enhancement to help with an open dweb.

Current status::
Because it has been written in Golang, it is already mostly CPU agnostic.
Go-ipfs almost compiles fine, however there is a bug in a dependency that has an issue.

$ env GOARCH=riscv64 make build
go version go1.15.5 linux/amd64
bin/check_go_version 1.14.4
plugin/loader/preload.sh > plugin/loader/preload.go
go fmt plugin/loader/preload.go >/dev/null
go build  "-asmflags=all='-trimpath='" "-gcflags=all='-trimpath='" -ldflags="-X "github.com/ipfs/go-ipfs".CurrentCommit=79a55305e" -o "cmd/ipfs/ipfs" "github.com/ipfs/go-ipfs/cmd/ipfs"
# github.com/prometheus/procfs
../../go/pkg/mod/github.com/prometheus/[email protected]/cpuinfo.go:71:9: undefined: parseCPUInfo
make: *** [cmd/ipfs/Rules.mk:22: cmd/ipfs/ipfs] Error 2

Fix:
This has already been addressed and fixed as a PR in the dependency prometheus/procfs#325
The go-ipfs repo builds and runs fine once the patch has been applied.

$ go mod edit -replace=github.com/prometheus/procfs=github.com/prometheus/procfs@910e685
$ env GOARCH=riscv64 make build
go version go1.15.5 linux/amd64
bin/check_go_version 1.14.4
plugin/loader/preload.sh > plugin/loader/preload.go
go fmt plugin/loader/preload.go >/dev/null
go build  "-asmflags=all='-trimpath='" "-gcflags=all='-trimpath='" -ldflags="-X "github.com/ipfs/go-ipfs".CurrentCommit=79a55305e-dirty" -o "cmd/ipfs/ipfs" "github.com/ipfs/go-ipfs/cmd/ipfs"

Next steps:
I created this issue to help others searching for a solution to compile it. Next steps would be to update and close this issue once the dependency has been upstreamed and updated through the dependency chain.

@DavidBurela DavidBurela added the kind/enhancement A net-new feature or improvement to an existing feature label Nov 19, 2020
@welcome
Copy link

welcome bot commented Nov 19, 2020

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@DavidBurela
Copy link
Author

I've written a short blog about getting it running on RISC-V
https://blog.davidburela.com/2020/11/16/ipfs-on-risc-v.html

@DavidBurela
Copy link
Author

DavidBurela commented Feb 20, 2021

Update: I tried on the latest go 1.15.8. However while the procfs patch has been merged into their latest releases. Upstream Go has not yet bumped their version.

@DavidBurela DavidBurela changed the title RISC-V compatability RISC-V support Feb 20, 2021
@DavidBurela
Copy link
Author

The patch was upstreamed to later versions of Go and is no longer the issue.
However, since then it seems a new TCP library has been added which is causing issues in #8398

I'll close this issue and continue in the new issues

@DavidBurela DavidBurela mentioned this issue Dec 6, 2021
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant