Skip to content

Miri tests on Windows require admin for symlinks #3587

Closed
@RossSmyth

Description

@RossSmyth

This is on Windows 10 on commit 28ab963. I can replicate the issue on both of my computers.

  1. .\miri toolchain
  2. .\miri test

Tests pass successfully

  1. .\miri toolchain
  2. $Env:MIRI_TEST_TARGET="x86_64-unknown-linux-gnu"
  3. .\miri test
FAILED TEST: tests/pass\shims\fs.rs
command: "C:\\Users\\rsmyth\\Documents\\miri\\target\\debug\\miri.exe" "--error-format=json" "--sysroot=C:\\Users\\rsmyth\\AppData\\Local\\rust-lang\\miri\\cache" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--target" "x86_64-unknown-linux-gnu" "--out-dir" "C:\\Users\\rsmyth\\Documents\\miri\\target\\ui\\tests\\pass\\shims" "tests/pass\\shims\\fs.rs" "-Zmiri-disable-isolation" "--edition" "2021"

error: pass test got exit code: 1, but expected 0

error: actual output differed from expected
Execute `./miri test --bless` to update `tests/pass\shims\fs.stderr` to the actual output
--- tests/pass\shims\fs.stderr
+++ <stderr output>
+error: unsupported operation: io error Uncategorized cannot be translated into a raw os error
+  --> RUSTLIB/std/src/sys/pal/PLATFORM/fs.rs:LL:CC
+   |
+LL |             cvt(unsafe { libc::symlink(original.as_ptr(), link.as_ptr()) }).map(|_| ())
+   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ io error Uncategorized cannot be translated into a raw os error
+   |
+   = help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
+   = note: BACKTRACE:
+   = note: inside closure at RUSTLIB/std/src/sys/pal/PLATFORM/fs.rs:LL:CC
+   = note: inside `std::sys::pal::PLATFORM::small_c_string::run_with_cstr_stack::<()>` at RUSTLIB/std/src/sys/pal/PLATFORM/small_c_string.rs:LL:CC
+   = note: inside `std::sys::pal::PLATFORM::small_c_string::run_with_cstr::<()>` at RUSTLIB/std/src/sys/pal/PLATFORM/small_c_string.rs:LL:CC
+   = note: inside `std::sys::pal::PLATFORM::small_c_string::run_path_with_cstr::<()>` at RUSTLIB/std/src/sys/pal/PLATFORM/small_c_string.rs:LL:CC
+   = note: inside closure at RUSTLIB/std/src/sys/pal/PLATFORM/fs.rs:LL:CC
+   = note: inside `std::sys::pal::PLATFORM::small_c_string::run_with_cstr_stack::<()>` at RUSTLIB/std/src/sys/pal/PLATFORM/small_c_string.rs:LL:CC
+   = note: inside `std::sys::pal::PLATFORM::small_c_string::run_with_cstr::<()>` at RUSTLIB/std/src/sys/pal/PLATFORM/small_c_string.rs:LL:CC
+   = note: inside `std::sys::pal::PLATFORM::small_c_string::run_path_with_cstr::<()>` at RUSTLIB/std/src/sys/pal/PLATFORM/small_c_string.rs:LL:CC
+   = note: inside `std::sys::pal::PLATFORM::fs::symlink` at RUSTLIB/std/src/sys/pal/PLATFORM/fs.rs:LL:CC
+   = note: inside `std::os::unix::fs::symlink::<&std::path::PathBuf, &std::path::PathBuf>` at RUSTLIB/std/src/os/unix/fs.rs:LL:CC
+note: inside `test_symlink`
+  --> $DIR/fs.rs:LL:CC
+   |
+LL |     std::os::unix::fs::symlink(&path, &symlink_path).unwrap();
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: inside `main`
+  --> $DIR/fs.rs:LL:CC
+   |
+LL |     test_symlink();
+   |     ^^^^^^^^^^^^^^
+
+note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
+
+error: aborting due to 1 previous error
+

This seems to happen on *nix targets as it happens on *-apple-darwin as well.

Based upon the instructions inside the test I looked for miri_ files, but there were none in the tmp directory. Also setting TMPDIR or MIRI_TEMP to other paths had no affect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-devArea: working on Miri as a developerA-windowsArea: affects only Windows targetsC-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions