Skip to content

Support tvOS (build it the way iOS does) - #201

Merged
shellrow merged 1 commit into
shellrow:mainfrom
andoriyu:tvos-support
Nov 28, 2026
Merged

shellrow merged 1 commit into
shellrow:mainfrom
andoriyu:tvos-support

Conversation

@andoriyu

Copy link
Copy Markdown
Contributor

tvOS uses the same Darwin APIs as iOS, but every platform gate in netdev names only target_os = "ios". On aarch64-apple-tvos that leaves interfaces() with no body and compiles out get_ipv6_addr_flags, so the crate doesn't build:

error[E0308]: mismatched types   (src/interface/mod.rs: interfaces() returns ())
error[E0432]: unresolved import `crate::interface::ipv6_addr_flags::get_ipv6_addr_flags`

This PR gates tvOS next to iOS everywhere: the sources and the iOS-only dependencies in Cargo.toml. It also lists tvOS in the README and adds cargo check --target aarch64-apple-tvos to the macOS CI job, next to the iOS check.

Tested: cargo check --all-features passes for aarch64-apple-tvos, aarch64-apple-tvos-sim, aarch64-apple-ios and aarch64-apple-darwin on stable 1.99. Clippy reports the same warnings on tvOS as on iOS on main, so this adds none. We've shipped the same change as a vendored patch in a tvOS app (through iroh → netwatch) since 0.46.

Context: iroh reaches netdev through netwatch, so any iroh-based tvOS app hits this. The matching netwatch change is a separate PR to n0-computer/net-tools.

tvOS shares iOS's Darwin APIs, but every platform gate named only
target_os = "ios", so on aarch64-apple-tvos interfaces() had no body
and get_ipv6_addr_flags was configured out:

  error[E0308]: mismatched types (interfaces() returns ())
  error[E0432]: unresolved import get_ipv6_addr_flags

Gate tvOS alongside iOS everywhere (sources and the target-specific
dependencies), list it in the README, and check it in CI next to iOS.
@shellrow

Copy link
Copy Markdown
Owner

Thanks!

@shellrow
shellrow merged commit 1041661 into shellrow:main Nov 28, 2026
6 checks passed
andoriyu added a commit to andoriyu/net-tools that referenced this pull request Nov 28, 2026
netdev 0.48.1 builds on tvOS (shellrow/netdev#201). url 2.5.8 has a
stack overflow in Url::origin() on nested blob: URLs (RUSTSEC-2026-0592),
which fails cargo deny.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SnBHbXi2r2EQkp7JSRYvHA
lambdanature pushed a commit to irsync-dev/net-tools that referenced this pull request Dec 1, 2026
## Description

Refs n0-computer#282

Builds netwatch for tvOS the way iOS is built. tvOS has the same
`AF_ROUTE` routing socket and Darwin APIs, so each gate that names
`target_os = "ios"` (the `bsd` alias in `build.rs`, `interfaces/bsd.rs`,
`netmon/actor.rs`) now names tvOS too. `aarch64-apple-tvos` and
`aarch64-apple-tvos-sim` join the iOS CI matrix.

Dependency updates:

- **netdev 0.47.0 → 0.48.1**: the first release that builds on tvOS
(shellrow/netdev#201).
- **url 2.5.8 → 2.5.9** (lock file only): fixes
[RUSTSEC-2026-0592](https://rustsec.org/advisories/RUSTSEC-2026-0592), a
stack overflow in `Url::origin()` on nested `blob:` URLs. It was failing
`cargo deny`.

I also had to fix a few things to get `cargo make` passing on my Mac.
`bsd.rs` doesn't get compiled on Linux, so CI never caught these: a
couple of clippy lints (`needless_bool` and `unused_async`) and rustdoc
treating `<must be specified>` as an HTML tag. I left `default_route`
async so it matches the other platforms.

## API Changes

None.

<details>
<summary>Testing</summary>

On macOS (aarch64), stable 1.100.1:

- `cargo make`: fmt, check, clippy, doc and nextest all pass (32 tests).
- `cargo build --locked --workspace --all-features --target <t>` (the CI
command) and `cargo clippy` with no warnings, for `aarch64-apple-tvos`,
`aarch64-apple-tvos-sim` and `aarch64-apple-ios`.
- `cargo deny --workspace --all-features check -Dwarnings`: advisories,
bans, licenses and sources all pass.

With iroh 1.5 and this netwatch, our tvOS app connects and streams on
the tvOS simulator. The same change on netwatch 0.19 has shipped in our
TestFlight builds.
</details>

## Change checklist

- [x] Self-review.
- [ ] Documentation updates following the [style guide], if relevant.
- [ ] Tests if relevant.
- [x] All API changes documented.
- [x] `cargo make` passes locally.

[style guide]:
https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01SnBHbXi2r2EQkp7JSRYvHA

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants