fix(runtime): enumerate Windows network interfaces - #7080
Merged
Conversation
📝 WalkthroughWalkthroughWindows ChangesWindows network interface support
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Runtime
participant GetAdaptersAddresses
participant NetworkShapeChecks
Runtime->>GetAdaptersAddresses: request adapter addresses
GetAdaptersAddresses-->>Runtime: adapter and unicast address data
Runtime->>Runtime: derive netmasks, CIDRs, MACs, and IPv6 scope IDs
Runtime-->>NetworkShapeChecks: return network interface entries
NetworkShapeChecks->>NetworkShapeChecks: validate entry fields and formats
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/perry-runtime/src/os_network.rs`:
- Around line 211-353: Add the missing std::mem::size_of import in the Windows
networking code so the unqualified size_of calls in collect_windows_adapters
compile. Keep the existing socket-size comparisons unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 4f32b5e8-daef-4567-b8da-71635cdf8025
📒 Files selected for processing (4)
changelog.d/7080-windows-network-interfaces.mdcrates/perry-runtime/Cargo.tomlcrates/perry-runtime/src/os_network.rstest-parity/node-suite/os/collections/network-interfaces-shape.ts
jdalton
added a commit
to jdalton/perry
that referenced
this pull request
Jul 31, 2026
The Warnings gate (host-compatible + product) has been red on main since PerryTS#7080/PerryTS#7028/PerryTS#7031 landed (2026-07-30): on Linux, cargo check -p perry --bins -D warnings fails on genuinely-dead code. Not introduced by this PR, but folded in here so the required gate goes green: - perry-runtime os_network.rs: format_mac_address is only called on Windows + macOS/BSD + tests; on Linux the MAC is read preformatted from /sys, so gate the fn to the union of its real callers. - compile/resolve.rs: resolve_exports first-match wrapper has no non-test caller (PerryTS#7028 uses _candidates/_with_conditions) — allow(dead_code). - compile/well_known.rs: upstream/node_builtin/alias_of provenance fields (PerryTS#7031) are read by the review gate + tests, not the compile/link path — allow(dead_code).
jdalton
added a commit
to jdalton/perry
that referenced
this pull request
Jul 31, 2026
Drive native-artifact provisioning off what a program actually references instead of the well-known iteration set alone. Link: codegen's ext_registry gains a prefix net so any emitted js_<binding>_* FFI (js_ioredis_*, js_undici_*, js_node_forge_*) flips its well-known wrapper onto the link line off provenance alone. An AOT-compiled iovalkey/undici/node-forge (a compilePackages member, never in any import set) now links its perry-ext-* staticlib instead of failing with Undefined symbols: _js_ioredis_new. Build: routed CPU-only ext staticlibs are auto-built from workspace source when missing (reusing build_missing_prebuilt_ext_lib), and perry-wasm-host is auto-built when the program uses WebAssembly.* so libperry_wasm_host.a-not-found can't happen on a normal compile. Tests: ext_registry prefix routing + replay markers, ext binding key resolution + build-routing split, and a fake-cargo wasm-host auto-build. Review + CI follow-ups folded in: - Android/HarmonyOS cross-env: build_missing_prebuilt_ext_lib now applies the OHOS SDK / Android NDK compile env (mirroring build_optimized_libs) before the auto-build, so a C-dependent CPU-only wrapper's cross build no longer fails in build.rs before it can fall back (CodeRabbit). - workspace-architecture baseline refreshed to record the audit facts the ext crates imply: perry-ext-node-forge classification, the intentional perry-ext-node-forge/perry-ext-undici -> perry-runtime edges (PerryTS#6303/PerryTS#6314), perry-container-compose default membership, and member/closure counts. - Cleared pre-existing -D warnings dead-code that had been red on main since PerryTS#7080/PerryTS#7028/PerryTS#7031: gate perry-runtime's format_mac_address to its real callers (Windows/macOS/BSD/test; Linux reads the MAC preformatted from /sys), and allow(dead_code) on resolve_exports and the well_known provenance fields (read by the review gate + tests, not the link path). - Regenerated docs/src/api/reference.md + docs/api/perry.d.ts for the node-forge manifest entries added in PerryTS#7033. - Dropped the now-passing test_gap_zlib_3285_params from the gap snapshot.
proggeramlug
pushed a commit
to jdalton/perry
that referenced
this pull request
Aug 1, 2026
Drive native-artifact provisioning off what a program actually references instead of the well-known iteration set alone. Link: codegen's ext_registry gains a prefix net so any emitted js_<binding>_* FFI (js_ioredis_*, js_undici_*, js_node_forge_*) flips its well-known wrapper onto the link line off provenance alone. An AOT-compiled iovalkey/undici/node-forge (a compilePackages member, never in any import set) now links its perry-ext-* staticlib instead of failing with Undefined symbols: _js_ioredis_new. Build: routed CPU-only ext staticlibs are auto-built from workspace source when missing (reusing build_missing_prebuilt_ext_lib), and perry-wasm-host is auto-built when the program uses WebAssembly.* so libperry_wasm_host.a-not-found can't happen on a normal compile. Tests: ext_registry prefix routing + replay markers, ext binding key resolution + build-routing split, and a fake-cargo wasm-host auto-build. Review + CI follow-ups folded in: - Android/HarmonyOS cross-env: build_missing_prebuilt_ext_lib now applies the OHOS SDK / Android NDK compile env (mirroring build_optimized_libs) before the auto-build, so a C-dependent CPU-only wrapper's cross build no longer fails in build.rs before it can fall back (CodeRabbit). - workspace-architecture baseline refreshed to record the audit facts the ext crates imply: perry-ext-node-forge classification, the intentional perry-ext-node-forge/perry-ext-undici -> perry-runtime edges (PerryTS#6303/PerryTS#6314), perry-container-compose default membership, and member/closure counts. - Cleared pre-existing -D warnings dead-code that had been red on main since PerryTS#7080/PerryTS#7028/PerryTS#7031: gate perry-runtime's format_mac_address to its real callers (Windows/macOS/BSD/test; Linux reads the MAC preformatted from /sys), and allow(dead_code) on resolve_exports and the well_known provenance fields (read by the review gate + tests, not the link path). - Regenerated docs/src/api/reference.md + docs/api/perry.d.ts for the node-forge manifest entries added in PerryTS#7033. - Dropped the now-passing test_gap_zlib_3285_params from the gap snapshot.
proggeramlug
pushed a commit
that referenced
this pull request
Aug 1, 2026
* feat(compile): auto-provision native ext bindings + wasm host Drive native-artifact provisioning off what a program actually references instead of the well-known iteration set alone. Link: codegen's ext_registry gains a prefix net so any emitted js_<binding>_* FFI (js_ioredis_*, js_undici_*, js_node_forge_*) flips its well-known wrapper onto the link line off provenance alone. An AOT-compiled iovalkey/undici/node-forge (a compilePackages member, never in any import set) now links its perry-ext-* staticlib instead of failing with Undefined symbols: _js_ioredis_new. Build: routed CPU-only ext staticlibs are auto-built from workspace source when missing (reusing build_missing_prebuilt_ext_lib), and perry-wasm-host is auto-built when the program uses WebAssembly.* so libperry_wasm_host.a-not-found can't happen on a normal compile. Tests: ext_registry prefix routing + replay markers, ext binding key resolution + build-routing split, and a fake-cargo wasm-host auto-build. Review + CI follow-ups folded in: - Android/HarmonyOS cross-env: build_missing_prebuilt_ext_lib now applies the OHOS SDK / Android NDK compile env (mirroring build_optimized_libs) before the auto-build, so a C-dependent CPU-only wrapper's cross build no longer fails in build.rs before it can fall back (CodeRabbit). - workspace-architecture baseline refreshed to record the audit facts the ext crates imply: perry-ext-node-forge classification, the intentional perry-ext-node-forge/perry-ext-undici -> perry-runtime edges (#6303/#6314), perry-container-compose default membership, and member/closure counts. - Cleared pre-existing -D warnings dead-code that had been red on main since #7080/#7028/#7031: gate perry-runtime's format_mac_address to its real callers (Windows/macOS/BSD/test; Linux reads the MAC preformatted from /sys), and allow(dead_code) on resolve_exports and the well_known provenance fields (read by the review gate + tests, not the link path). - Regenerated docs/src/api/reference.md + docs/api/perry.d.ts for the node-forge manifest entries added in #7033. - Dropped the now-passing test_gap_zlib_3285_params from the gap snapshot. * feat(compile): auto-provision native ext bindings and wasm host (#7118) Route emitted extension FFI families to their well-known providers, build missing CPU-only bindings and the wasm host, and carry custom target-dir artifacts through scanning and linking. Validate HarmonyOS SDK inputs before applying cross-build environments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
os.networkInterfaces()backend withGetAdaptersAddressesValidation
cargo test -p perry-runtime os_network::testscargo check --tests --no-default-features --features full,regex-engine,diagnostics --target x86_64-pc-windows-msvc -p perry-runtime./run_parity_tests.sh --suite node-suite --module os --filter network-interfaces-shapecargo fmt --all -- --checkdeno fmt --check test-parity/node-suite/os/collections/network-interfaces-shape.tsgit diff --checkFixes #6621
Summary by CodeRabbit
New Features
os.networkInterfaces().Bug Fixes
Tests