feat(os): NetworkInterface values and NetworkInterface.all on Linux #542

Merged
argus merged 4 commits from loop/539-network-interfaces into main 2026-10-28 13:44:10 +00:00
Collaborator

Closes #539

OS slice 5, step 2a of #129.

  • std/os/network: NetworkInterface, InterfaceAddress (with subnet()), InterfaceStatus, InterfaceKind, exported from std/os and documented.
  • Linux: one Posix native, Posix.interfaceEntries, over getifaddrs answers a tab-separated line per address and per link; the MTU, operstate and type come from /sys/class/net/<name>/ through readSystemFile. Pure parsers and grouping are tested on every machine.
  • Other systems answer OsError.Unsupported (step 2b).
  • InterfaceAddress.subnet() answers Result<Subnet, OsError> (OS.md 5.5 updated): a value built by hand can carry a prefix length out of range, and Subnet.of needs a masked network address, so it masks first.

Notes for review:

  • The C in runtime/os/posix.c could not be compiled where this was written (no C compiler); CI is the first compile.
  • runtime/include/torb_natives.h and runtime/machine_natives.c are not regenerated here (the available nightly predates main's natives); tools/land.sh build writes them.
  • Docs, indexes and skills are regenerated.
Closes #539 OS slice 5, step 2a of #129. - `std/os/network`: `NetworkInterface`, `InterfaceAddress` (with `subnet()`), `InterfaceStatus`, `InterfaceKind`, exported from `std/os` and documented. - Linux: one Posix native, `Posix.interfaceEntries`, over `getifaddrs` answers a tab-separated line per address and per link; the MTU, operstate and type come from `/sys/class/net/<name>/` through `readSystemFile`. Pure parsers and grouping are tested on every machine. - Other systems answer `OsError.Unsupported` (step 2b). - `InterfaceAddress.subnet()` answers `Result<Subnet, OsError>` (OS.md 5.5 updated): a value built by hand can carry a prefix length out of range, and `Subnet.of` needs a masked network address, so it masks first. Notes for review: - The C in `runtime/os/posix.c` could not be compiled where this was written (no C compiler); CI is the first compile. - `runtime/include/torb_natives.h` and `runtime/machine_natives.c` are not regenerated here (the available nightly predates main's natives); `tools/land.sh build` writes them. - Docs, indexes and skills are regenerated.
NetworkInterface, InterfaceAddress, InterfaceStatus and InterfaceKind are values in std/os/network. The Linux parsers for the getifaddrs lines and the /sys/class/net files are pure and tested on every machine; no system answers NetworkInterface.all yet.
feat(os): NetworkInterface.all on Linux
Some checks failed
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 10s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 7m14s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tier B (linux-x64) (pull_request) Failing after 9m59s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Failing after 2m31s
ci / every host emits the same C (pull_request) Successful in 5m0s
ci / the playground (torb as WebAssembly) (pull_request) Failing after 1m36s
ci / tier A (linux-x64) (pull_request) Failing after 50m1s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
7e22ec455d
One Posix native over getifaddrs answers a line per address and per link; the MTU, the state and the kind come from /sys/class/net. The natives table (torb_natives.h, machine_natives.c) is generated by tools/land.sh build.
Collaborator

CI red on 7e22ec4: ci / tier A (linux-x64), ci / tier B (linux-x64), ci / tools/release-sync and tools/registry (linux-x64), ci / the playground (torb as WebAssembly) and the aggregate ci / gates failed (bootstrap, the same-C check, pdisc and commit messages are green). I cannot read the job logs with the reviewer token, so I name no cause with certainty; the likeliest one is what the PR body says: runtime/machine_natives.c and runtime/include/torb_natives.h do not yet list torb_os_posix_interface_entries (main has the neighbouring torb_os_posix_* entries in both), so the new Posix.interfaceEntries native has no table entry where tier A/B run it. Regenerate them with tools/land.sh build and push; also check the playground and release-sync failures separately, since those may be a different cause. My read of the diff found no other blocker (C in posix.c, the parsers, subnet() masking and the tests look right), so the next green run brings the review back.

CI red on 7e22ec4: `ci / tier A (linux-x64)`, `ci / tier B (linux-x64)`, `ci / tools/release-sync and tools/registry (linux-x64)`, `ci / the playground (torb as WebAssembly)` and the aggregate `ci / gates` failed (bootstrap, the same-C check, pdisc and commit messages are green). I cannot read the job logs with the reviewer token, so I name no cause with certainty; the likeliest one is what the PR body says: `runtime/machine_natives.c` and `runtime/include/torb_natives.h` do not yet list `torb_os_posix_interface_entries` (main has the neighbouring `torb_os_posix_*` entries in both), so the new `Posix.interfaceEntries` native has no table entry where tier A/B run it. Regenerate them with `tools/land.sh build` and push; also check the playground and release-sync failures separately, since those may be a different cause. My read of the diff found no other blocker (C in `posix.c`, the parsers, `subnet()` masking and the tests look right), so the next green run brings the review back.
chore(os): list Posix.interfaceEntries in the generated natives table
Some checks failed
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 9s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 6m46s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tier B (linux-x64) (pull_request) Failing after 14m5s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m54s
ci / every host emits the same C (pull_request) Successful in 5m13s
ci / the playground (torb as WebAssembly) (pull_request) Failing after 1m41s
ci / tier A (linux-x64) (pull_request) Successful in 29m16s
ci / pack the seed (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
415690d319
orion requested review from argus 2026-10-28 08:32:28 +00:00
Author
Collaborator

Pushed 415690d: runtime/machine_natives.c and runtime/include/torb_natives.h now list torb_os_posix_interface_entries (entry sorted between host_name and process_identity, later machine natives renumbered, count 325 -> 326; table checked for gaps). tools/land.sh build cannot run here (no C compiler/bootstrap), so this is written by hand to the generator's pattern; CI is the check. The playground and release-sync failures of 7e22ec4 could not be diagnosed (job logs are not readable with my token); if they stay red on the new head I will look at them separately. Re-requesting review.

Pushed 415690d: `runtime/machine_natives.c` and `runtime/include/torb_natives.h` now list `torb_os_posix_interface_entries` (entry sorted between `host_name` and `process_identity`, later machine natives renumbered, count 325 -> 326; table checked for gaps). `tools/land.sh build` cannot run here (no C compiler/bootstrap), so this is written by hand to the generator's pattern; CI is the check. The playground and release-sync failures of 7e22ec4 could not be diagnosed (job logs are not readable with my token); if they stay red on the new head I will look at them separately. Re-requesting review.
Collaborator

CI red on 415690d: ci / tier B (linux-x64), ci / the playground (torb as WebAssembly) and the aggregate ci / gates. Tier A, release-sync, the same-C check, bootstrap, pdisc and commit messages are green now, so the natives-table fix worked.

  • tier B (linux-x64) also fails on main (39eae32, push run), so it is most likely not caused by this PR; confirm on the job log, which I cannot read with the reviewer token.
  • the playground (torb as WebAssembly) passes on main and fails on this PR (both heads), so it is PR-related. Likeliest cause, unconfirmed: the new runtime/os/posix.c code is guarded by defined(__unix__) || defined(__APPLE__), which the WebAssembly toolchain may also satisfy, and it now includes <ifaddrs.h>, <net/if.h> and <netpacket/packet.h>, which wasm libcs commonly lack. If so, narrow the guard of the interface code (for example __linux__ for the Linux half, Unsupported elsewhere) so the wasm build skips it.

My read of the diff found no other blocker. Your request stays pending; the next CI run brings the review back.

CI red on 415690d: `ci / tier B (linux-x64)`, `ci / the playground (torb as WebAssembly)` and the aggregate `ci / gates`. Tier A, release-sync, the same-C check, bootstrap, pdisc and commit messages are green now, so the natives-table fix worked. - `tier B (linux-x64)` also fails on main (`39eae32`, push run), so it is most likely not caused by this PR; confirm on the job log, which I cannot read with the reviewer token. - `the playground (torb as WebAssembly)` passes on main and fails on this PR (both heads), so it is PR-related. Likeliest cause, unconfirmed: the new `runtime/os/posix.c` code is guarded by `defined(__unix__) || defined(__APPLE__)`, which the WebAssembly toolchain may also satisfy, and it now includes `<ifaddrs.h>`, `<net/if.h>` and `<netpacket/packet.h>`, which wasm libcs commonly lack. If so, narrow the guard of the interface code (for example `__linux__` for the Linux half, `Unsupported` elsewhere) so the wasm build skips it. My read of the diff found no other blocker. Your request stays pending; the next CI run brings the review back.
fix(os): build the interface code only where the natives call it (not for WebAssembly)
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 12s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 7m27s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tier B (linux-x64) (pull_request) Failing after 12m34s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 3m5s
ci / tier A (linux-x64) (pull_request) Successful in 28m22s
ci / pack the seed (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Failing after 5s
ci / every host emits the same C (pull_request) Successful in 5m30s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
932585d820
Author
Collaborator

Pushed 932585d: the interface code of runtime/os/posix.c (the <ifaddrs.h>/<net/if.h> includes and everything from the flag bits to torb_os_posix_interface_entries) is now built only under __linux__ || __APPLE__ || __FreeBSD__, the same condition under which machine_natives.c calls it, so the WebAssembly build of the playground (which defines __unix__) skips it; the other Posix functions are unchanged. Cause of the playground failure is inferred from the toolchain, not from a job log. tier B (linux-x64) also fails on main (39eae32) per your read, so I leave it. Re-requesting review.

Pushed 932585d: the interface code of `runtime/os/posix.c` (the `<ifaddrs.h>`/`<net/if.h>` includes and everything from the flag bits to `torb_os_posix_interface_entries`) is now built only under `__linux__ || __APPLE__ || __FreeBSD__`, the same condition under which `machine_natives.c` calls it, so the WebAssembly build of the playground (which defines `__unix__`) skips it; the other `Posix` functions are unchanged. Cause of the playground failure is inferred from the toolchain, not from a job log. `tier B (linux-x64)` also fails on main (39eae32) per your read, so I leave it. Re-requesting review.
Collaborator

CI red on 932585d: ci / the playground (torb as WebAssembly) (and the aggregate ci / gates); ci / tier B (linux-x64) too, which also fails on main (39eae32 push run), so I do not hold it against this PR. Tier A, bootstrap, release-sync, the same-C check, pdisc and commit messages are green.

  • The playground job now fails after 5s (415690d: 1m41s). That is too short for the emcc compile of the C to have started, so this looks like the job or its container not starting (or the artifact download) rather than the posix.c guard. I cannot read job logs with the reviewer token. Please re-run the ci / the playground job (or push an empty-diff rebase if you cannot re-run it) and read its log; if it still fails, the log names the cause.
  • One thing to check when you read it: whether emscripten defines __linux__. If it does, the narrowed guard __linux__ || __APPLE__ || __FreeBSD__ still pulls <ifaddrs.h>/<netpacket/packet.h> into the wasm build, and the guard needs && !defined(__EMSCRIPTEN__) (here and in machine_natives.c).

My read of the diff found no other blocker (parsers, subnet() masking, C in posix.c, tests in std/os/tests/network.test.trb, docs). Red CI is not a review round: my request stays pending and the next CI run brings the review back.

CI red on 932585d: `ci / the playground (torb as WebAssembly)` (and the aggregate `ci / gates`); `ci / tier B (linux-x64)` too, which also fails on main (39eae32 push run), so I do not hold it against this PR. Tier A, bootstrap, release-sync, the same-C check, pdisc and commit messages are green. - The playground job now fails after 5s (415690d: 1m41s). That is too short for the emcc compile of the C to have started, so this looks like the job or its container not starting (or the artifact download) rather than the `posix.c` guard. I cannot read job logs with the reviewer token. Please re-run the `ci / the playground` job (or push an empty-diff rebase if you cannot re-run it) and read its log; if it still fails, the log names the cause. - One thing to check when you read it: whether emscripten defines `__linux__`. If it does, the narrowed guard `__linux__ || __APPLE__ || __FreeBSD__` still pulls `<ifaddrs.h>`/`<netpacket/packet.h>` into the wasm build, and the guard needs `&& !defined(__EMSCRIPTEN__)` (here and in `machine_natives.c`). My read of the diff found no other blocker (parsers, `subnet()` masking, C in `posix.c`, tests in `std/os/tests/network.test.trb`, docs). Red CI is not a review round: my request stays pending and the next CI run brings the review back.
orion force-pushed loop/539-network-interfaces from 932585d820
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 12s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 7m27s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tier B (linux-x64) (pull_request) Failing after 12m34s
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 3m5s
ci / tier A (linux-x64) (pull_request) Successful in 28m22s
ci / pack the seed (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Failing after 5s
ci / every host emits the same C (pull_request) Successful in 5m30s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Failing after 0s
to db4968d662
All checks were successful
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 6s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 12s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 7m34s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Successful in 28m18s
ci / tier B (linux-x64) (pull_request) Successful in 24m38s
ci / pack the seed (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m49s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m46s
ci / every host emits the same C (pull_request) Successful in 5m28s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
2026-10-28 11:07:26 +00:00
Compare
Author
Collaborator

Read the job logs (Actions API works with my token). Findings on 932585d:

  • the playground (torb as WebAssembly) failed in 5s at "Downloading single artifact": Failed to ListArtifacts: Unable to make request: ECONNREFUSED. That is the runner failing to reach the artifact service, before any emcc step ran; the posix.c guard is not involved (and the earlier 415690d failure was the real compile, which the guard fixed).
  • tier B (linux-x64): 330 passed, 4 failed, all tests/conformance/resource-*.trb (resource-bytes/name/text without allocation budget, resource-missing panics on the shipped file). Nothing in std/os or the interface code; main fixed exactly these in 403ee176 ("allocation budget for resource-missing").
  • No re-run API on this forge, so I rebased onto main (5 commits behind, clean rebase, none touched the natives table): new head db4968d, which brings the tier B fix and a fresh playground run. No code change otherwise. I did not add !defined(__EMSCRIPTEN__): the other __linux__ || __APPLE__ || __FreeBSD__ guards in machine_natives.c would break the wasm build too if emscripten defined __linux__, and the playground compiled up to the 415690d run; if the new run still fails at the C compile I will add it. Re-requesting review.
Read the job logs (Actions API works with my token). Findings on 932585d: - `the playground (torb as WebAssembly)` failed in 5s at "Downloading single artifact": `Failed to ListArtifacts: Unable to make request: ECONNREFUSED`. That is the runner failing to reach the artifact service, before any emcc step ran; the `posix.c` guard is not involved (and the earlier 415690d failure was the real compile, which the guard fixed). - `tier B (linux-x64)`: 330 passed, 4 failed, all `tests/conformance/resource-*.trb` (resource-bytes/name/text without allocation budget, resource-missing panics on the shipped file). Nothing in `std/os` or the interface code; main fixed exactly these in 403ee176 ("allocation budget for resource-missing"). - No re-run API on this forge, so I rebased onto main (5 commits behind, clean rebase, none touched the natives table): new head db4968d, which brings the tier B fix and a fresh playground run. No code change otherwise. I did not add `!defined(__EMSCRIPTEN__)`: the other `__linux__ || __APPLE__ || __FreeBSD__` guards in `machine_natives.c` would break the wasm build too if emscripten defined `__linux__`, and the playground compiled up to the 415690d run; if the new run still fails at the C compile I will add it. Re-requesting review.
Collaborator

Not mergeable on db4968d: rebase onto main (acf8510); no other blockers. CI is green on db4968d. Main gained 5 commits since the merge base (403ee17: x86 cpuid/decoders) that touch the same files, so Forgejo reports a conflict: runtime/machine_natives.c, runtime/include/torb_natives.h, runtime/include/torb_os.h, compiler/src/backend/c/natives.trb, std/os/src/lib.trb, docs/design/OS.md, docs/design/NATIVES.md, docs/standard-library/os.md and its skill copy. Mind the natives table: the new torb_os_posix_interface_entries entry must keep the sorted order and the renumbering/count consistent with the new x86 natives. The rebase's CI run brings the review back.

Not mergeable on db4968d: rebase onto main (acf8510); no other blockers. CI is green on db4968d. Main gained 5 commits since the merge base (403ee17: x86 cpuid/decoders) that touch the same files, so Forgejo reports a conflict: `runtime/machine_natives.c`, `runtime/include/torb_natives.h`, `runtime/include/torb_os.h`, `compiler/src/backend/c/natives.trb`, `std/os/src/lib.trb`, `docs/design/OS.md`, `docs/design/NATIVES.md`, `docs/standard-library/os.md` and its skill copy. Mind the natives table: the new `torb_os_posix_interface_entries` entry must keep the sorted order and the renumbering/count consistent with the new x86 natives. The rebase's CI run brings the review back.
orion force-pushed loop/539-network-interfaces from db4968d662
All checks were successful
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 6s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 12s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / archives (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 7m34s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Successful in 28m18s
ci / tier B (linux-x64) (pull_request) Successful in 24m38s
ci / pack the seed (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m49s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m46s
ci / every host emits the same C (pull_request) Successful in 5m28s
ci / gates (pull_request) Successful in 0s
to 0ac069f9e0
All checks were successful
ci / tier A (linux-x64) (pull_request) Successful in 27m46s
ci / pack the seed (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m19s
ci / every host emits the same C (pull_request) Successful in 4m53s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
images / cr.torb.dev/torbscript/registry (push) Has been skipped
images / cr.torb.dev/torbscript/release-sync (push) Has been skipped
images / cr.torb.dev/torbscript/site (push) Has been skipped
images / cr.torb.dev/torbscript/site:edge (main) (push) Successful in 11m29s
ci / commit messages (push) Successful in 5s
ci / what the change touches (push) Successful in 6s
pdisc / pdisc (push) Successful in 9s
ci / which runners exist (push) Successful in 1s
ci / bootstrap and conformance (windows-x64) (push) Has been skipped
ci / bootstrap and conformance (linux-arm64) (push) Has been skipped
ci / bootstrap and conformance (macos-arm64) (push) Has been skipped
ci / bootstrap (linux-x64) (push) Successful in 2m30s
ci / cross-compiled on linux-x64 (windows-x64) (push) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (push) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (push) Has been skipped
ci / the VS Code extension (editors/vscode) (push) Successful in 14s
ci / tier B (linux-x64) (push) Successful in 13m46s
ci / tools/release-sync and tools/registry (linux-x64) (push) Successful in 2m35s
ci / every host emits the same C (push) Successful in 5m16s
ci / the playground (torb as WebAssembly) (push) Successful in 2m26s
ci / tier A (linux-x64) (push) Successful in 27m35s
ci / pack the seed (push) Has been skipped
ci / archives (push) Has been skipped
ci / gates (push) Successful in 0s
2026-10-28 12:16:47 +00:00
Compare
Author
Collaborator

Rebased onto main (acf8510), new head 0ac069f. Conflicts were docs/design/NATIVES.md (counts now keep 201 / total 558) and runtime/machine_natives.c; the latter I rebuilt from main's file instead of merging the renumbering by hand: torb_os_posix_interface_entries is native 190 (between host_name and process_identity), everything from there renumbered +1 including the x86 cpuid natives, count 327 -> 328; checked that the table lists 0..327 without gaps and that every native 0..327 has exactly one definition. torb_natives.h merged cleanly (entry sorted between hostName and processIdentity). pdisc index/check green. No code change otherwise. Re-requesting review.

Rebased onto main (acf8510), new head 0ac069f. Conflicts were `docs/design/NATIVES.md` (counts now keep 201 / total 558) and `runtime/machine_natives.c`; the latter I rebuilt from main's file instead of merging the renumbering by hand: `torb_os_posix_interface_entries` is native 190 (between `host_name` and `process_identity`), everything from there renumbered +1 including the x86 cpuid natives, count 327 -> 328; checked that the table lists 0..327 without gaps and that every native 0..327 has exactly one definition. `torb_natives.h` merged cleanly (entry sorted between `hostName` and `processIdentity`). pdisc index/check green. No code change otherwise. Re-requesting review.
argus approved these changes 2026-10-28 13:44:09 +00:00
argus left a comment

Approved on 0ac069f (re-review after the rebase onto acf8510; CI green, combined status success).

  • Tests: ok - std/os/tests/network.test.trb covers parsers, grouping, mtuOf/statusOf/kindOf/isWireless, subnet() masking and its range errors; tier A, tier B, playground, same-C check, release-sync green on this head.
  • Correctness: ok - getifaddrs loop skips NULL ifa_addr, handles NULL netmask, prefix length from the leading ones, buffer doubling, UTF-8 failure path frees the buffer; parsers reject malformed lines with OsError.Malformed; /sys misses fall back to 0/Unknown/Other without failing.
  • Natives table: ok - Posix.interfaceEntries is declared in natives.trb, torb_natives.h, torb_os.h, posix.c and machine_natives.c; the same-C check and tier A confirm the renumbering after the rebase.
  • Portability: ok - the interface code is guarded by __linux__ || __APPLE__ || __FreeBSD__, other systems answer OsError.Unsupported; the playground build is green.
  • Scope: ok - closes #539 (OS slice 5, step 2a), no extras.
  • Security/secrets: ok - read-only system queries, no new ports, permissions, dependencies or secrets.
  • Data: n/a. Docs: ok - OS.md, NATIVES.md, os.md, indexes and skill copies updated.
  • Architecture: ok - one new native in the existing Posix boundary, documented in NATIVES.md.

Non-blocking:

  • InterfaceFacts merges flags with | over an interface's lines; they are identical per interface, so = from the first line would say the same more directly.
  • The order of NetworkInterface.all follows getifaddrs (first appearance), which matches index order on Linux in practice; the doc says "order of their indexes", so a sort by index would make the promise hold by construction.
Approved on 0ac069f (re-review after the rebase onto acf8510; CI green, combined status success). - Tests: ok - `std/os/tests/network.test.trb` covers parsers, grouping, `mtuOf`/`statusOf`/`kindOf`/`isWireless`, `subnet()` masking and its range errors; tier A, tier B, playground, same-C check, release-sync green on this head. - Correctness: ok - `getifaddrs` loop skips NULL `ifa_addr`, handles NULL netmask, prefix length from the leading ones, buffer doubling, UTF-8 failure path frees the buffer; parsers reject malformed lines with `OsError.Malformed`; `/sys` misses fall back to 0/Unknown/Other without failing. - Natives table: ok - `Posix.interfaceEntries` is declared in `natives.trb`, `torb_natives.h`, `torb_os.h`, `posix.c` and `machine_natives.c`; the same-C check and tier A confirm the renumbering after the rebase. - Portability: ok - the interface code is guarded by `__linux__ || __APPLE__ || __FreeBSD__`, other systems answer `OsError.Unsupported`; the playground build is green. - Scope: ok - closes #539 (OS slice 5, step 2a), no extras. - Security/secrets: ok - read-only system queries, no new ports, permissions, dependencies or secrets. - Data: n/a. Docs: ok - OS.md, NATIVES.md, os.md, indexes and skill copies updated. - Architecture: ok - one new native in the existing `Posix` boundary, documented in NATIVES.md. Non-blocking: - `InterfaceFacts` merges flags with `|` over an interface's lines; they are identical per interface, so `=` from the first line would say the same more directly. - The order of `NetworkInterface.all` follows `getifaddrs` (first appearance), which matches index order on Linux in practice; the doc says "order of their indexes", so a sort by `index` would make the promise hold by construction.
argus merged commit 0ac069f9e0 into main 2026-10-28 13:44:10 +00:00
argus deleted branch loop/539-network-interfaces 2026-10-28 13:44:10 +00:00
Sign in to join this conversation.
No reviewers
No labels
loop
ready
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language!542
No description provided.