Skip to content
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

riscv64 build possible? #655

Closed
AutisticShark opened this issue Nov 27, 2024 · 5 comments
Closed

riscv64 build possible? #655

AutisticShark opened this issue Nov 27, 2024 · 5 comments

Comments

@AutisticShark
Copy link
Contributor

AutisticShark commented Nov 27, 2024

Has anyone successfully compiled clash-rs on the riscv64 arch yet? I am not familiar with Rust lang, could it be as simple as adding a compile option to the GitHub action, or require a code change?

I knew there are a lot of Golang solutions out there that can be easily cross-compiled for riscv64, but they are 1. massive binary size and 2. quite slow on current riscv64 hardware since nothing is accelerated and everything needs to be done in software.

Thanks.

@ibigbug
Copy link
Member

ibigbug commented Nov 28, 2024

You can try it out and get some ideas from here https://github.com/Watfaq/clash-rs/blob/master/.github/workflows/ci.yml

Usually it doesn't require code change however might need extra build environment setup

@AutisticShark
Copy link
Contributor Author

AutisticShark commented Nov 28, 2024

I experimented with it on my fork, it failed because of the ring package

error: failed to run custom build command for `ring v0.16.20`
Caused by:
  process didn't exit successfully: `/target/debug/build/ring-3775fb799412049a/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ring-0.16.20/build.rs:358:10:
  called `Option::unwrap()` on a `None` value
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
Error: The process '/home/runner/.cargo/bin/cross' failed with exit code 101

It looks like the dependency needs to be updated to at least version 0.17 to work on every target based on this issue.

@ibigbug
Copy link
Member

ibigbug commented Nov 28, 2024

you can try to disable "onion" feature https://github.com/Watfaq/clash-rs/blob/master/.github/workflows/ci.yml#L126

0.16 is only required for tor clients

@AutisticShark
Copy link
Contributor Author

AutisticShark commented Nov 28, 2024

It works! Here is the action log https://github.com/AutisticShark/clash-rs/actions/runs/12063872112/job/33639758426, maybe consider adding this to the release CI so other users with RISC-V hardware can also help test clash-rs?

@ibigbug
Copy link
Member

ibigbug commented Nov 28, 2024

You can put a PR if you want since you already have it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants