Skip to content

Update Spacemit toolchain download URL and centralize versioning - #3618

Merged
csukuangfj merged 2 commits into
k2-fsa:masterfrom
spacemit-com:update-gcc-toolchain-url
May 15, 2026
Merged

csukuangfj merged 2 commits into
k2-fsa:masterfrom
spacemit-com:update-gcc-toolchain-url

Conversation

@alex-spacemit

@alex-spacemit alex-spacemit commented May 15, 2026 •

Copy link
Copy Markdown
Contributor

https://github.com/spacemit-com/sherpa-onnx/actions/runs/25903004405 checked

Summary by CodeRabbit

  • Chores
    • Updated RISC-V64 Linux build toolchain source to use GitHub releases with configurable version management for improved consistency across build pipelines.

Review Change Stack

Copilot AI and others added 2 commits May 14, 2026 12:02
Agent-Logs-Url: https://github.com/spacemit-com/sherpa-onnx/sessions/eb998fb7-04c9-4c67-a2a5-b140725573d9

Co-authored-by: alex-spacemit <213897846+alex-spacemit@users.noreply.github.com>
…url-again

Update Spacemit toolchain source and centralize versioning
Copilot AI review requested due to automatic review settings May 15, 2026 10:16
@coderabbitai

coderabbitai Bot commented May 15, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The PR parameterizes the Spacemit RISC-V64 toolchain version and migrates the download source from archive.spacemit.com to GitHub releases. A single environment variable controls the toolchain version across the workflow caching logic and build script configuration.

Changes

Spacemit Toolchain Version Parameterization

Layer / File(s) Summary
Workflow toolchain version and caching
.github/workflows/riscv64-spacemit-linux.yaml
Job-level SPACEMIT_TOOLCHAIN_VERSION environment variable is defined, cache keys are generated from that version, and the download step computes the archive filename and GitHub releases URL dynamically, then extracts to $GITHUB_WORKSPACE/toolchain with --strip-components 1.
Build script toolchain configuration
build-riscv64-linux-gnu-spacemit.sh
Build script variables are updated to construct SPACEMIT_TOOLCHAIN from the version, use the GitHub releases host (spacemit-com/toolchain), and download the corresponding .tar.xz archive instead of the previous archive.spacemit.com source.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

size:XS

Suggested reviewers

  • csukuangfj

Poem

🐰 A toolchain version comes into play,
GitHub releases light the way,
Parameters flow through scripts so clear,
Cache keys dance with no more fear,
Spacemit builds run bright and new! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main changes: updating the Spacemit toolchain download URL (from archive.spacemit.com to GitHub releases) and centralizing versioning (moving toolchain version to job-level env variable).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Spacemit RISC-V toolchain download source from archive.spacemit.com to the GitHub Releases mirror at github.com/spacemit-com/toolchain, and centralizes the toolchain version into a single variable in both the build script and the CI workflow.

Changes:

  • Introduce SPACEMIT_TOOLCHAIN_VERSION variable in build-riscv64-linux-gnu-spacemit.sh and use it to compose the toolchain archive name and URL.
  • Switch download URL from archive.spacemit.com to the GitHub Releases location.
  • Mirror the same version variable in the CI workflow via job-level env, and reuse it in the cache key, download, and extract steps.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
build-riscv64-linux-gnu-spacemit.sh Adds SPACEMIT_TOOLCHAIN_VERSION and updates URL/filename to use the GitHub Releases mirror; download file name now correctly ends in .tar.xz.
.github/workflows/riscv64-spacemit-linux.yaml Adds job-level SPACEMIT_TOOLCHAIN_VERSION env, parameterizes the cache key and the wget/tar commands accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label May 15, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@build-riscv64-linux-gnu-spacemit.sh`:
- Around line 4-7: The script currently unconditionally sets
SPACEMIT_TOOLCHAIN_VERSION to v1.1.2; change the assignment so it only uses that
default when the environment hasn't provided a value (use shell parameter
expansion on SPACEMIT_TOOLCHAIN_VERSION). Keep the subsequent variables
SPACEMIT_TOOLCHAIN, DOWNLOAD_URL, and DOWNLOAD_FILE intact so they derive from
SPACEMIT_TOOLCHAIN_VERSION; this lets CI or callers override
SPACEMIT_TOOLCHAIN_VERSION externally while preserving the default.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 92686363-5fdc-4b5d-bae9-82c5552b5c99

📥 Commits

Reviewing files that changed from the base of the PR and between c910efa and cf80ddd.

📒 Files selected for processing (2)
  • .github/workflows/riscv64-spacemit-linux.yaml
  • build-riscv64-linux-gnu-spacemit.sh

Comment on lines +4 to +7
SPACEMIT_TOOLCHAIN_VERSION=v1.1.2
SPACEMIT_TOOLCHAIN=spacemit-toolchain-linux-glibc-x86_64-${SPACEMIT_TOOLCHAIN_VERSION}
DOWNLOAD_URL="https://github.com/spacemit-com/toolchain/releases/download/${SPACEMIT_TOOLCHAIN_VERSION}/${SPACEMIT_TOOLCHAIN}.tar.xz"
DOWNLOAD_FILE="./${SPACEMIT_TOOLCHAIN}.tar.xz"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== build script header =="
sed -n '1,12p' build-riscv64-linux-gnu-spacemit.sh

echo
echo "== all version declarations in reviewed files =="
rg -n 'SPACEMIT_TOOLCHAIN_VERSION' \
  .github/workflows/riscv64-spacemit-linux.yaml \
  build-riscv64-linux-gnu-spacemit.sh

Repository: k2-fsa/sherpa-onnx

Length of output: 1680


🏁 Script executed:

rg -n 'SPACEMIT_TOOLCHAIN_VERSION' --type-list | head -20

Repository: k2-fsa/sherpa-onnx

Length of output: 452


🏁 Script executed:

fd -type f -name '*.sh' -o -name '*.yaml' -o -name '*.yml' | xargs rg -l 'build-riscv64-linux-gnu-spacemit' 2>/dev/null || echo "No files found calling this script"

Repository: k2-fsa/sherpa-onnx

Length of output: 286


🏁 Script executed:

rg -n 'build-riscv64-linux-gnu-spacemit\.sh' --type-list

Repository: k2-fsa/sherpa-onnx

Length of output: 452


🏁 Script executed:

grep -r "build-riscv64-linux-gnu-spacemit" . --include="*.md" --include="*.txt" 2>/dev/null | head -20

Repository: k2-fsa/sherpa-onnx

Length of output: 44


🏁 Script executed:

rg "build-riscv64-linux-gnu-spacemit" . 2>/dev/null

Repository: k2-fsa/sherpa-onnx

Length of output: 44


Honor externally provided toolchain version instead of overriding it.

Line 4 currently forces v1.1.2, preventing environment-based customization. Wrap the assignment with parameter expansion to apply the default only when the variable is unset:

-SPACEMIT_TOOLCHAIN_VERSION=v1.1.2
+SPACEMIT_TOOLCHAIN_VERSION="${SPACEMIT_TOOLCHAIN_VERSION:-v1.1.2}"

This preserves the default behavior while allowing CI or other external callers to override the version without script modification.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
SPACEMIT_TOOLCHAIN_VERSION=v1.1.2
SPACEMIT_TOOLCHAIN=spacemit-toolchain-linux-glibc-x86_64-${SPACEMIT_TOOLCHAIN_VERSION}
DOWNLOAD_URL="https://github.com/spacemit-com/toolchain/releases/download/${SPACEMIT_TOOLCHAIN_VERSION}/${SPACEMIT_TOOLCHAIN}.tar.xz"
DOWNLOAD_FILE="./${SPACEMIT_TOOLCHAIN}.tar.xz"
SPACEMIT_TOOLCHAIN_VERSION="${SPACEMIT_TOOLCHAIN_VERSION:-v1.1.2}"
SPACEMIT_TOOLCHAIN=spacemit-toolchain-linux-glibc-x86_64-${SPACEMIT_TOOLCHAIN_VERSION}
DOWNLOAD_URL="https://github.com/spacemit-com/toolchain/releases/download/${SPACEMIT_TOOLCHAIN_VERSION}/${SPACEMIT_TOOLCHAIN}.tar.xz"
DOWNLOAD_FILE="./${SPACEMIT_TOOLCHAIN}.tar.xz"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@build-riscv64-linux-gnu-spacemit.sh` around lines 4 - 7, The script currently
unconditionally sets SPACEMIT_TOOLCHAIN_VERSION to v1.1.2; change the assignment
so it only uses that default when the environment hasn't provided a value (use
shell parameter expansion on SPACEMIT_TOOLCHAIN_VERSION). Keep the subsequent
variables SPACEMIT_TOOLCHAIN, DOWNLOAD_URL, and DOWNLOAD_FILE intact so they
derive from SPACEMIT_TOOLCHAIN_VERSION; this lets CI or callers override
SPACEMIT_TOOLCHAIN_VERSION externally while preserving the default.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the build-riscv64-linux-gnu-spacemit.sh script to download the Spacemit toolchain from GitHub instead of the archive site. It also introduces a version variable for better maintainability and updates the local download filename to match the source archive. I have no feedback to provide.

@csukuangfj csukuangfj left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!

@csukuangfj
csukuangfj merged commit dfcf7df into k2-fsa:master May 15, 2026
4 of 5 checks passed
Prithwis-2023 added a commit to Prithwis-2023/sherpa-onnx that referenced this pull request May 17, 2026
Update Spacemit toolchain download URL (k2-fsa#3618)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants