uutils / uutils/coreutils

feat: add support for riscv64

Open
#9,691 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

Hi there.

Recently, riscv64 (rv64) has gained widespread adoption, with distributions like Fedora, Debian, and Ubuntu all announcing support for rv64. I noticed that we haven't yet released pre-built artifacts for rv64, so I'm raising this PR.

1. Upstream Dependency Status

For one of our upstream dependencies, sccache, I've already submitted a PR to support rv64, which has been merged and is awaiting release. I haven't yet identified any other upstreams that would require rv64 support and block our CI. If there are any, please @ me directly—I'm happy to continue contributing rv64 support directly to upstream projects.

2. CI Action Runners

Currently, GitHub Actions does not yet support rv64 runners. However, RISE provides a method to run rv64 runners in GitHub Actions. Details can be found here.

In short, the link provides a way to run self-hosted rv64 action runners. After simple registration, we can use rv64 runners to execute our CI.

Regarding this runner, I have a few additional points to note:

  1. I am not the maintainer/administrator of this runner
  2. I strongly recommend reading the documentation thoroughly
  3. The default approved runner seems to have only a 90-day lifespan, but if this repository decides to adopt the runner long-term, you can contact the runner maintainers directly—they'll be happy to modify this setting and provide relevant support
  4. The runner runs inside a container with Ubuntu 24.04 as the OS and glibc version 2.39

I applied for a runner in my own fork and conducted simple tests, which showed everything working well.

3. Testing Notes

Below, I'll briefly introduce my testing steps, environment, and results.

To simplify the rv64 scenario, I extracted build separately from .github/workflows/CICD.yml and placed it in .github/workflows/riscv64.yml. This file only builds for riscv64. The Milk-V Pioneer Box inside is the tag label of the approved runner. It doesn't necessarily have to be this one—it depends on the tag registered for your approved runner. Mine specifically is shown below:

Image

Since sccache hasn't been released yet, I've temporarily disabled sccache here.

Building coreutils went smoothly. However, during testing, some tests failed on rv64. Since I'm not very familiar with Rust, I chose to ignore these tests. The specific modifications can be viewed in the last two commits of feat/riscv64.

After completing these modifications, I ran the CI in my own fork, and the results showed everything went smoothly. Details can be found here.

4. Testing/Developing coreutils on riscv64

If maintainers don't currently have rv64 hardware on hand, this might help. However, I'd recommend contacting the maintainers there directly after reading the documentation and expressing that coreutils wants to add rv64 support—I believe they'll be very willing to assist coreutils.

5. Summary

Overall, I believe we can easily add rv64 support to coreutils. Since I think more thorough discussion will be more conducive to PR merging, I haven't submitted it yet. Once we reach more consensus, I'll raise the PR as soon as possible.

That's all. If there are any questions, please @ me directly. I'm happy to answer all questions.


Other Info
Co-authored by: nijincheng@iscas.ac.cn;

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.

Research direction

Start with .github/workflows/CICD.yml and compare it with the contributor's .github/workflows/riscv64.yml. Review the failed riscv64 tests and the modifications in the last two commits of the feat/riscv64 branch, then verify the sccache release and available runner setup. Done means riscv64 artifacts build and the relevant CI completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, rust
Domain
build-system, ci-cd, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.