Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,39 @@ jobs:
env:
RUST_LOG: ${{ runner.debug && 'TRACE' || 'DEBUG' }}

test_posix_minimal:
name: Test posix_minimal (netwatch)
if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')"
timeout-minutes: 30
runs-on: ubuntu-latest
env:
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "on"
RUSTFLAGS: "-Dwarnings --cfg posix_minimal"
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: mozilla-actions/sccache-action@v0.0.9
- name: Build and test netwatch (posix_minimal)
run: cargo test --locked -p netwatch

esp32_check:
name: ESP32-C3 build check
if: "github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'flaky-test')"
timeout-minutes: 30
runs-on: ubuntu-latest
env:
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "on"
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@nightly
with:
components: rust-src
- uses: mozilla-actions/sccache-action@v0.0.9
- name: Check workspace for ESP32-C3
run: cargo check -Z build-std=std,panic_abort --target riscv32imc-esp-espidf --workspace --no-default-features

wasm_test:
name: Build & test wasm32 for browsers
runs-on: ubuntu-latest
Expand Down
15 changes: 13 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ missing_debug_implementations = "warn"
# require a feature enabled when using `--cfg docsrs` which we can not
# do. To enable for a crate set `#![cfg_attr(iroh_docsrs,
# feature(doc_cfg))]` in the crate.
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(iroh_docsrs)"] }
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(iroh_docsrs)", "cfg(has_netdev)"] }

[workspace.lints.clippy]
unused-async = "warn"
13 changes: 6 additions & 7 deletions netwatch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,18 @@ tracing = "0.1"

# non-browser dependencies
[target.'cfg(not(all(target_family = "wasm", target_os = "unknown")))'.dependencies]
ipnet = "2"
noq-udp = "0.9"
libc = "0.2.139"
netdev = "0.40.1"
socket2 = { version = "0.6", features = ["all"] }
tokio = { version = "1", features = ["rt", "net"] }

# netdev is available on all non-embedded, non-wasm platforms
[target.'cfg(not(any(target_os = "espidf", all(target_family = "wasm", target_os = "unknown"))))'.dependencies]
netdev = "0.40.1"
tokio = { version = "1", features = [
"io-util",
"macros",
"sync",
"rt",
"net",
"fs",
"io-std",
"time",
] }

[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
Expand Down
2 changes: 2 additions & 0 deletions netwatch/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ fn main() {
cfg_aliases! {
// Convenience aliases
wasm_browser: { all(target_family = "wasm", target_os = "unknown") },
// Limited POSIX platforms (not wasm)
posix_minimal: { target_os = "espidf" },
}
}
2 changes: 1 addition & 1 deletion netwatch/src/interfaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mod linux;
#[cfg(target_os = "windows")]
mod windows;

pub(crate) use netdev::ipnet::{Ipv4Net, Ipv6Net};
pub(crate) use ipnet::{Ipv4Net, Ipv6Net};

#[cfg(any(
target_os = "freebsd",
Expand Down
Loading
Loading