Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo miri setup fails with space in username #2417

Closed
leontoeides opened this issue Jul 22, 2022 · 8 comments · Fixed by #2428
Closed

cargo miri setup fails with space in username #2417

leontoeides opened this issue Jul 22, 2022 · 8 comments · Fixed by #2428
Labels
A-cargo Area: affects the cargo wrapper (cargo miri) A-windows Area: affects only Windows targets C-bug Category: This is a bug.

Comments

@leontoeides
Copy link

leontoeides commented Jul 22, 2022

New install of miri. Compiling under Windows 10 with nightly-2022-03-10-x86_64-pc-windows-msvc toolchain.

When I run cargo miri test I get the following.

It looks like the space in the folder name "C:\Users\My Name\.rustup" is causing problems.

  process didn't exit successfully: `C:\Users\My Name\.rustup\toolchains\nightly-2022-03-10-x86_64-pc-windows-msvc\bin\cargo-miri.exe - --crate-name ___ --print=file-names -Cdebug-assertions=off -Coverflow-checks=on --sysroot C:\Users\My Name\AppData\Local\rust-lang\miri\cache\HOST -Z force-unstable-if-unmarked --target x86_64-pc-windows-msvc --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 1)
  --- stderr
  error: multiple input filenames provided (first two filenames are `-` and `Name\AppData\Local\rust-lang\miri\cache\HOST`)

error: `"\\\\?\\C:\\Users\\My Name\\.rustup\\toolchains\\nightly-2022-03-10-x86_64-pc-windows-msvc\\bin\\cargo.exe" "check" "--release" "--manifest-path" "C:\\Users\\MYNAME~1\\AppData\\Local\\Temp\\xargo.1JnaQcDy0Yi5\\Cargo.toml" "--target" "x86_64-pc-windows-msvc" "-p" "std"` failed with exit code: Some(101)
note: run with `RUST_BACKTRACE=1` for a backtrace
fatal error: failed to run xargo

@RalfJung
Copy link
Member

This looks like #705. That has hopefully been fixed fairly recently. Your nightly is from before the fix landed. However I was never able to test the fix since I don't have a Windows machine, so if you could upgrade to a more recent nightly (anything from July should do it, 2022-07-19 is the most recent one you can use) and test if that helps, that would be great. :)

@RalfJung RalfJung changed the title Error: failed to run rustc cargo miri setup fails with space in username Jul 22, 2022
@AngelicosPhosphoros
Copy link

Tried to reproduce but failed with another error:

output
PS C:\Users\Good Game\Downloads\tatata> rustup toolchain install nightly --component miri
info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
info: latest update on 2022-07-23, rust version 1.64.0-nightly (848090dcd 2022-07-22)
info: skipping nightly which is missing installed component 'miri'
info: syncing channel updates for 'nightly-2022-07-22-x86_64-pc-windows-msvc'
info: latest update on 2022-07-22, rust version 1.64.0-nightly (62b272d25 2022-07-21)
info: skipping nightly which is missing installed component 'miri'
info: syncing channel updates for 'nightly-2022-07-21-x86_64-pc-windows-msvc'
info: latest update on 2022-07-21, rust version 1.64.0-nightly (d68e7ebc3 2022-07-20)
info: skipping nightly which is missing installed component 'miri'
info: syncing channel updates for 'nightly-2022-07-20-x86_64-pc-windows-msvc'
info: latest update on 2022-07-20, rust version 1.64.0-nightly (9a7b7d5e5 2022-07-19)
info: skipping nightly which is missing installed component 'miri'
info: syncing channel updates for 'nightly-2022-07-19-x86_64-pc-windows-msvc'
info: latest update on 2022-07-19, rust version 1.64.0-nightly (f8588549c 2022-07-18)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'miri'
info: downloading component 'rust-docs'
 18.6 MiB /  18.6 MiB (100 %)   5.0 MiB/s in  4s ETA:  0s
info: downloading component 'rust-std'
 28.4 MiB /  28.4 MiB (100 %)   5.3 MiB/s in  4s ETA:  0s
info: downloading component 'rustc'
 62.9 MiB /  62.9 MiB (100 %)   8.8 MiB/s in  7s ETA:  0s
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'miri'
info: installing component 'rust-docs'
 18.6 MiB /  18.6 MiB (100 %)   1.8 MiB/s in 10s ETA:  0s
info: installing component 'rust-std'
 28.4 MiB /  28.4 MiB (100 %)  12.2 MiB/s in  2s ETA:  0s
info: installing component 'rustc'
 62.9 MiB /  62.9 MiB (100 %)  13.9 MiB/s in  4s ETA:  0s
info: installing component 'rustfmt'

  nightly-x86_64-pc-windows-msvc installed - rustc 1.64.0-nightly (f8588549c 2022-07-18)

info: checking for self-updates
PS C:\Users\Good Game\Downloads\tatata> cargo +nightly miri test
I will run `"\\\\?\\C:\\Users\\Good Game\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\bin\\cargo.exe" "install" "xargo"` to install a recent enough xargo. Proceed? [Y/n] Y
    Updating crates.io index
  Downloaded xargo v0.3.26
  Downloaded 1 crate (193.2 KB) in 3.11s
  Installing xargo v0.3.26
  Downloaded error-chain v0.12.4
  Downloaded dirs v4.0.0
  Downloaded walkdir v2.3.2
  Downloaded tempdir v0.3.7
  Downloaded dirs-sys v0.3.7
  Downloaded same-file v1.0.6
  Downloaded version_check v0.9.4
  Downloaded toml v0.5.9
  Downloaded semver v1.0.12
  Downloaded serde_json v1.0.82
  Downloaded ryu v1.0.10
  Downloaded winapi-util v0.1.5
  Downloaded itoa v1.0.2
  Downloaded fs2 v0.4.3
  Downloaded rustc_version v0.4.0
  Downloaded rand v0.4.6
  Downloaded libc v0.2.126
  Downloaded winapi v0.3.9
  Downloaded serde v1.0.140
  Downloaded remove_dir_all v0.5.3
  Downloaded 20 crates (2.4 MB) in 1.59s (largest was `winapi` at 1.2 MB)
   Compiling winapi v0.3.9
   Compiling serde v1.0.140
   Compiling version_check v0.9.4
   Compiling semver v1.0.12
   Compiling libc v0.2.126
   Compiling serde_json v1.0.82
   Compiling xargo v0.3.26
   Compiling ryu v1.0.10
   Compiling itoa v1.0.2
   Compiling error-chain v0.12.4
   Compiling rustc_version v0.4.0
   Compiling toml v0.5.9
   Compiling winapi-util v0.1.5
   Compiling remove_dir_all v0.5.3
   Compiling rand v0.4.6
   Compiling dirs-sys v0.3.7
   Compiling fs2 v0.4.3
   Compiling dirs v4.0.0
   Compiling same-file v1.0.6
   Compiling walkdir v2.3.2
   Compiling tempdir v0.3.7
    Finished release [optimized] target(s) in 56.22s
  Installing C:\Users\Good Game\.cargo\bin\xargo-check.exe
  Installing C:\Users\Good Game\.cargo\bin\xargo.exe
   Installed package `xargo v0.3.26` (executables `xargo-check.exe`, `xargo.exe`)
I will run `"rustup" "component" "add" "rust-src"` to install the `rust-src` component for the selected toolchain. Proceed? [Y/n] Y
info: downloading component 'rust-src'
info: installing component 'rust-src'
  Downloaded adler v0.2.3
  Downloaded cc v1.0.69
  Downloaded cfg-if v0.1.10
  Downloaded unicode-width v0.1.8
  Downloaded rustc-demangle v0.1.21
  Downloaded memchr v2.4.1
  Downloaded getopts v0.2.21
  Downloaded miniz_oxide v0.4.0
  Downloaded addr2line v0.16.0
  Downloaded object v0.26.2
  Downloaded compiler_builtins v0.1.73
  Downloaded hashbrown v0.12.0
  Downloaded gimli v0.25.0
  Downloaded 13 crates (1.5 MB) in 1.04s
   Compiling compiler_builtins v0.1.73
    Checking core v0.0.0 (C:\Users\Good Game\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core)
   Compiling libc v0.2.126
   Compiling cc v1.0.69
   Compiling memchr v2.4.1
   Compiling std v0.0.0 (C:\Users\Good Game\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std)
   Compiling unwind v0.0.0 (C:\Users\Good Game\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\unwind)
    Checking rustc-std-workspace-core v1.99.0 (C:\Users\Good Game\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\rustc-std-workspace-core)
    Checking alloc v0.0.0 (C:\Users\Good Game\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\alloc)
    Checking cfg-if v0.1.10
    Checking adler v0.2.3
    Checking rustc-demangle v0.1.21
    Checking rustc-std-workspace-alloc v1.99.0 (C:\Users\Good Game\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\rustc-std-workspace-alloc)
    Checking panic_abort v0.0.0 (C:\Users\Good Game\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\panic_abort)
    Checking panic_unwind v0.0.0 (C:\Users\Good Game\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\panic_unwind)
    Checking gimli v0.25.0
    Checking miniz_oxide v0.4.0
    Checking std_detect v0.1.5 (C:\Users\Good Game\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\stdarch\crates\std_detect)
    Checking object v0.26.2
    Checking hashbrown v0.12.0
    Checking addr2line v0.16.0
    Finished release [optimized] target(s) in 23.99s
    Checking rustc-std-workspace-std v1.99.0 (C:\Users\Good Game\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\rustc-std-workspace-std)
    Checking proc_macro v0.0.0 (C:\Users\Good Game\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\proc_macro)
    Checking unicode-width v0.1.8
    Checking getopts v0.2.21
    Checking test v0.0.0 (C:\Users\Good Game\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\test)
    Finished release [optimized] target(s) in 1.94s
   Compiling tatata v0.1.0 (C:\Users\Good Game\Downloads\tatata)
    Finished test [unoptimized + debuginfo] target(s) in 0.40s
     Running unittests src\lib.rs (target\miri\x86_64-pc-windows-msvc\debug\deps\tatata-ebb53c9214464671.exe)
error: test failed, to rerun pass '--lib'

Caused by:
  could not execute process `C:\Users\Good Game\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\bin\cargo-miri.exe "C:\Users\Good Game\Downloads\tatata\target\miri\x86_64-pc-windows-msvc\debug\deps\tatata-ebb53c9214464671.exe"` (never executed)
PS C:\Users\Good Game\Downloads\tatata> cargo +nightly miri test
    Finished test [unoptimized + debuginfo] target(s) in 0.00s
     Running unittests src\lib.rs (target\miri\x86_64-pc-windows-msvc\debug\deps\tatata-ebb53c9214464671.exe)
error: test failed, to rerun pass '--lib'

Caused by:
  could not execute process `C:\Users\Good Game\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\bin\cargo-miri.exe "C:\Users\Good Game\Downloads\tatata\target\miri\x86_64-pc-windows-msvc\debug\deps\tatata-ebb53c9214464671.exe"` (never executed)
PS C:\Users\Good Game\Downloads\tatata> cat .\src\lib.rs
#[cfg(test)]
mod tests {
    #[test]
    fn it_works() {
        let result = 2 + 2;
        assert_eq!(result, 4);
    }
}

@RalfJung
Copy link
Member

Hm, that looks like it got a lot further than before though, so that's good.

I don't know what is then going wrong though, or whether it is related to the spaces. Can you do cargo clean and then retry with cargo +nightly miri test -v?

@AngelicosPhosphoros
Copy link

PS C:\Users\Good Game\Downloads\tatata> cargo clean
PS C:\Users\Good Game\Downloads\tatata> cargo +nightly miri test -v
[cargo-miri miri] RUSTC_WRAPPER="C:\\Users\\Good Game\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\bin\\cargo-miri.exe"
[cargo-miri miri] CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_RUNNER="C:\\Users\\Good Game\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\bin\\cargo-miri.exe"
[cargo-miri miri] RUSTDOC="C:\\Users\\Good Game\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\bin\\cargo-miri.exe"
[cargo-miri miri] "\\\\?\\C:\\Users\\Good Game\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\bin\\cargo.exe" "test" "--target" "x86_64-pc-windows-msvc" "-v" "--target-dir" "C:\\Users\\Good Game\\Downloads\\tatata\\target\\miri" "--"
   Compiling tatata v0.1.0 (C:\Users\Good Game\Downloads\tatata)
     Running `C:\Users\Good Game\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\bin\cargo-miri.exe rustc --crate-name tatata --edition=2021 src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=d540f5115a1b48d3 -C extra-filename=-d540f5115a1b48d3 --out-dir "C:\Users\Good Game\Downloads\tatata\target\miri\x86_64-pc-windows-msvc\debug\deps" --target x86_64-pc-windows-msvc -C "incremental=C:\Users\Good Game\Downloads\tatata\target\miri\x86_64-pc-windows-msvc\debug\incremental" -L "dependency=C:\Users\Good Game\Downloads\tatata\target\miri\x86_64-pc-windows-msvc\debug\deps" -L "dependency=C:\Users\Good Game\Downloads\tatata\target\miri\debug\deps"`
     Running `C:\Users\Good Game\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\bin\cargo-miri.exe rustc --crate-name tatata --edition=2021 src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --test -C metadata=ebb53c9214464671 -C extra-filename=-ebb53c9214464671 --out-dir "C:\Users\Good Game\Downloads\tatata\target\miri\x86_64-pc-windows-msvc\debug\deps" --target x86_64-pc-windows-msvc -C "incremental=C:\Users\Good Game\Downloads\tatata\target\miri\x86_64-pc-windows-msvc\debug\incremental" -L "dependency=C:\Users\Good Game\Downloads\tatata\target\miri\x86_64-pc-windows-msvc\debug\deps" -L "dependency=C:\Users\Good Game\Downloads\tatata\target\miri\debug\deps"`
