GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore(ci): build the Rust client for every target by simonklee · Pull Request #66152 · anomalyco/opencode

chore(ci): build the Rust client for every target #66152

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.

Sign up for GitHub

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

Merged
thdxr merged 5 commits into dev from cli-rs-ci
Nov 27, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

chore(ci): build the Rust client for every target #66152

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
5 commits
Select commit Hold shift + click to select a range
a7fa524
chore(ci): check the Rust client
simonklee Nov 24, 2026
819929a
chore(ci): build and release the Rust client
simonklee Nov 24, 2026
1356285
chore(ci): check the Rust client on its own pull requests and on dev
simonklee Nov 24, 2026
1a1782d
ci
simonklee Nov 24, 2026
3d08751
fix(ci): run every Rust test crate when one fails
simonklee Nov 27, 2026
File filter
Filter by extension


Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

51 changes: 51 additions & 0 deletions 51 .github/workflows/check-cli-rs.yml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: check-cli-rs

# Checks packages/cli-rs, the Rust client, which check-test.yml leaves out. Pull requests run it only when they change
# the client. Its tests and check:drift also compare it with the TypeScript packages below, so a dev push that changes
# one runs it too: a TypeScript change that breaks the client shows on dev, not on other teams' pull requests.
on:
pull_request:
paths:
- packages/cli-rs/**
- .github/workflows/check-cli-rs.yml
push:
branches: [dev]
paths:
- packages/cli-rs/**
Comment thread

@opencodejr opencodejr Bot Nov 24, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

check:drift reruns generators and oracles that read TypeScript outside this package (@opencode/protocol, @opencode/plugin, @opencode/tui, the httpapi codegen), and the parity machines run the TypeScript TUI. A PR that only touches those packages can leave cli-rs's generated files or fixtures stale. With this filter neither that PR nor the push to dev runs the check, so the failure lands on the next unrelated cli-rs PR. Could you add those source paths, at least for push to dev?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
- packages/cli/src/**
- packages/client/**
- packages/plugin/**
- packages/protocol/**
- packages/schema/**
- packages/theme/**
- packages/tui/**
- packages/util/**
- bun.lock
- .github/workflows/check-cli-rs.yml
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
check:
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 45
defaults:
run:
working-directory: packages/cli-rs
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
# Bun and node_modules: the tests and check:drift run the TypeScript side they compare against.
- uses: ./.github/actions/setup-bun
# rustup reads rust-toolchain.toml; `bun run cargo` first fetches OpenTUI's native library from its release.
- run: rustup toolchain install
- run: bun run cargo fmt --check
- run: bun run cargo clippy --locked --workspace --all-targets -- -D warnings
# Every crate's tests, even after one fails, so one run shows every failure.
- run: bun run cargo test --locked --workspace --no-fail-fast
- run: bun run check:drift
Comment thread

@opencodejr opencodejr Bot Nov 24, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The comment says this step fails until the port PR lands. If this PR merges first, check-cli-rs fails on every cli-rs PR and on every matching dev push until then, and a check that is always red stops getting looked at. Could this PR merge after the port PR, or the step use continue-on-error: true until then?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
126 changes: 126 additions & 0 deletions 126 .github/workflows/release-cli-rs.yml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: cli-rs release

# Builds opencode-native, the Rust client in packages/cli-rs, natively on each runner below and keeps each archive as an
# artifact. A cli-rs-v<version> tag also publishes them as a GitHub release. It never becomes Latest: the monorepo's
# Latest release drives OpenCode's own update paths.
on:
push:
tags:
- "cli-rs-v*"
pull_request:
paths:
- .github/workflows/release-cli-rs.yml
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
# Zig links Linux against glibc 2.17, OpenTUI's floor. zig_sha is the archive's, from ziglang.org.
- runner: ubuntu-24.04
target: x86_64-unknown-linux-gnu
zig: x86_64-linux-gnu.2.17
zig_sha: 3581863e3cbcfd0fce0efc682ce7e9e93da96668a977791d356a26d2a7e9b17a
- runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
zig: aarch64-linux-gnu.2.17
zig_sha: a1546d5646eb184437918d6635ca6b762a0e889eac09cef720ee7a1ed3fe7795
- { runner: macos-15-intel, target: x86_64-apple-darwin }
- { runner: macos-15, target: aarch64-apple-darwin }
- { runner: windows-2025, target: x86_64-pc-windows-msvc, exe: .exe }
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
defaults:
run:
shell: bash
working-directory: packages/cli-rs
env:
OPENCODE_NATIVE_COMMIT: ${{ github.sha }}
CARGO_PROFILE_DIST_STRIP: symbols
MACOSX_DEPLOYMENT_TARGET: "13.0"
# No Visual C++ runtime to install beside the .exe.
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_RUSTFLAGS: -C target-feature=+crt-static
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version-file: package.json
# The version opencode-native --version prints: the tag's, or 0.0.0-<commit> for any other run.
- name: Version
run: |
version=0.0.0-$GITHUB_SHA
if [[ $GITHUB_REF == refs/tags/cli-rs-v* ]]; then version=${GITHUB_REF_NAME#cli-rs-v}; fi
echo "OPENCODE_VERSION=$version" >> "$GITHUB_ENV"
# Zig 0.17.1 as the C and C++ compiler and the linker. The wrapper drops flags zig rejects: cc's --target, and
# rustc's Cortex-A53 erratum fix on aarch64.
- if: matrix.zig
working-directory: ${{ runner.temp }}
run: |
file=zig-$(uname -m)-linux-0.17.1
curl -fsSL --retry 3 -o zig.tar.xz "https://ziglang.org/download/0.17.1/$file.tar.xz"
echo "${{ matrix.zig_sha }} zig.tar.xz" | sha256sum -c
tar -xJf zig.tar.xz
for tool in cc c++; do
cat > "zig-$tool" <<EOF
#!/bin/sh
for a; do shift; case \$a in --target=*|-Wl,--fix-cortex-a53-843419) ;; *) set -- "\$@" "\$a" ;; esac; done
exec "$PWD/$file/zig" $tool -target ${{ matrix.zig }} "\$@"
EOF
chmod +x "zig-$tool"
done
triple=$(tr a-z- A-Z_ <<< "${{ matrix.target }}")
{ echo "CARGO_TARGET_${triple}_LINKER=$PWD/zig-cc"; echo "CC_${triple,,}=$PWD/zig-cc"
echo "CXX_${triple,,}=$PWD/zig-c++"; echo "CXXSTDLIB_${triple,,}=c++"; } >> "$GITHUB_ENV"
# rustup reads rust-toolchain.toml; `bun run cargo` first fetches OpenTUI's native library from its release.
- run: rustup toolchain install
- run: bun run cargo build --locked --profile dist --bin opencode-native
- name: Check glibc 2.17 and no libstdc++
if: matrix.zig
run: "! readelf -dV target/dist/opencode-native | grep -E 'GLIBC_2\\.(1[89]|[2-9][0-9])|libstdc\\+\\+'"
- name: Package
run: |
name=opencode-native-$OPENCODE_VERSION-${{ matrix.target }}
mkdir -p "dist/$name"
cp "target/dist/opencode-native${{ matrix.exe }}" "dist/$name/"
# Our licence, and OpenTUI's licences (FFmpeg's among them) from its native release zip.
cp ../../LICENSE "dist/$name/"
cp -r .opentui/*/host/licenses "dist/$name/"
tar -C dist -czf "dist/$name.tar.gz" "$name"
ls -l "dist/$name" "dist/$name.tar.gz"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: opencode-native-${{ matrix.target }}
path: packages/cli-rs/dist/*.tar.gz
if-no-files-found: error
compression-level: 0

release:
needs: build
if: startsWith(github.ref, 'refs/tags/cli-rs-v')
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
pattern: opencode-native-*
merge-multiple: true
- name: Publish
env:
GH_TOKEN: ${{ github.token }}
run: |
sha256sum ./*.tar.gz > SHA256SUMS
gh release create "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --verify-tag --latest=false \
--title "opencode-native ${GITHUB_REF_NAME#cli-rs-v}" --notes "The Rust client (packages/cli-rs) at $GITHUB_SHA." \
./*.tar.gz SHA256SUMS
7 changes: 6 additions & 1 deletion 7 packages/cli-rs/AGENTS.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@ say "native"; crates, this directory, and `OPENCODE_RS_*` variables say "rs".

## Checks

Before merging, the whole package must pass:
CI (`.github/workflows/check-cli-rs.yml`) runs:

- `bun run cargo fmt --check`
- `bun run cargo clippy --locked --workspace --all-targets -- -D warnings`
- `bun run cargo test --locked --workspace --no-fail-fast`
- `bun run check:drift`

CI has no `opencode` binary, so a few tests that need one skip. Before merging, also run these locally:

- `OPENCODE_RS_REQUIRE_TS=1 bun run cargo test --locked --workspace --no-fail-fast`, with an `opencode` binary on
`PATH`. Then the TypeScript interop tests fail instead of skipping.
- `bun run parity:machines`

Each of `opencode-tui` and `opencode-ui` has one integration test binary, `tests/all/main.rs`, with one module per
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.