From 339f478292022358e59340e0c37f8ba296b8c203 Mon Sep 17 00:00:00 2001 From: Pluto Yang Date: Sun, 5 Jul 2026 15:44:28 +0800 Subject: [PATCH] Upgrade aya dependencies to support loongarch64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Motivation: - Upstream aya-rs added loongarch64 support starting from aya 0.14.0 / aya-ebpf 0.2.0 - This is needed to build mitmproxy-rs on loongarch64 Linux Changes: - Upgrade aya from 0.13.0 to 0.14.0 - Upgrade aya-ebpf from 0.1.1 to 0.2.0 - Upgrade aya-log from 0.2.1 to 0.3.0 - Upgrade aya-log-ebpf from 0.1.0 to 0.2.0 - Upgrade aya-build from 0.1.3 to 0.2.0 (build dependency) - Fix `set_global` deprecation → use `override_global` instead Tested: Compiles and runs successfully on loongarch64 Signed-off-by: Pluto Yang --- Cargo.lock | 132 ++++++++++++++++------------------- Cargo.toml | 8 +-- mitmproxy-linux/Cargo.toml | 2 +- mitmproxy-linux/src/main2.rs | 2 +- 4 files changed, 68 insertions(+), 76 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dae8b87d..d6013f6e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -36,12 +36,6 @@ dependencies = [ "cc", ] -[[package]] -name = "allocator-api2" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" - [[package]] name = "anes" version = "0.1.6" @@ -304,38 +298,41 @@ dependencies = [ [[package]] name = "aya" -version = "0.13.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d18bc4e506fbb85ab7392ed993a7db4d1a452c71b75a246af4a80ab8c9d2dd50" +checksum = "66e644424fada9fff4fdc63848db1732fb69b626e8328202ef55c03df1f4d939" dependencies = [ "assert_matches", "aya-obj", "bitflags 2.11.0", - "bytes", + "hashbrown 0.17.1", "libc", "log", "object", "once_cell", - "thiserror 1.0.69", - "tokio", + "scopeguard", + "thiserror 2.0.18", ] [[package]] name = "aya-build" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59bc42f3c5ddacc34eca28a420b47e3cbb3f0f484137cb2bf1ad2153d0eae52a" +checksum = "609b414caa508f04d2dbbc9481ad6869f43ab9ab1dc9abd237fca27c0818f663" dependencies = [ "anyhow", "cargo_metadata", + "rustc_version", + "which 8.0.2", ] [[package]] name = "aya-ebpf" -version = "0.1.1" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8dbaf5409a1a0982e5c9bdc0f499a55fe5ead39fe9c846012053faf0d404f73" +checksum = "eace5970943931fea46a8cbdca208a8f6a9e0413d85a5a6c4e168f0b909570bc" dependencies = [ + "aya-build", "aya-ebpf-bindings", "aya-ebpf-cty", "aya-ebpf-macros", @@ -344,9 +341,9 @@ dependencies = [ [[package]] name = "aya-ebpf-bindings" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71ee8e6a617f040d8da7565ec4010aea75e33cda4662f64c019c66ee97d17889" +checksum = "cf1f19286ebbda6673099b68d049034838f08e4939cef66c998a8d3e62825d76" dependencies = [ "aya-build", "aya-ebpf-cty", @@ -354,18 +351,18 @@ dependencies = [ [[package]] name = "aya-ebpf-cty" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6f33396742e7fd0f519c1e0de5141d84e1a8df69146a557c08cc222b0ceace4" +checksum = "0884264bc8a51a49fed03df8feada3a21d703cf501dae33c28bdba5d2313ef33" dependencies = [ "aya-build", ] [[package]] name = "aya-ebpf-macros" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96fd02363736177e7e91d6c95d7effbca07be87502c7b5b32fc194aed8b177a0" +checksum = "23e3a7f86e914df106dd00f9d757bc93f7d5c93380c51eead23d8d2ccd15a87a" dependencies = [ "proc-macro2", "proc-macro2-diagnostics", @@ -375,32 +372,30 @@ dependencies = [ [[package]] name = "aya-log" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b600d806c1d07d3b81ab5f4a2a95fd80f479a0d3f1d68f29064d660865f85f02" +checksum = "476912cd6322ecf481a48f9db82207406a472563875eef014e927800522aac5c" dependencies = [ "aya", "aya-log-common", - "bytes", "log", - "thiserror 1.0.69", - "tokio", + "thiserror 2.0.18", ] [[package]] name = "aya-log-common" -version = "0.1.15" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "befef9fe882e63164a2ba0161874e954648a72b0e1c4b361f532d590638c4eec" +checksum = "d14c56374a63b20cb1d76108bf9ff2a75e137d47f57f32f2841ef74153b2186a" dependencies = [ "num_enum", ] [[package]] name = "aya-log-ebpf" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a10bbadd0829895a91eb1cd2bb02d7af145704087f03812bed60cb9fe65dbb3" +checksum = "9d6b48fdc4454a2474f89970d6c6fdd1f9a9da5190d3c824d9341c6666831316" dependencies = [ "aya-ebpf", "aya-log-common", @@ -409,9 +404,9 @@ dependencies = [ [[package]] name = "aya-log-ebpf-macros" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6d8251a75f56077db51892041aa6b77c70ef2723845d7a210979700b2f01bc4" +checksum = "13a22cc8e903fb5241357d2f48f26afc3fb9dcb7febe54405e94707cf73e5918" dependencies = [ "aya-log-common", "aya-log-parser", @@ -422,25 +417,23 @@ dependencies = [ [[package]] name = "aya-log-parser" -version = "0.1.13" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b102eb5c88c9aa0b49102d3fbcee08ecb0dfa81014f39b373311de7a7032cb" +checksum = "f52d032162a42a191cd9b4ac35a212848c08b9335d2c9a92eaef8f281792757a" dependencies = [ "aya-log-common", ] [[package]] name = "aya-obj" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51b96c5a8ed8705b40d655273bc4212cbbf38d4e3be2788f36306f154523ec7" +checksum = "8c76b9c75d9cdc155ff8f6a06d61e873f67bf47be8cfa92a3b5aaea43f4b4077" dependencies = [ "bytes", - "core-error", - "hashbrown 0.15.5", "log", "object", - "thiserror 1.0.69", + "thiserror 2.0.18", ] [[package]] @@ -816,15 +809,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8a42181e0652c2997ae4d217f25b63c5337a52fd2279736e97b832fa0a3cff" -[[package]] -name = "core-error" -version = "0.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efcdb2972eb64230b4c50646d8498ff73f5128d196a90c7236eec4cbe8619b8f" -dependencies = [ - "version_check", -] - [[package]] name = "core-foundation" version = "0.10.1" @@ -1290,6 +1274,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "foreign-types" version = "0.5.0" @@ -1482,7 +1472,7 @@ dependencies = [ "futures-core", "futures-sink", "http", - "indexmap 2.12.1", + "indexmap 2.14.0", "slab", "tokio", "tokio-util", @@ -1521,16 +1511,18 @@ version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ - "allocator-api2", - "equivalent", - "foldhash", + "foldhash 0.1.5", ] [[package]] name = "hashbrown" -version = "0.16.1" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" +dependencies = [ + "equivalent", + "foldhash 0.2.0", +] [[package]] name = "hdrhistogram" @@ -1897,12 +1889,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.12.1" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" dependencies = [ "equivalent", - "hashbrown 0.16.1", + "hashbrown 0.17.1", "serde", "serde_core", ] @@ -2629,13 +2621,13 @@ dependencies = [ [[package]] name = "object" -version = "0.36.7" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +checksum = "2e5a6c098c7a3b6547378093f5cc30bc54fd361ce711e05293a5cc589562739b" dependencies = [ "crc32fast", - "hashbrown 0.15.5", - "indexmap 2.12.1", + "hashbrown 0.17.1", + "indexmap 2.14.0", "memchr", ] @@ -2997,7 +2989,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4aeaa1f2460f1d348eeaeed86aea999ce98c1bded6f089ff8514c9d9dbdc973" dependencies = [ "anyhow", - "indexmap 2.12.1", + "indexmap 2.14.0", "log", "protobuf", "protobuf-support", @@ -3448,7 +3440,7 @@ version = "1.0.148" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3084b546a1dd6289475996f182a22aba973866ea8e8b02c51d9f46b1336a22da" dependencies = [ - "indexmap 2.12.1", + "indexmap 2.14.0", "itoa", "memchr", "serde", @@ -3462,7 +3454,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.12.1", + "indexmap 2.14.0", "itoa", "ryu", "serde", @@ -3926,7 +3918,7 @@ checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", - "indexmap 2.12.1", + "indexmap 2.14.0", "pin-project-lite", "slab", "sync_wrapper", @@ -4293,7 +4285,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" dependencies = [ "anyhow", - "indexmap 2.12.1", + "indexmap 2.14.0", "wasm-encoder", "wasmparser", ] @@ -4306,7 +4298,7 @@ checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" dependencies = [ "bitflags 2.11.0", "hashbrown 0.15.5", - "indexmap 2.12.1", + "indexmap 2.14.0", "semver", ] @@ -4848,7 +4840,7 @@ checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" dependencies = [ "anyhow", "heck", - "indexmap 2.12.1", + "indexmap 2.14.0", "prettyplease", "syn", "wasm-metadata", @@ -4879,7 +4871,7 @@ checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" dependencies = [ "anyhow", "bitflags 2.11.0", - "indexmap 2.12.1", + "indexmap 2.14.0", "log", "serde", "serde_derive", @@ -4898,7 +4890,7 @@ checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" dependencies = [ "anyhow", "id-arena", - "indexmap 2.12.1", + "indexmap 2.14.0", "log", "semver", "serde", diff --git a/Cargo.toml b/Cargo.toml index 2279c43e..97606305 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,10 +35,10 @@ edition = "2024" rust-version = "1.88" # MSRV [workspace.dependencies] -aya = { version = "0.13.0", default-features = false } -aya-ebpf = { version = "0.1.1", default-features = false } -aya-log = { version = "0.2.1", default-features = false } -aya-log-ebpf = { version = "0.1.0", default-features = false } +aya = { version = "0.14.0", default-features = false } +aya-ebpf = { version = "0.2.1", default-features = false } +aya-log = { version = "0.3.0", default-features = false } +aya-log-ebpf = { version = "0.2.0", default-features = false } tun = { version = "0.8.8" } [workspace.lints.clippy] diff --git a/mitmproxy-linux/Cargo.toml b/mitmproxy-linux/Cargo.toml index d3db739a..97169f0a 100644 --- a/mitmproxy-linux/Cargo.toml +++ b/mitmproxy-linux/Cargo.toml @@ -32,7 +32,7 @@ const-sha1 = "0.3.0" [target.'cfg(target_os = "linux")'.build-dependencies] anyhow = { version = "1.0.102", features = ["backtrace"] } -aya-build = "0.1.3" +aya-build = "0.2.0" mitmproxy-linux-ebpf = { path = "../mitmproxy-linux-ebpf" } cargo_metadata = { version = "0.23.1", default-features = false } diff --git a/mitmproxy-linux/src/main2.rs b/mitmproxy-linux/src/main2.rs index dcf38a1a..2b3edcc4 100644 --- a/mitmproxy-linux/src/main2.rs +++ b/mitmproxy-linux/src/main2.rs @@ -38,7 +38,7 @@ fn load_bpf(device_index: u32) -> Result { debug!("Loading BPF program ({:x})...", Bytes::from_static(&BPF_HASH)); let mut ebpf = EbpfLoader::new() .btf(Btf::from_sys_fs().ok().as_ref()) - .set_global("INTERFACE_ID", &device_index, true) + .override_global("INTERFACE_ID", &device_index, true) .load(BPF_PROG) .context("failed to load eBPF program")?; if let Err(e) = aya_log::EbpfLogger::init(&mut ebpf) {