Skip to content

Invalid paths are suggested for "possibly newer version of crate" error on Windows #31306

Closed
@fhahn

Description

@fhahn

#30778 uncovered that on Windows (Rust compiled with msvc), additional paths are suggested when there's a newer version of a crate, e.g. e.g. for changing-crates.rs the following notes are emitted:

C:/bot/slave/auto-win-msvc-64-opt/build/src/test/compile-fail/changing-crates.rs:17:1: 17:16 note: crate `a` path #1: \\?\C:\bot\slave\auto-win-msvc-64-opt\build\obj\x86_64-pc-windows-msvc\test\compile-fail\changing-crates.stage2-x86_64-pc-windows-msvc.compile-fail.libaux\a.dll
C:/bot/slave/auto-win-msvc-64-opt/build/src/test/compile-fail/changing-crates.rs:17:1: 17:16 note: crate `b` path #1: \\?\C:\bot\slave\auto-win-msvc-64-opt\build\obj\x86_64-pc-windows-msvc\test\compile-fail\changing-crates.stage2-x86_64-pc-windows-msvc.compile-fail.libaux\b.dll
C:/bot/slave/auto-win-msvc-64-opt/build/src/test/compile-fail/changing-crates.rs:17:1: 17:16 help: please recompile this crate using --crate-type lib
C:/bot/slave/auto-win-msvc-64-opt/build/src/test/compile-fail/changing-crates.rs:17:1: 17:16 note: crate `a` path #1: x86_64-pc-windows-msvc/test/compile-fail\changing-crates.stage2-x86_64-pc-windows-msvc.compile-fail.libaux\a.dll.lib
C:/bot/slave/auto-win-msvc-64-opt/build/src/test/compile-fail/changing-crates.rs:17:1: 17:16 note: crate `a` path #2: C:\bot\slave\auto-win-msvc-64-opt\build\obj\x86_64-pc-windows-msvc\stage2\lib\rustlib\x86_64-pc-windows-msvc\lib\arena-db5a760f.dll.lib

The last two notes shouldn't be there. The first of those seem to point to the one already suggested, except that the first part is missing and slashes instead of backslashes are used. The last note suggests arena-db5a760f.dll.lib, but that does not seem right at all.

The following tests fail due to this issue (marked as // ignore-msvc for now)

[compile-fail] compile-fail/changing-crates.rs
[compile-fail] compile-fail/svh-change-lit.rs
[compile-fail] compile-fail/svh-change-significant-cfg.rs
[compile-fail] compile-fail/svh-change-trait-bound.rs
[compile-fail] compile-fail/svh-change-type-arg.rs
[compile-fail] compile-fail/svh-change-type-ret.rs
[compile-fail] compile-fail/svh-change-type-static.rs
[compile-fail] compile-fail/svh-use-trait.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-windowsOperating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions