From e7bb6c3788a5e1a84f0b0dd3e5a2c8b30ede7973 Mon Sep 17 00:00:00 2001 From: ffgan Date: Sat, 3 Jan 2026 20:54:03 +0800 Subject: [PATCH] CI: Default build artifact for riscv64+musl on CICD.yml Co-authored by: nijincheng@iscas.ac.cn; Signed-off-by: ffgan --- .cargo/config.toml | 2 ++ .github/workflows/CICD.yml | 9 ++++++++- Cross.toml | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 364776950c7..803f6249978 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -6,6 +6,8 @@ linker = "x86_64-unknown-redox-gcc" [target.aarch64-unknown-linux-gnu] linker = "aarch64-linux-gnu-gcc" +[target.riscv64gc-unknown-linux-musl] +rustflags = ["-C", "target-feature=+crt-static"] [env] # See feat_external_libstdbuf in src/uu/stdbuf/Cargo.toml diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index e6a7fd4509e..67169f984ed 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -309,7 +309,7 @@ jobs: ./target/release-fast/true # Check that the progs have prefix test -f /tmp/usr/local/bin/uu-tty - test -f /tmp/usr/local/libexec/uu-coreutils/libstdbuf.* + test -f /tmp/usr/local/libexec/uu-coreutils/libstdbuf.* # Check that the manpage is not present ! test -f /tmp/usr/local/share/man/man1/uu-whoami.1 # Check that the completion is not present @@ -576,6 +576,7 @@ jobs: - { os: ubuntu-latest , target: arm-unknown-linux-gnueabihf , features: feat_os_unix_gnueabihf , use-cross: use-cross , skip-tests: true } - { os: ubuntu-24.04-arm , target: aarch64-unknown-linux-gnu , features: feat_os_unix_gnueabihf } - { os: ubuntu-latest , target: aarch64-unknown-linux-musl , features: feat_os_unix_musl , use-cross: use-cross , skip-tests: true } + - { os: ubuntu-latest , target: riscv64gc-unknown-linux-musl , features: feat_os_unix_musl , use-cross: use-cross , skip-tests: true } # - { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , features: feat_selinux , use-cross: use-cross } - { os: ubuntu-latest , target: i686-unknown-linux-gnu , features: "feat_os_unix,test_risky_names", use-cross: use-cross } - { os: ubuntu-latest , target: i686-unknown-linux-musl , features: feat_os_unix_musl , use-cross: use-cross } @@ -636,6 +637,7 @@ jobs: unset TARGET_ARCH case '${{ matrix.job.target }}' in aarch64-*) TARGET_ARCH=arm64 ;; + riscv64gc-*) TARGET_ARCH=riscv64 ;; arm-*-*hf) TARGET_ARCH=armhf ;; i686-*) TARGET_ARCH=i686 ;; x86_64-*) TARGET_ARCH=x86_64 ;; @@ -700,6 +702,7 @@ jobs: STRIP="strip" case ${{ matrix.job.target }} in aarch64-*-linux-*) STRIP="aarch64-linux-gnu-strip" ;; + riscv64gc-*-linux-*) STRIP="riscv64-linux-gnu-strip" ;; arm-*-linux-gnueabihf) STRIP="arm-linux-gnueabihf-strip" ;; *-pc-windows-msvc) STRIP="" ;; esac; @@ -726,6 +729,10 @@ jobs: sudo apt-get -y update sudo apt-get -y install gcc-aarch64-linux-gnu ;; + riscv64gc-unknown-linux-*) + sudo apt-get -y update + sudo apt-get -y install gcc-riscv64-linux-gnu + ;; *-redox*) sudo apt-get -y update sudo apt-get -y install fuse3 libfuse-dev diff --git a/Cross.toml b/Cross.toml index 52f5bad21dd..90d824e61aa 100644 --- a/Cross.toml +++ b/Cross.toml @@ -5,3 +5,6 @@ pre-build = [ ] [build.env] passthrough = ["CI", "RUST_BACKTRACE", "CARGO_TERM_COLOR"] + +[target.riscv64gc-unknown-linux-musl] +image = "ghcr.io/cross-rs/riscv64gc-unknown-linux-musl:main"