[cargo-miri rustc] "C:\\Users\\Good Game\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\bin\\miri" "--crate-name" "tatata" "--edition=2021" "src\\lib.rs" "--error-format=json" "--json=diagnostic-rendered-ansi,artifacts,future-incompat" "--crate-type" "lib" "--emit=dep-info,metadata" "-C" "embed-bitcode=no" "-C" "debuginfo=2" "-C" "metadata=d540f5115a1b48d3" "-C" "extra-filename=-d540f5115a1b48d3" "--out-dir" "C:\\Users\\Good Game\\Downloads\\tatata\\target\\miri\\x86_64-pc-windows-msvc\\debug\\deps" "--target" "x86_64-pc-windows-msvc" "-C" "incremental=C:\\Users\\Good Game\\Downloads\\tatata\\target\\miri\\x86_64-pc-windows-msvc\\debug\\incremental" "-L" "dependency=C:\\Users\\Good Game\\Downloads\\tatata\\target\\miri\\x86_64-pc-windows-msvc\\debug\\deps" "-L" "dependency=C:\\Users\\Good Game\\Downloads\\tatata\\target\\miri\\debug\\deps" "--sysroot" "C:\\Users\\Good Game\\AppData\\Local\\rust-lang\\miri\\cache\\HOST"
[cargo-miri rustc] writing stub dep-info to `C:\Users\Good Game\Downloads\tatata\target\miri\x86_64-pc-windows-msvc\debug\deps\tatata-ebb53c9214464671.d`
[cargo-miri rustc] writing run info to `C:\Users\Good Game\Downloads\tatata\target\miri\x86_64-pc-windows-msvc\debug\deps\tatata-ebb53c9214464671`
    Finished test [unoptimized + debuginfo] target(s) in 0.33s
     Running `C:\Users\Good Game\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\bin\cargo-miri.exe "C:\Users\Good Game\Downloads\tatata\target\miri\x86_64-pc-windows-msvc\debug\deps\tatata-ebb53c9214464671.exe"`
error: test failed, to rerun pass '--lib'

Caused by:
  could not execute process `C:\Users\Good Game\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\bin\cargo-miri.exe "C:\Users\Good Game\Downloads\tatata\target\miri\x86_64-pc-windows-msvc\debug\deps\tatata-ebb53c9214464671.exe"` (never executed)

@RalfJung
Copy link
Member

Hm, I still don't understand this error:

  could not execute process `C:\Users\Good Game\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\bin\cargo-miri.exe "C:\Users\Good Game\Downloads\tatata\target\miri\x86_64-pc-windows-msvc\debug\deps\tatata-ebb53c9214464671.exe"` (never executed)

What does "never executed" mean? Is that a windows thing?

Looks like the error is coming from cargo when it tries to invoke us as TARGET_RUNNER. Somehow that fails.

@RalfJung
Copy link
Member

Oh... looks like cargo does word-splitting on these TARGET_*_RUNNER variables. :(

Unfortunately that is not something we can fix in Miri. I reported this as a bug against cargo: rust-lang/cargo#10892. Until that is fixed, Miri will not work on Windows if the path where rustup installed Rust contains a whitespace.

@RalfJung RalfJung added C-bug Category: This is a bug. A-cargo Area: affects the cargo wrapper (cargo miri) A-windows Area: affects only Windows targets labels Jul 23, 2022
@bors bors closed this as completed in 17bb2c0 Jul 24, 2022
@RalfJung
Copy link
Member

@leontoeides @AngelicosPhosphoros the latest nightly should have a fix for this. Could you try this again?

@leontoeides
Copy link
Author

leontoeides commented Jul 26, 2022

Excellent work! I am able to get further along now. This issue is closed for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cargo Area: affects the cargo wrapper (cargo miri) A-windows Area: affects only Windows targets C-bug Category: This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants