Skip to content

Miri dep-tests sometimes fail to find crate #149711

@RalfJung

Description

@RalfJung

I am not yet sure how to reproduce this, but while working on a combined rustc/Miri change I am now in a state where I cannot run any of the "dep" tests (e.g. via ./x test miri -- env). They all just error with:

error[E0460]: found possibly newer version of crate `core` which `lib` depends on
  --> tests/pass-dep/concurrency/env-cleanup-data-race.rs:LL:CC
   |
LL |             let s = libc::getenv("MIRI_ENV_VAR_TEST/0".as_ptr().cast());
   |                     ^^^^
   |
   = note: perhaps that crate needs to be recompiled?
   = note: the following crate versions were found:
           crate `core`: /home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/miri-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-46e04d29f5fdda95.rmeta
           crate `core`: /home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/miri-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-46e04d29f5fdda95.rlib
           crate `lib`: /home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-9c09f79981fe2cb3.rlib
           crate `lib`: /home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/debug/deps/liblibc-9c09f79981fe2cb3.rmeta

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0460`.

I tried deleting both of the directories mentioned there (miri-sysroot and deps) so they get rebuilt in a clean way, and I also deleted ./build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/tmp/miri_ui (where the Miri test suite builds its dependencies), but so far nothing helped. OTOH I also was not able to reproduce this in another checkout. Maybe there is some other old state left behind in the affected checkout, but I wouldn't know where that state could be or why it doesn't get automatically cleared.

Strangely, it seems like dependencies also get rebuilt each time. @oli-obk the ui-test output is not very clear here:

FAILED TEST: tests/pass-dep/libc/libc-env.rs
command: env -u RUSTFLAGS "/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage1/bin/cargo-miri" "miri" "run" "--target-dir" "/home/r/src/rust/rustc/build/x86_64-unknown-linux-gnu/stage1-tools/x86_64-unknown-linux-gnu/tmp/miri_ui/0" "--manifest-path" "tests/deps/Cargo.toml" "--target=x86_64-unknown-linux-gnu" "--message-format=json"


FAILED TEST: tests/pass-dep/concurrency/env-cleanup-data-race.rs
command: Building dependencies

FAILURES:
    tests/pass-dep/libc/libc-env.rs
    tests/pass-dep/concurrency/env-cleanup-data-race.rs

test result: FAIL. 2 failed; 50 filtered out

Error: 
   0: ui tests in tests/pass-dep for x86_64-unknown-linux-gnu failed
   1: tests failed

Location:
   /home/r/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ui_test-0.30.3/src/lib.rs:365

The error above is from the stderr file that gets created when I also add --bless.

Cc @bjorn3 -- I saw #149273; not sure if that is related. I didn't get such errors in the past so I wonder if something changed in the last few weeks/months that broke this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.E-needs-investigationCall for partcipation: This issues needs some investigation to determine current statusT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions