feat: ESP32 support#116
Conversation
Use a git dep for now since noq is not yet published.
Currently failing
|
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/net-tools/pr/116/docs/net_tools/ Last updated: 2026-06-12T14:50:42Z |
## Description Remove netdev from direct dependencies. We still have it as an indirect dependency via netwatch for now. The plan is to replace some functionality in net-tools with stubs to remove the netdev dependency that does not work on esp32. See n0-computer/net-tools#116 ipnet is not a new dep, just a new direct dep. We had it before via netwatch. ## Breaking Changes None ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist <!-- Remove any that are not relevant. --> - [ ] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented. - [ ] List all breaking changes in the above "Breaking Changes" section. - [ ] Open an issue or PR on any number0 repos that are affected by this breaking change. Give guidance on how the updates should be handled or do the actual updates themselves. The major ones are: - [ ] [`quic-rpc`](https://github.com/n0-computer/quic-rpc) - [ ] [`iroh-gossip`](https://github.com/n0-computer/iroh-gossip) - [ ] [`iroh-blobs`](https://github.com/n0-computer/iroh-blobs) - [ ] [`dumbpipe`](https://github.com/n0-computer/dumbpipe) - [ ] [`sendme`](https://github.com/n0-computer/sendme)
| // Convenience aliases | ||
| wasm_browser: { all(target_family = "wasm", target_os = "unknown") }, | ||
| // Limited POSIX platforms (not wasm) | ||
| posix_minimal: { target_os = "espidf" }, |
There was a problem hiding this comment.
I wonder about this name
There was a problem hiding this comment.
Got a better name? Currently it is noop, but the intention is to have a minimal posix implementation.
It's a convenience alias, not some publicly visible feature flag. So not sure we should bikeshed too much about this.
| } | ||
| } | ||
|
|
||
| impl Interface { |
There was a problem hiding this comment.
I am worried about all these types being public, we need to make sure we are not leaking stubs that mirror the netdev api in the public API
|
I think most |
| /// The shape mirrors the `netdev`-based `IpNet` so downstream code is | ||
| /// platform-agnostic. | ||
| #[derive(Clone, Debug)] | ||
| pub enum IpNet { |
There was a problem hiding this comment.
I think this can be pub(crate), the posix/windows interfaces.rs has it as such at least
|
|
||
| /// The router/gateway of the local network (stub — always returns `None`). | ||
| #[derive(Debug, Clone)] | ||
| pub struct HomeRouter { |
There was a problem hiding this comment.
this is defined in src/interfaces.rs already - remove from here
There was a problem hiding this comment.
edit: I once again missed the path overrides. yeah, then we keep it. But I must say I don't really like the overall structure, we should improve on this, it is very weird and hard to follow (unrelated to this PR)
There was a problem hiding this comment.
tentative approve so that we can get iroh 1.0 run on esp32.
I think we should improve the structure and featuregating overall, I don't like these copied types with pub fields at all.
But we can do that later, netwatch is not in the public API of iroh so we can do a semver-breaking release and update iroh to it.
Edit: Here's a draft PR to clean up the platform impl story: #163
But this is for later, not for now.
Description
Adds esp32 support and CI
Breaking Changes
None
Notes & open questions
Note: the posix_minimal impl for now just adds stubs that don't do nothing whatsoever, which works fine for esp32. We could and should add a poll based simple implementation later, but maybe not in this PR.
I got a WIP PR here: #117, but still need to thoroughly check it.
But just this one is all that is needed to get it to work on esp32. The actual interface enumeration is just nice to have and can come later.
Change checklist