[GH-ISSUE #5213] horizon-port-pack tests fail to compile on Windows due to ungated std::os::unix #1594

Closed
opened 2026-11-02 15:48:15 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @DmytroChup on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5213

Originally assigned to: @DmytroChup on GitHub.

🤖 Filed by DmytroChup's AI agent, not by DmytroChup personally.

Description

PR #5198 (commit 3f7e92d6a) added two new unit tests in crates/horizon-port-pack/src/resourcepacks/tests.rs:

  • a_home_behind_a_link_takes_its_packs
  • a_link_below_the_base_is_refused

Both tests import std::os::unix::fs::symlink, but unlike symlinks_at_source_and_destination_are_rejected (which is gated with #[cfg(unix)]), these two tests are missing #[cfg(unix)].

Build error on Windows

Running cargo test -p horizon-port-pack --no-run fails with:

error[E0433]: cannot find unix in os --> crates\horizon-port-pack\src\resourcepacks\tests.rs:229:18 | 229 | use std::os::unix::fs::symlink; | ^^^^ could not find unix in os

error[E0433]: cannot find unix in os --> crates\horizon-port-pack\src\resourcepacks\tests.rs:252:18 | 252 | use std::os::unix::fs::symlink; | ^^^^ could not find unix in os

Expected Behavior

Unit tests using Unix-specific std::os::unix APIs should be gated with #[cfg(unix)] so that the test suite compiles and runs on Windows.

Originally created by @DmytroChup on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5213 Originally assigned to: @DmytroChup on GitHub. > 🤖 Filed by DmytroChup's AI agent, not by DmytroChup personally. ### Description PR #5198 (commit `3f7e92d6a`) added two new unit tests in `crates/horizon-port-pack/src/resourcepacks/tests.rs`: - `a_home_behind_a_link_takes_its_packs` - `a_link_below_the_base_is_refused` Both tests import `std::os::unix::fs::symlink`, but unlike `symlinks_at_source_and_destination_are_rejected` (which is gated with `#[cfg(unix)]`), these two tests are missing `#[cfg(unix)]`. ### Build error on Windows Running `cargo test -p horizon-port-pack --no-run` fails with: error[E0433]: cannot find unix in os --> crates\horizon-port-pack\src\resourcepacks\tests.rs:229:18 | 229 | use std::os::unix::fs::symlink; | ^^^^ could not find unix in os error[E0433]: cannot find unix in os --> crates\horizon-port-pack\src\resourcepacks\tests.rs:252:18 | 252 | use std::os::unix::fs::symlink; | ^^^^ could not find unix in os ### Expected Behavior Unit tests using Unix-specific `std::os::unix` APIs should be gated with `#[cfg(unix)]` so that the test suite compiles and runs on Windows.
Author
Owner

@DmytroChup commented on GitHub (Oct 31, 2026):

/claim

<!-- gh-comment-id:6545459253 --> @DmytroChup commented on GitHub (Oct 31, 2026): /claim
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
horizon-rust/horizon#1594
No description provided.