Skip to content

feat: ESP32 support#116

Merged
rklaehn merged 19 commits into
mainfrom
has_netdev
Jun 15, 2026
Merged

feat: ESP32 support#116
rklaehn merged 19 commits into
mainfrom
has_netdev

Conversation

@rklaehn

@rklaehn rklaehn commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

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

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.

@github-actions

github-actions Bot commented Mar 11, 2026

Copy link
Copy Markdown

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

@n0bot n0bot Bot added this to iroh Mar 11, 2026
@github-project-automation github-project-automation Bot moved this to 🚑 Needs Triage in iroh Mar 11, 2026
@rklaehn rklaehn marked this pull request as ready for review March 11, 2026 10:04
github-merge-queue Bot pushed a commit to n0-computer/iroh that referenced this pull request Mar 12, 2026
## 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)
@dignifiedquire dignifiedquire moved this from 🚑 Needs Triage to 🏗 In progress in iroh Mar 17, 2026
@rklaehn rklaehn requested a review from dignifiedquire June 11, 2026 09:00
Comment thread netwatch/build.rs
// Convenience aliases
wasm_browser: { all(target_family = "wasm", target_os = "unknown") },
// Limited POSIX platforms (not wasm)
posix_minimal: { target_os = "espidf" },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder about this name

@rklaehn rklaehn Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@rklaehn rklaehn requested review from Frando and dignifiedquire June 11, 2026 09:12
Comment thread netwatch/src/interfaces/posix_minimal.rs
}
}

impl Interface {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@Frando

Frando commented Jun 12, 2026

Copy link
Copy Markdown
Member

I think most pub items don't have to be pub, at least I don't see similar pub items in the other platform impls. Let's try to tone down visibility as much as possible.

@rklaehn rklaehn requested a review from dignifiedquire June 15, 2026 08:48
/// The shape mirrors the `netdev`-based `IpNet` so downstream code is
/// platform-agnostic.
#[derive(Clone, Debug)]
pub enum IpNet {

@Frando Frando Jun 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is defined in src/interfaces.rs already - remove from here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@Frando Frando left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@rklaehn rklaehn merged commit 44adb43 into main Jun 15, 2026
52 of 53 checks passed
@github-project-automation github-project-automation Bot moved this from 🏗 In progress to ✅ Done in iroh Jun 15, 2026
@rklaehn rklaehn deleted the has_netdev branch June 15, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants