Skip to content

Commit febeeca

Browse files
therealalephclaude
andcommitted
fix(tunnel-client): use portable_atomic::AtomicU64 for 32-bit MIPS
PR #153's connect_data instrumentation imported `AtomicU64` directly from `std::sync::atomic`, which works on every release target except the 32-bit MIPS OpenWRT target (`mipsel-unknown-linux-musl`) — that platform has no hardware-backed 64-bit atomics, and Rust's std type isn't even defined there. The v1.4.0 release workflow's mipsel build failed with `error[E0432]: no AtomicU64 in sync::atomic`. `domain_fronter.rs` already imports `portable_atomic::AtomicU64` for the same reason — `portable-atomic` (already in Cargo.toml with the "fallback" feature) provides a software-emulated 64-bit atomic on targets that need it. Apply the same import here for the new preread_* counter and connect_data_unsupported flag. `AtomicBool` stays in std — it works on every target, no polyfill needed. Verified locally: cargo build + cargo test --lib (91/91 pass) clean with the import change. Same v1.4.0 — no version bump. Re-runs the release workflow to publish the missing mhrv-rs-openwrt-mipsel-softfloat artifact alongside the existing v1.4.0 release assets. Telegram notification suppressed for this re-publish (same version, no point re-posting). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8221d42 commit febeeca

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/tunnel_client.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@
66
//! 30 in-flight requests — matching the per-account Apps Script limit.
77
88
use std::collections::HashMap;
9-
use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
9+
// `AtomicU64` from `std::sync::atomic` requires hardware-backed 64-bit
10+
// atomics, which 32-bit MIPS (`mipsel-unknown-linux-musl` — our OpenWRT
11+
// router target) does not provide — the std type isn't even defined
12+
// there, so the build fails with `no AtomicU64 in sync::atomic`. We
13+
// already pull `portable-atomic` for `domain_fronter.rs` for the same
14+
// reason; reuse it here. `AtomicBool` works fine in std on every target.
15+
use portable_atomic::AtomicU64;
16+
use std::sync::atomic::{AtomicBool, Ordering};
1017
use std::sync::Arc;
1118
use std::time::{Duration, Instant};
1219

0 commit comments

Comments
 (0)