Skip to content

Commit 8216db1

Browse files
matt2eclaude
andauthored
chore(toolchain): bump Rust to 1.98.1 for macOS 27 proc-macro loading (#8598)
## Summary Bump the pinned Rust toolchain from 1.95.0 to 1.98.1 so release builds work on macOS 27 hosts. Rust ≤ 1.97 strips Apple-target artifacts with its bundled `llvm-objcopy`, which leaves the Mach-O `LC_SYMTAB` string pool (`__LINKEDIT`) only 4-byte aligned. macOS 27's dyld refuses to `dlopen` such images (`mis-aligned LINKEDIT string pool`). Because cargo applies the release profile's default `strip = "debuginfo"` to proc-macro dylibs too, `cargo build --release` of any crate that uses sqlx macros (`buzz-db`, `buzz-relay`, `buzz-admin`, …) fails on macOS 27: rustc cannot load `libsqlx_macros-*.dylib`. Dev builds pass because the dev profile does not strip, which is why this only shows up as a release/packaging failure. The fix (llvm/llvm-project#203680, pulled into rustc by rust-lang/rust#158410 for rust-lang/rust#157750) first shipped in Rust 1.98.0 and was never backported to 1.97.x. `block/buzz-app` pinned 1.98.1 for the same failure in block/buzz-app#529. With this bump the `CARGO_PROFILE_RELEASE_BUILD_OVERRIDE_STRIP=none` / custom-linker workarounds people have been using locally are no longer needed. ### What changes Two commits: the toolchain bump (with the desktop clippy fixes), then the workspace clippy fixes. | Location | Change | |---|---| | `rust-toolchain.toml` | `channel = "1.95.0"` → `"1.98.1"` (profile unchanged) | | `Dockerfile`, `Dockerfile.push-gateway` | `ARG RUST_VERSION=1.95` → `1.98` | | `Dockerfile.sprig` | `rust:1.98-alpine3.22` with the manifest-list digest verified on Docker Hub (shared by the `1.98` and `1.98.1` tags) | | `.github/workflows/release.yml` | `dtolnay/rust-toolchain` pinned to the tip of its `1.98.1` branch (`18f04874`) for the Windows desktop release job | | `benchmarks/harbor-buzz-orchestra` | `RUST_IMAGE = rust:1.98-alpine` | | `_ci-rust.yml`, `windows-canary.yml`, `app_state_tests.rs` | stale "1.95" comments reworded; the `unknown_lints` allow stays with a version-agnostic rationale | | `desktop/src-tauri` | lints clippy 1.98 newly raises under `-D warnings`: `chunks_exact_to_as_chunks` at five fixed-width PCM/UTF-16 decoders, `needless_borrows_for_generic_args` on the `Copy` `norm` closure in `config_bridge/reader.rs`, and a redundant `Engine as _` import in `hpke_key_backup_tests.rs` that `use super::*` already provides | | Workspace crates (9) | the 30 lints clippy 1.98 newly raises in `cargo clippy --workspace --all-targets -- -D warnings`, listed below | Workspace lint fixes: | Lint | Sites | Fix | |---|---|---| | `result_large_err` (20) | `buzz-relay` `api/git/transport.rs` (8), `api/git/settings.rs` (6), `api/gifs.rs`, `api/workflows.rs`, `api/profiles.rs`; `buzz-push-gateway` `verify_installation_assertion` | Clippy 1.98 now checks `async fn`s, so every `async fn … -> Result<_, axum::response::Response>` trips it. These follow the existing allow pattern in `api/media.rs` and `nip_fi_http.rs` ("Response is the natural error type for axum handlers"): module-level in the two git files, per-function elsewhere. Boxing `Response` would touch every handler for no runtime benefit. | | `chunks_exact_to_as_chunks` (3) | `buzz-media` MP4 brand scan; `buzz-voice` npy f32 reader and stereo test fixture | `chunks_exact(N)` → `as_chunks::<N>().0` | | `question_mark` (3) | `buzz-acp` queue flush fallback and slash-command mention skip; `buzz-agent` `find_git_root` | `match … { None => return None }` → `?` | | `useless_format` (2) | `buzz-auth` nip_fi startup test policies | `format!("…")` → `"…".to_string()` | | `useless_borrows_in_formatting` (1) | `buzz-pairing-cli` secret print | drop the borrow | | `manual_noop_waker` (1) | `buzz-sdk` broker test `block_on` | `Waker::noop()` (stable since 1.85) | All `as_chunks` rewrites keep `chunks_exact`'s remainder-dropping semantics, and `as_chunks` is stable since 1.88, which is the MSRV. One change in `api/git/transport.rs` is not a lint fix. Staging that file trips the pre-commit secret scanner on its existing test-only ES256 fixture (`GIT_TEST_EC_PEM`), and the scanner only honours a suppression marker on the flagged line. So the `\`-continued string literal is rewritten as a byte-identical `concat!` whose `BEGIN` line carries `sadscan:disable kingfisher.privkey.2`. Left as is on purpose: `Cargo.toml` `rust-version = "1.88.0"` (MSRV floor, a separate concern), the README/CONTRIBUTING "1.88+" text, Hermit (no Rust packages there), the lockfiles, and the `(1.95.0)` comment in `scripts/start-isolated-test-relay.sh` (the pre-commit secret scanner flags that file's pre-existing dev-only `DATABASE_URL` whenever it is staged). ### Related issue Fixes #8074 ### Testing All under rustc/clippy 1.98.1 on a macOS 27 host (Darwin 27.0.0, aarch64), with no `RUSTFLAGS` / `SDKROOT` / strip overrides in the environment: - `cargo build --release -p buzz-db` (the #8074 repro: the release profile strips the proc-macro dylib): **builds**. The resulting `libsqlx_macros-*.dylib` (14 MB) has `LC_SYMTAB stroff % 8 == 0` per `otool -l`. The same build on 1.95.0 died with `mis-aligned LINKEDIT string pool`. - `just clippy` (workspace, `-D warnings`) and `cargo fmt --check` (workspace and `desktop/src-tauri`): pass - `just desktop-tauri-clippy` (default and `mesh-llm` feature sets): pass - `just test-unit`: every crate passes. The `buzz-acp` binary failed only under pre-push lane contention; rerun solo it is 1060 passed, 0 failed. - `just desktop-tauri-test`: 3422 passed, 0 failed - After the lint fixes: lib/bin unit tests for `buzz-acp`, `buzz-agent`, `buzz-auth`, `buzz-media`, `buzz-voice`, `buzz-sdk`, `buzz-pairing-cli`, and `buzz-relay`'s `api::git::transport` tests, including the Postgres-backed `enforce_mode_git_pack_routes_missing_assertion_exact_bytes`, which parses the rewritten PEM: pass `cfg(windows)` code was not linted locally (no Windows target installed). CI's Windows Rust job runs workspace clippy for `x86_64-pc-windows-msvc`, and that passes on this branch. CI also builds the relay, push-gateway and sprig images on the new `rust:1.98` bases for amd64 and arm64. No runtime behavior changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Matt Toohey <contact@matttoohey.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
1 parent a38fedb commit 8216db1

29 files changed

Lines changed: 85 additions & 73 deletions

File tree

‎.github/workflows/_ci-rust.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
121121
# MSVC needs windows.h (aws-lc-sys et al.), so this runs on a real Windows
122122
# runner — hermit, used by the Linux jobs, does not provide MSVC. The
123-
# toolchain (1.95.0 + clippy via profile = default) comes from the
123+
# toolchain (1.98.1 + clippy via profile = default) comes from the
124124
# repo-root rust-toolchain.toml, which the runner's preinstalled rustup
125125
# honors on demand; the host triple already is x86_64-pc-windows-msvc.
126126
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32

‎.github/workflows/release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ jobs:
676676
shell: bash
677677
run: scripts/verify-release-ref.sh desktop-v "$VERSION"
678678

679-
- uses: dtolnay/rust-toolchain@e081816240890017053eacbb1bdf337761dc5582 # 1.95.0
679+
- uses: dtolnay/rust-toolchain@18f0487477426dce244608110aa2660c2893deb7 # 1.98.1
680680
with:
681681
targets: ${{ env.TARGET }}
682682

‎.github/workflows/windows-canary.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
persist-credentials: false
4040

4141
# The Windows runner ships with rustup preinstalled; rust-toolchain.toml
42-
# in the repo root pins the channel (1.95.0) automatically. We only need
42+
# in the repo root pins the channel (1.98.1) automatically. We only need
4343
# to ensure the cross-compile target is registered; on windows-latest the
4444
# host IS x86_64-pc-windows-msvc so this is typically a no-op.
4545
- name: Add Rust target

‎Dockerfile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Public Buzz relay image — published as ghcr.io/block/buzz:<tag>.
44
#
5-
# Builds the `buzz-relay` binary (Rust 1.95) and the `buzz-web` static bundle
5+
# Builds the `buzz-relay` binary (Rust 1.98) and the `buzz-web` static bundle
66
# (pnpm + vite), then assembles them into a small debian-slim runtime with
77
# `git` available (the relay shells out to git for repo hydrate / receive-pack
88
# / upload-pack — see crates/buzz-relay/src/api/git).
@@ -11,7 +11,7 @@
1111
# native arm64 runners (see .github/workflows/docker.yml). The Dockerfile
1212
# itself is platform-agnostic; do not add --platform pins.
1313

14-
ARG RUST_VERSION=1.95
14+
ARG RUST_VERSION=1.98
1515
ARG NODE_VERSION=24
1616
ARG DEBIAN_VERSION=bookworm
1717

‎Dockerfile.push-gateway‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# syntax=docker/dockerfile:1.7
2-
ARG RUST_VERSION=1.95
2+
ARG RUST_VERSION=1.98
33
ARG DEBIAN_VERSION=bookworm
44

55
FROM rust:${RUST_VERSION}-${DEBIAN_VERSION} AS chef

‎Dockerfile.sprig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Multi-arch is produced by building this file on native amd64 and arm64 runners.
33
# Keep both bases pinned to manifest-list digests so either architecture resolves
44
# to immutable source bytes.
5-
FROM rust:1.95-alpine3.22@sha256:064dfc925d68d1a63f4fd2871bd7dc6e6ea56692989a487185855d62885d90aa AS builder
5+
FROM rust:1.98-alpine3.22@sha256:a1796ca6fa216d6727b5f61c69e4c665b120b1a4dcb969639e2f25f1ed309456 AS builder
66

77
RUN apk add --no-cache \
88
build-base \

‎benchmarks/harbor-buzz-orchestra/scripts/benchmark.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
FORWARDER_SOURCE = PACKAGE_ROOT / "forwarder" / "relay_forwarder.rs"
7676
FORWARDER_BINARY = "relay-forwarder"
7777
LINUX_TARGET_DIR = STATE_DIR / "linux-target"
78-
RUST_IMAGE = "rust:1.95-alpine"
78+
RUST_IMAGE = "rust:1.98-alpine"
7979

8080

8181
@dataclass(frozen=True)

‎crates/buzz-acp/src/queue.rs‎

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -558,28 +558,24 @@ impl EventQueue {
558558
.keys()
559559
.find(|scope| !self.in_flight_scopes.contains(scope))
560560
.cloned();
561-
match cancelled_scope {
562-
Some(scope) => {
563-
// Move cancelled events into the regular events slot.
564-
// No new events to merge — re-dispatch the original batch.
565-
let cancelled = self.cancelled_batches.remove(&scope).unwrap_or_default();
566-
let cancel_reason = self.cancel_reasons.remove(&scope);
567-
self.in_flight_scopes.insert(scope.clone());
568-
self.in_flight_deadlines
569-
.insert(scope.clone(), now + self.in_flight_deadline);
570-
self.in_flight_batch_sizes
571-
.insert(scope.clone(), cancelled.len());
572-
self.record_in_flight_reply_route(&scope, &cancelled);
573-
return Some(FlushBatch {
574-
channel_id: scope.channel_id(),
575-
scope,
576-
events: cancelled,
577-
cancelled_events: vec![],
578-
cancel_reason,
579-
});
580-
}
581-
None => return None,
582-
}
561+
let scope = cancelled_scope?;
562+
// Move cancelled events into the regular events slot.
563+
// No new events to merge — re-dispatch the original batch.
564+
let cancelled = self.cancelled_batches.remove(&scope).unwrap_or_default();
565+
let cancel_reason = self.cancel_reasons.remove(&scope);
566+
self.in_flight_scopes.insert(scope.clone());
567+
self.in_flight_deadlines
568+
.insert(scope.clone(), now + self.in_flight_deadline);
569+
self.in_flight_batch_sizes
570+
.insert(scope.clone(), cancelled.len());
571+
self.record_in_flight_reply_route(&scope, &cancelled);
572+
return Some(FlushBatch {
573+
channel_id: scope.channel_id(),
574+
scope,
575+
events: cancelled,
576+
cancelled_events: vec![],
577+
cancel_reason,
578+
});
583579
}
584580
};
585581
let channel_id = scope.channel_id();
@@ -1465,10 +1461,8 @@ pub fn extract_slash_command(content: &str, known_names: &[&str]) -> Option<Stri
14651461
.unwrap_or(after_at.len());
14661462
(len > 0).then_some(len)
14671463
});
1468-
match name_len {
1469-
Some(len) => rest = after_at[len..].trim_start(),
1470-
None => return None, // bare '@' — not a mention
1471-
}
1464+
let len = name_len?; // bare '@' — not a mention
1465+
rest = after_at[len..].trim_start();
14721466
} else {
14731467
break;
14741468
}

‎crates/buzz-agent/src/hints.rs‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ fn find_git_root(start: &Path) -> Option<PathBuf> {
3030
if current.join(".git").exists() {
3131
return Some(current);
3232
}
33-
match current.parent() {
34-
Some(parent) => current = parent.to_path_buf(),
35-
None => return None,
36-
}
33+
current = current.parent()?.to_path_buf();
3734
}
3835
}
3936

‎crates/buzz-auth/src/nip_fi/startup/tests.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fn test_contract(issuer: &str) -> JwksSourceContract {
1717
fn make_offline_policy(issuer: &str) -> IssuerPolicy {
1818
IssuerPolicy::new(
1919
issuer.to_owned(),
20-
vec![format!("https://relay.example/api")],
20+
vec!["https://relay.example/api".to_string()],
2121
TokenClass::DedicatedNipFi,
2222
FreshnessClass::OfflineJwt,
2323
vec![JwtAlgorithm::ES256],
@@ -32,7 +32,7 @@ fn make_offline_policy(issuer: &str) -> IssuerPolicy {
3232
fn make_status_policy(issuer: &str) -> IssuerPolicy {
3333
IssuerPolicy::new(
3434
issuer.to_owned(),
35-
vec![format!("https://relay.example/api")],
35+
vec!["https://relay.example/api".to_string()],
3636
TokenClass::DedicatedNipFi,
3737
FreshnessClass::CurrentStatus,
3838
vec![JwtAlgorithm::ES256],

0 commit comments

Comments
 (0)