From b2d232a52edba517b84b861ffff8b7ad18a3a3c5 Mon Sep 17 00:00:00 2001 From: kako-jun <3541096+kako-jun@users.noreply.github.com> Date: Thu, 17 Sep 2026 10:46:58 +0900 Subject: [PATCH 1/2] =?UTF-8?q?ci:=20=E3=83=AA=E3=83=AA=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E3=83=90=E3=82=A4=E3=83=8A=E3=83=AA=E3=81=AE=20glibc=20floor?= =?UTF-8?q?=20=E3=82=92=202.31=20=E3=81=AB=E5=9B=BA=E5=AE=9A=20(#18)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit release.yml と ci.yml の build-riscv を apt の gcc-riscv64-linux-gnu クロス ツールチェーンから cargo-zigbuild ベースのビルドに置き換え、 riscv64gc-unknown-linux-gnu.2.31 を明示指定してランナー image の glibc に 依存しないようにした。ビルド直後に objdump で GLIBC_2.31 超のシンボルが 無いことを機械検証し、ci.yml の build-riscv にも upload-artifact を追加して PR 段階で実機スモークできるようにした。 --- .github/workflows/ci.yml | 32 ++++++++++++++++++++------------ .github/workflows/release.yml | 27 ++++++++++++++------------- CHANGELOG.md | 3 +++ README.ja.md | 2 ++ README.md | 2 ++ README.zh-CN.md | 2 ++ 6 files changed, 43 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9465406..c3fa0cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,18 +79,26 @@ jobs: with: targets: riscv64gc-unknown-linux-gnu - - name: Install cross-compilation toolchain + - name: Install zig + uses: mlugg/setup-zig@v2 + + - name: Install cargo-zigbuild + run: cargo install cargo-zigbuild --locked + + - name: Build for RISC-V (glibc 2.31 floor) + run: cargo zigbuild --release --target riscv64gc-unknown-linux-gnu.2.31 --package riscfetch + + - name: Verify glibc floor run: | sudo apt-get update - sudo apt-get install -y gcc-riscv64-linux-gnu + sudo apt-get install -y binutils-riscv64-linux-gnu + max=$(riscv64-linux-gnu-objdump -T target/riscv64gc-unknown-linux-gnu/release/riscfetch | grep -o 'GLIBC_[0-9.]*' | sort -uV | tail -1) + echo "max glibc symbol: $max" + test "$(printf 'GLIBC_2.31\n%s\n' "$max" | sort -V | tail -1)" = "GLIBC_2.31" - - name: Configure cargo for cross-compilation - run: | - mkdir -p .cargo - cat >> .cargo/config.toml << 'EOF' - [target.riscv64gc-unknown-linux-gnu] - linker = "riscv64-linux-gnu-gcc" - EOF - - - name: Build for RISC-V - run: cargo build --workspace --target riscv64gc-unknown-linux-gnu + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: riscfetch-linux-riscv64 + path: target/riscv64gc-unknown-linux-gnu/release/riscfetch + if-no-files-found: error diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fcdaa3c..5e580d6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,21 +27,22 @@ jobs: with: targets: riscv64gc-unknown-linux-gnu - - name: Install cross-compilation toolchain - run: | - sudo apt-get update - sudo apt-get install -y gcc-riscv64-linux-gnu + - name: Install zig + uses: mlugg/setup-zig@v2 - - name: Configure cargo for cross-compilation - run: | - mkdir -p .cargo - cat >> .cargo/config.toml << 'EOF' - [target.riscv64gc-unknown-linux-gnu] - linker = "riscv64-linux-gnu-gcc" - EOF + - name: Install cargo-zigbuild + run: cargo install cargo-zigbuild --locked - - name: Build for RISC-V - run: cargo build --release --target riscv64gc-unknown-linux-gnu --package riscfetch + - name: Build for RISC-V (glibc 2.31 floor) + run: cargo zigbuild --release --target riscv64gc-unknown-linux-gnu.2.31 --package riscfetch + + - name: Verify glibc floor + run: | + sudo apt-get update + sudo apt-get install -y binutils-riscv64-linux-gnu + max=$(riscv64-linux-gnu-objdump -T target/riscv64gc-unknown-linux-gnu/release/riscfetch | grep -o 'GLIBC_[0-9.]*' | sort -uV | tail -1) + echo "max glibc symbol: $max" + test "$(printf 'GLIBC_2.31\n%s\n' "$max" | sort -V | tail -1)" = "GLIBC_2.31" - name: Package artifact run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d22b90..f1616f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ All notable changes to this project will be documented in this file. - Extension count: 147 → 151 (103 Z + 48 S) - Detection keywords reorganized into 3 explicit tiers (SoC identifiers → board names → vendor names) so a board name shipped across multiple SoC generations resolves to the correct SoC vendor instead of a stale one (e.g. DeepComputing DC-ROMA shipped on StarFive JH7110, then SpacemiT K3 silicon; Milk-V/Banana Pi/Sipeed ship both SpacemiT K1 and K3 boards). 5 new SoC-identifier keywords added (`spacemit,k1`, `spacemit,k3`, `sg2044`, `sg2380`, `sun20i`); detection keyword count: 42 → 47 +### Fixed +- Prebuilt riscv64 binary now targets glibc 2.31 (built with cargo-zigbuild); v2.3.1's binary required glibc 2.39 and failed on Ubuntu 22.04 boards (#18) + ## [2.3.1] - 2026-04-27 ### Fixed diff --git a/README.ja.md b/README.ja.md index a256db7..fde7108 100644 --- a/README.ja.md +++ b/README.ja.md @@ -46,6 +46,8 @@ chmod +x riscfetch-linux-riscv64 sudo mv riscfetch-linux-riscv64 /usr/local/bin/riscfetch ``` +glibc 2.31 以上が必要です。 + ## 使い方 ```bash diff --git a/README.md b/README.md index c9a278d..76a3bcd 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,8 @@ chmod +x riscfetch-linux-riscv64 sudo mv riscfetch-linux-riscv64 /usr/local/bin/riscfetch ``` +Requires glibc >= 2.31. + ## Usage ```bash diff --git a/README.zh-CN.md b/README.zh-CN.md index ee8fd88..8b3fb7c 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -46,6 +46,8 @@ chmod +x riscfetch-linux-riscv64 sudo mv riscfetch-linux-riscv64 /usr/local/bin/riscfetch ``` +需要 glibc >= 2.31。 + ## 使用方法 ```bash From 0fd982a77ea9f08140a69d89a799fc5c0989b94d Mon Sep 17 00:00:00 2001 From: kako-jun <3541096+kako-jun@users.noreply.github.com> Date: Thu, 17 Sep 2026 10:56:18 +0900 Subject: [PATCH 2/2] =?UTF-8?q?ci:=20zig=200.16.0=20=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=E3=83=BBpipefail=20=E6=98=8E=E7=A4=BA=E3=83=BBCHANGELOG=20?= =?UTF-8?q?=E3=82=92=202.4.0=20=E3=81=AB=E7=B5=B1=E5=90=88=20(#18)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit レビュー指摘を反映: - mlugg/setup-zig@v2 に version: 0.16.0 を明示(CI実測ログで取得されていたバージョン) - glibc floor 検証ステップの run: | 冒頭に set -euo pipefail を明示 - Build for RISC-V ステップ直前に zig の非致命的警告に関する注記コメントを追加 - リベースにより CHANGELOG.md の [Unreleased] を削除し、[2.4.0] - 2026-09-17 の Added/Changed の後ろに Fixed セクションとして統合(#17 のバージョン更新と競合しないように) Verification: - floor 比較式 `test "$(printf 'GLIBC_2.31\n%s\n' "$max" | sort -V | tail -1)" = "GLIBC_2.31"` を ローカル bash で実行して確認: max=GLIBC_2.35(floor超過)は非0終了、max=GLIBC_2.30(floor未満)は0終了。 floor 違反時に検証が確実に落ちることを確認した。 - 手元の dist-ci/riscfetch(cargo-zigbuild ビルド済み riscv64 バイナリ)に対し `strings dist-ci/riscfetch | grep -o 'GLIBC_[0-9.]*' | sort -uV | tail -1` を実行し、 実測最大シンボルは GLIBC_2.30(floor 2.31 を満たす)と確認した(Mac に riscv64 用 objdump が無いため strings で代替)。 --- .github/workflows/ci.yml | 4 ++++ .github/workflows/release.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3fa0cf..294975b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,15 +81,19 @@ jobs: - name: Install zig uses: mlugg/setup-zig@v2 + with: + version: 0.16.0 - name: Install cargo-zigbuild run: cargo install cargo-zigbuild --locked + # zig may print "ignoring deprecated linker optimization setting" — harmless, build still succeeds - name: Build for RISC-V (glibc 2.31 floor) run: cargo zigbuild --release --target riscv64gc-unknown-linux-gnu.2.31 --package riscfetch - name: Verify glibc floor run: | + set -euo pipefail sudo apt-get update sudo apt-get install -y binutils-riscv64-linux-gnu max=$(riscv64-linux-gnu-objdump -T target/riscv64gc-unknown-linux-gnu/release/riscfetch | grep -o 'GLIBC_[0-9.]*' | sort -uV | tail -1) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5e580d6..5ca2390 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,15 +29,19 @@ jobs: - name: Install zig uses: mlugg/setup-zig@v2 + with: + version: 0.16.0 - name: Install cargo-zigbuild run: cargo install cargo-zigbuild --locked + # zig may print "ignoring deprecated linker optimization setting" — harmless, build still succeeds - name: Build for RISC-V (glibc 2.31 floor) run: cargo zigbuild --release --target riscv64gc-unknown-linux-gnu.2.31 --package riscfetch - name: Verify glibc floor run: | + set -euo pipefail sudo apt-get update sudo apt-get install -y binutils-riscv64-linux-gnu max=$(riscv64-linux-gnu-objdump -T target/riscv64gc-unknown-linux-gnu/release/riscfetch | grep -o 'GLIBC_[0-9.]*' | sort -uV | tail -1)