You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to run tests on dylib sub-crate in a workspace on Windows #39487
I have a workspace set up where the root crate is a normal library crate and one of the sub-crates has crate-type dylib. In this setup the tests on the sub-crate can't be executed. Running the test exe (cargo test --all) exits with exit code:
-1073741515
Which converted becomes: 0xC0000135 = STATUS_DLL_NOT_FOUND
And I get a graphical error message stating:
The program can't start because test-83fa84e3d0f7a116.dll is missing
from your computer. Try reinstalling the program to fix this problem.
And then another dialog with the same message but test- replaced with std-. The crate must both be part of the workspace and have the crate-type dylib to trigger this problem.
I tried this code:
root/Cargo.toml:
[package]
name = "root"version = "0.1.0"
[workspace]
members = ["dylib"]
root/dylib/Cargo.toml:
[package]
name = "dylib"version = "0.1.0"
[lib]
crate-type = ["dylib"]
And then I run cargo test --all in the root crate or cargo test in the dylib crate.
Meta
Happens on both stable and nightly: rustc 1.15.0 (10893a9a3 2017-01-19) rustc 1.16.0-nightly (24055d0f2 2017-01-31)
Same problem on both x86_64-pc-windows-msvc and x86_64-pc-windows-gnu. Tried both on my own machine and in appveyor. Same result.
Ok thanks for the confirmation @faern! In that case I'm going to close in favor of the upstream issue at rust-lang/rustup#893 (albeit somewhat oddly titled in relation to this issue)
Just for anyone else who might stumble on this. Fixing this problem is pretty easy. Just add the bin folder of your toolchain to PATH. In appveyor I did it like this in my install section:
- set PATH=%PATH%;C:\Users\appveyor\.rustup\toolchains\%RUST_VERSION%-%TARGET%\bin
Just since this is somehow the top result on Google for "STATUS_DLL_NOT_FOUND cargo build". How to trace and solve any random occurence:
Download SysInternals procexp64.exe (or just every tool). After startup immediately hit the looking glass 'Stop capture' button (Ctrl+E). And 'Clear' (Ctrl+X).
Set filters for:
'Process name' is 'build-script-build.exe' (or whatever the mentioned process name was) [Add]
'Result' is not 'SUCCESS' [Add]
'Path' ends with '.dll' [Add] [OK]
Start capture again (Ctrl+E).
Run build cargo again. Google for the last listed DLL file.
Activity
alexcrichton commentedon Feb 3, 2017
@faern do you have Rust installed through rustup? If so this looks like a familiar bug in rustup, but if not then sounds like something is awry!
faern commentedon Feb 3, 2017
@alexcrichton I have Rust installed through rustup, yes. I were not able to find a similar issue on github.
retep998 commentedon Feb 3, 2017
rust-lang/rustup#893
alexcrichton commentedon Feb 3, 2017
Ok thanks for the confirmation @faern! In that case I'm going to close in favor of the upstream issue at rust-lang/rustup#893 (albeit somewhat oddly titled in relation to this issue)
faern commentedon Feb 4, 2017
Great. I'll follow that issue.
Just for anyone else who might stumble on this. Fixing this problem is pretty easy. Just add the bin folder of your toolchain to PATH. In appveyor I did it like this in my
installsection:- set PATH=%PATH%;C:\Users\appveyor\.rustup\toolchains\%RUST_VERSION%-%TARGET%\bincjoecker commentedon Jun 9, 2020
This worked for me: