Description
I updated cargo to 0.73 from crates.io in cargo-udeps (commit) and got the following build failure on ci:
error[E0432]: unresolved import `windows_sys::Win32::Storage::FileSystem::LockFileEx`
--> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cargo-0.73.0\src/cargo\util\flock.rs:443:9
|
443 | LockFileEx, UnlockFile, LOCKFILE_EXCLUSIVE_LOCK, LOCKFILE_FAIL_IMMEDIATELY,
| ^^^^^^^^^^
| |
| no `LockFileEx` in `Windows::Win32::Storage::FileSystem`
| help: a similar name exists in the module: `LockFile`
For more information about this error, try `rustc --explain E0432`.
error: could not compile `cargo` (lib) due to previous error
If you look at the rustdoc for LockFileEx, it writes:
Required features: "Win32_Storage_FileSystem", "Win32_Foundation", "Win32_System_IO"
Compare this with the Cargo.toml of 0.73:
Lines 180 to 188 in 103a7ff
The former two are found while Win32_System_IO
isn't present. I suppose this is the cause for the failure: in the cargo
repo this works fine because of dependency unification and another crate in the DAG enabling the Win32_System_IO
features. But if you use cargo
from crates.io, then it is not enabled, which is what I ran into.
The fix is simple, just add Win32_System_IO
to the list. Ideally this would also be published in a new release.
I have worked around the issue by making cargo-udeps depend on windows-sys and enabling the feature (commit).