Fix CI clippy failure: unused imports in sandbox.rs tests on non-macOS targets#158
Merged
Merged
Conversation
Tasks: - T20260508-10: Fix CI clippy failure: unused imports in sandbox.rs tests on non-macOS targets
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.
Task
T20260508-10 — Fix CI clippy failure: unused imports in sandbox.rs tests on non-macOS targets
Description
Problem
./scripts/ci-guardrails.shfails on Linux with:CI runs
cargo clippy --workspace --all-targets -- -D warnings(seescripts/ci-guardrails.sh:8). On macOS the same command passes clean, so the regression is invisible to local-mac development.Why It Matters
CI is currently red on the standard guardrails workflow. Every PR opened from a non-macOS runner blocks on this one error. Beyond unblocking CI, this is also a structural reminder that local clippy on macOS does not exercise the
#[cfg(not(target_os = "macos"))]paths insandbox.rs, so the same class of cfg-skew can recur.Root Cause
In crates/orbit-core/src/runtime/v2_host/sandbox.rs:
testsmodule imports three symbols at sandbox.rs:188-190:runtime_with_workspace_layout,seed_executor,seeded_runtime_with_executor.seeded_runtime_with_executoris used by tests under both#[cfg(target_os = "macos")]and#[cfg(not(target_os = "macos"))](sandbox.rs:194, sandbox.rs:286).runtime_with_workspace_layoutandseed_executorare referenced only inside#[cfg(target_os = "macos")]tests (sandbox.rs:233-238).On non-macOS builds the macOS-only tests are compiled out, so those two imports become unused and
-D warningsupgrades the lint to an error.Constraints / Notes
#[allow(unused_imports)]— fix the cfg-gating so each import is only present when consumed.usestatement into a shared import plus a#[cfg(target_os = "macos")]-gated import; or move the macOS-only imports into the macOS-only test functions; or refer tocrate::runtime::v2_host::test_support::*symbols by full path inside the macOS-only tests.crates/orbit-core/src/runtime/v2_host/test_support.rs— the symbols there are correctly exported.-D warningsbuild aborts on the first error, so additional warnings may have been masked).cargo clippy --workspace --all-targets --target x86_64-unknown-linux-gnu -- -D warningsif that target's std is installed locally; otherwise rely on CI re-run.Acceptance Criteria
./scripts/ci-guardrails.shexits 0 (covers fmt --check, clippy -D warnings, full workspace test, and the dependency-direction / cli-imports scripts).cargo clippy --workspace --all-targets -- -D warningsexits 0. Verifiable either by running on a Linux host/container, by--target x86_64-unknown-linux-gnuif the cross-target stdlib is installed, or by a re-run of the GitHub Actions ci-guardrails workflow showing a green check.crates/orbit-core/src/runtime/v2_host/sandbox.rscontains no#[allow(unused_imports)]attribute (greppable:grep -n 'allow(unused_imports)' crates/orbit-core/src/runtime/v2_host/sandbox.rsreturns nothing).cargo test --workspace -p orbit-corecontinues to compile and run theresolve_executor_sandbox_*tests insandbox.rs, including the#[cfg(target_os = "macos")]ones; no test is removed or skipped as part of the fix.crates/orbit-core/src/runtime/v2_host/sandbox.rs. Changes totest_support.rs,Cargo.tomllints, or other modules are out of scope unless required to satisfy the clippy gate.-D warningspreviously aborted on the first), they are also resolved within this task; the final ci-guardrails run is fully green.Execution Summary
Click to expand
Status
success
Summary of Changes
Split the sandbox.rs test-support import so seeded_runtime_with_executor remains available on every target while runtime_with_workspace_layout and seed_executor are imported only for macOS tests. No #[allow(unused_imports)] was added.
Overall Assessment
The scoped Linux cfg-skew clippy failure is fixed with a one-file diff limited to crates/orbit-core/src/runtime/v2_host/sandbox.rs.
Validation
Design Weaknesses / Risks
Validation
Branch Freshness
origin/agent-mainorbit/T20260508-10-69fd62a0authored by: claude-opus-4-7