Skip to content

feat(udp): build noq-udp for Fuchsia, and test it daily on an emulator - #932

Open
bayanasar wants to merge 1 commit into
n0-computer:mainfrom
bayanasar:udp-fuchsia
Open

bayanasar wants to merge 1 commit into
n0-computer:mainfrom
bayanasar:udp-fuchsia

Conversation

@bayanasar

Copy link
Copy Markdown

Description

Follows #927. noq-udp doesn't build for Fuchsia with libc as released, so this puts Fuchsia on posix_minimal, as ESP-IDF and WASI are, and adds a job to the daily workflow that runs noq-udp's tests on a Fuchsia emulator (x64, KVM).

Notes & open questions

  • On Fuchsia, posix_minimal means no ECN, no packet info and no MTU discovery (may_fragment is true). The full unix backend would need libc to fix its Fuchsia cmsghdr first.
  • Each run downloads the SDK (2.3 GB) and the emulator image (240 MB), so the job is in the daily workflow rather than on every PR. The SDK version is pinned in the job.
More detail (drafted with Claude Code)
  • What libc lacks for Fuchsia: IPV6_PKTINFO and IPV6_DONTFRAG. Its Fuchsia cmsghdr also has a __pad1 that Fuchsia's <sys/socket.h> doesn't, so cmsg_level and cmsg_type would land 4 bytes off.
  • fuchsia-run-tests-on-emulator.sh follows rust-android-run-tests-on-emulator.sh. It boots the minimal.x64 product of the SDK's version with ffx emu, packages each test executable with an elf_test_runner component of type system (for the netstack), and runs it with ffx test run. ffx runs isolated, under FUCHSIA_WORK.
  • Only the SDK's x64 parts are unpacked, about 2 GB of its 9.
  • Locally the emulator boots in about 10 s and the script takes under 40 s. tests.rs: 8 passed, gso ignored. With a panicking test added, the script exits 1.
  • On GitHub's ubuntu-latest, from my fork: https://github.com/bayanasar/noq/actions/runs/47427349296 (1m41s; the SDK download takes 27 s). zizmor --offline . reports no findings with this change.
  • Checked locally: clippy for noq-udp on Linux and for Fuchsia, noq-udp's tests on Linux, cargo fmt on noq-udp. I didn't run cargo make.

Change checklist

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

Drafted with Claude Code.

noq-udp doesn't build for Fuchsia with libc as released: libc lacks
IPV6_PKTINFO and IPV6_DONTFRAG there, and its Fuchsia cmsghdr has a
padding field that Fuchsia's <sys/socket.h> doesn't, so the unix
backend would read and write control messages at the wrong offsets.
Put Fuchsia on posix_minimal, as ESP-IDF and WASI are; it needs
nothing more from libc. On Fuchsia that gives up ECN, packet info and,
since the socket may fragment, MTU discovery.

The daily workflow gains a job that runs noq-udp's tests on a Fuchsia
emulator (x64, KVM): the core SDK from CIPD, the minimal product of the
same version, and each test executable as a test component run with
`ffx test run`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🚑 Needs Triage

Development

Successfully merging this pull request may close these issues.

1 participant