From a5fce94407b04c5e2936401f3a675661e6477369 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Sun, 27 Sep 2026 18:19:41 +0200 Subject: [PATCH 1/2] deps: surge-ping 0.9.1 does not build on 32-bit targets It reaches for AtomicU64, which does not exist where max-atomic-width is 32: 32-bit PowerPC and MIPS, so mpc85xx, ath79 and ramips in OpenWrt. Back to 0.8.4, the version 1.2.0 shipped, until the crate stops needing a 64-bit atomic. --- Cargo.lock | 100 ++++++++++++++++++++++++++++++++++++++++++----------- Cargo.toml | 7 +++- 2 files changed, 85 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 61f5eeb..b4c83eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -130,7 +130,7 @@ checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" dependencies = [ "cfg-if", "cpufeatures", - "rand_core", + "rand_core 0.10.1", ] [[package]] @@ -378,7 +378,7 @@ dependencies = [ "cfg-if", "libc", "r-efi 6.0.0", - "rand_core", + "rand_core 0.10.1", ] [[package]] @@ -722,7 +722,7 @@ dependencies = [ "icu_properties", "libc", "native-tls", - "rand", + "rand 0.10.3", "rustls", "rustls-native-certs", "rustls-pki-types", @@ -920,18 +920,18 @@ checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" [[package]] name = "pnet_base" -version = "0.35.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc190d4067df16af3aba49b3b74c469e611cad6314676eaf1157f31aa0fb2f7" +checksum = "fe4cf6fb3ab38b68d01ab2aea03ed3d1132b4868fa4e06285f29f16da01c5f4c" dependencies = [ "no-std-net", ] [[package]] name = "pnet_macros" -version = "0.35.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13325ac86ee1a80a480b0bc8e3d30c25d133616112bb16e86f712dcf8a71c863" +checksum = "688b17499eee04a0408aca0aa5cba5fc86401d7216de8a63fdf7a4c227871804" dependencies = [ "proc-macro2", "quote", @@ -941,18 +941,18 @@ dependencies = [ [[package]] name = "pnet_macros_support" -version = "0.35.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed67a952585d509dd0003049b1fc56b982ac665c8299b124b90ea2bdb3134ab" +checksum = "eea925b72f4bd37f8eab0f221bbe4c78b63498350c983ffa9dd4bcde7e030f56" dependencies = [ "pnet_base", ] [[package]] name = "pnet_packet" -version = "0.35.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c96ebadfab635fcc23036ba30a7d33a80c39e8461b8bd7dc7bb186acb96560f" +checksum = "a9a005825396b7fe7a38a8e288dbc342d5034dac80c15212436424fef8ea90ba" dependencies = [ "glob", "pnet_base", @@ -969,6 +969,15 @@ dependencies = [ "zerovec", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + [[package]] name = "proc-macro2" version = "1.0.107" @@ -999,6 +1008,16 @@ version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" +[[package]] +name = "rand" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" +dependencies = [ + "rand_chacha", + "rand_core 0.9.5", +] + [[package]] name = "rand" version = "0.10.3" @@ -1007,7 +1026,26 @@ checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af" dependencies = [ "chacha20", "getrandom 0.4.3", - "rand_core", + "rand_core 0.10.1", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", ] [[package]] @@ -1289,14 +1327,14 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "surge-ping" -version = "0.9.1" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cdc709585dead30bc08dafb5b25fee3d1a9d5e81e4eff43e21f609476b64a50" +checksum = "30498e9c9feba213c3df6ed675bdf75519ccbee493517e7225305898c86cac05" dependencies = [ "hex", "parking_lot", "pnet_packet", - "rand", + "rand 0.9.5", "socket2 0.6.5", "thiserror", "tokio", @@ -1343,7 +1381,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.3.4", + "getrandom 0.4.3", "once_cell", "rustix", "windows-sys 0.61.2", @@ -1361,22 +1399,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.20" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "2.0.20" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 3.0.3", + "syn 2.0.119", ] [[package]] @@ -1780,6 +1818,26 @@ dependencies = [ "synstructure", ] +[[package]] +name = "zerocopy" +version = "0.8.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6df92bf3d9227be3d53173901ddbffac2babc27ae50f397776ffd6dc33f800cb" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac4f328cf2f05d084e496c3e9c3f33ed0a183656a16e1fcec4d464d8373aec82" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + [[package]] name = "zerofrom" version = "0.1.8" diff --git a/Cargo.toml b/Cargo.toml index 9455537..35cf5a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -86,7 +86,12 @@ serde = { version = "1", features = ["derive"] } tokio-native-tls = { version = "0.3", optional = true } serde_json = { version = "1", features = ["raw_value"] } socket2 = { version = "0.5", features = ["all"] } -surge-ping = "0.9" +# Held on the 0.8 line: 0.9.1 reaches for `AtomicU64`, which does not exist +# where `max-atomic-width` is 32 -- 32-bit PowerPC and MIPS, so mpc85xx, +# ath79 and ramips in OpenWrt. The counter behind it is only ever compared +# for equality, so a 32-bit one would do; until upstream narrows it, this +# crate stays where the ping phase is known to build and run. +surge-ping = "0.8" tokio = { version = "1", features = ["rt-multi-thread", "macros", "net", "time", "io-util", "sync", "fs", "signal"] } tower-service = "0.3" url = "2" From 08a2aad9a94c8278a84a479a1070732cbf6dd264 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Mon, 28 Sep 2026 01:34:15 +0200 Subject: [PATCH 2/2] ci: cross-build a target without 64-bit atomics Every target in the matrix had 64-bit atomics, so a dependency that needs them built everywhere and broke only on the boards OpenWrt cares about. powerpc-unknown-linux-gnu is the same shape as mpc85xx. It needs -latomic, or the binary links and CI stays green while the loader cannot start it, so the artifact is started under qemu. The cache key gains the matrix entry as well: it named only the job, and entries restored each other's targets. --- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de9fbab..55ab563 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -168,6 +168,12 @@ jobs: # builds use plain `native-tls` against the SDK's libopenssl. - target: aarch64-unknown-linux-musl tls: vendored-openssl + # A target whose `max-atomic-width` is 32, the shape of OpenWrt's + # mpc85xx, ath79 and ramips. A dependency that reaches for + # `AtomicU64` builds on every target above and fails only here. + # OpenSSL again, because ring has no 32-bit PowerPC. + - target: powerpc-unknown-linux-gnu + tls: vendored-openssl steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -176,8 +182,25 @@ jobs: with: toolchain: stable - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 + with: + # One cache per matrix entry. The key otherwise names only the job, + # so an entry restores whatever another one built. + key: ${{ matrix.target }}-${{ matrix.tls }} - run: cargo install cross@0.2.5 --locked - run: cross build --release --target ${{ matrix.target }} --no-default-features --features ${{ matrix.tls }} + env: + # 32-bit PowerPC has no 64-bit atomic instruction, so the compiler + # calls into libatomic. Without this the link succeeds and CI stays + # green, but the loader cannot start the binary: __atomic_load_8 and + # five more resolve nowhere. + RUSTFLAGS: ${{ matrix.target == 'powerpc-unknown-linux-gnu' && '-C link-arg=-latomic' || '' }} + # That link is the one that can go wrong without failing, so start the + # artifact under the image's qemu. `--version` only: no network from CI. + - if: matrix.target == 'powerpc-unknown-linux-gnu' + run: | + docker run --rm -v "$PWD/target/${{ matrix.target }}/release:/w" \ + ghcr.io/cross-rs/${{ matrix.target }}:0.2.5 \ + qemu-ppc-static -L /usr/powerpc-linux-gnu /w/librespeed-cli --version - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: librespeed-cli-${{ matrix.target }}-${{ matrix.tls }}