Repository navigation
nvx: limit platform-only checks to the platform module - #2307
Merged
Pedro Henrique Penna (ppenna) merged 1 commit intoNov 28, 2026
Merged
Pedro Henrique Penna (ppenna) merged 1 commit into
Pedro Henrique Penna (ppenna) merged 1 commit into
Conversation
check_working_dir and check_owner_only_dir were crate-visible although only host::platform uses them, so make them private. Fixes #2304 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the changes making three platform-internal helpers private.
No open issues 🎉
What changed in this PR
Addresses #2304 by making three platform-internal helpers private, matching their actual usage within nvx::host::platform. Runtime behavior, error messages, and the public API remain unchanged.
Changes:
- Makes the Windows working-directory check private while preserving access from descendant modules.
- Makes the Linux and unsupported-host owner-only directory checks private to their respective modules.
| File | Description |
|---|---|
nvx/src/host/platform/other.rs |
Makes the fallback check_owner_only_dir private. |
nvx/src/host/platform/mod.rs |
Makes Windows-only check_working_dir private. |
nvx/src/host/platform/linux/private.rs |
Makes Linux’s check_owner_only_dir private. |
Review effort: Balanced
Pedro Henrique Penna (ppenna)
deleted the
agents/issue-2304-limit-platform-check-helpers
branch
November 28, 2026 15:51
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.
Fixes #2304
What does this pull request change?
Makes three helpers of
nvx::host::platformprivate instead ofpub(crate), since only the platform module uses them:check_working_dirinnvx/src/host/platform/mod.rs(Windows only), whose one caller isspawn_listedinplatform/windows/spawn.rs, a descendant ofplatform. That module can still reach a private item of its ancestor.check_owner_only_dirinplatform/linux/private.rsandplatform/other.rs, which is called only bycheck_published_dirin the same file, and which nomod.rsre-exports.Behavior, error messages, and the public API of
nvxare unchanged. The diff changes 3 lines.Why is this change needed?
The crate-wide visibility made these checks look like crate-level helpers. Limiting each to the module that uses it states its real scope and keeps new callers from depending on platform internals. Making
check_working_dirpub(super)was rejected because, inplatform/mod.rs, that would expose it to all ofhost.How was this change validated?
Checks and results:
python scripts\local_gates.py --base origin/dev --runon Windows: test-changes, markdown-links, test-layout, nvx-format, nvx-lint, nvx-test, nvx-doc, nvx-msrv, and nvx-cli all passed.nvxwithNVX_BUNDLE=skip:cargo clippy --locked --all-targets --all-features -- -D warnings: passed.cargo test --locked --all-features --lib host::platform: 27 passed.python scripts/check_test_changes.py --base origin/dev: 0 changes to existing tests.Backend, host OS, host type, and guest: none. This is a compile-time visibility change and boots no microVM.
Left to CI: the microVM scenarios that local_gates selects for whp/kvm/mshv, Linux check-nvx on its runners, and benchmarks. No configured KVM host was reachable.
Checklist
python3 scripts/check_test_layout.pychecks.python3 scripts/check_test_changes.py --base origin/devlists no changeto an existing test, or a Changes to existing tests section below
explains each one.
.github/copilot-instructions.mdand the skills when a convention orworkflow changes.
nvxupdatesnvx/public-api/withpython3 scripts/public_api.py --update.description says how the change versions or migrates them.