-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Error when canonicalizing path on RAM drive #48249
Comments
I wonder whether we actually need canonicalization here. It's very likely that normalization would be enough and not cause this issue by virtue of not hitting the filesystem. |
cc @rust-lang/compiler Is there any reason we need to do canonicalization, specifically the symbolic link resolution aspect? Turning relative paths into absolute paths can be done without canonicalization so if we don't actually need canonicalization... |
IIRC, canonicalization was the most robust way of getting Windows to transform paths into the |
I just got same error.
and got this errors: warning: could not canonicalize path: 'r:\rust_test\hello-world-cargo'
warning: could not canonicalize path: 'r:\rust_test\hello-world-cargo'
warning: could not canonicalize path: 'r:\rust_test'
warning: could not canonicalize path: 'r:\'
Compiling hello-world-cargo v0.1.0 (R:\rust_test\hello-world-cargo)
error: incremental compilation: error canonicalizing path `r:\rust_test\hello-world-cargo\target\debug\incremental\hello_world_cargo-35pjmbew4invf`: Incorrect function. (os error 1)
thread 'rustc' panicked at 'trying to get session directory from `IncrCompSession`: NotInitialized', src\librustc_session\session.rs:736:52
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.41.0 (5e1a79984 2020-01-27) running on i686-pc-windows-msvc
note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin
note: some of the compiler flags provided by cargo are hidden
error: aborting due to previous error
error: could not compile `hello-world-cargo`.
To learn more, run the command again with --verbose. Also, R is an in-memory drive created using ImDisk program. |
R:\...\rust_test-1apbc64jn2fjp
: Niepoprawna funkcja. (os error 1)
I saw this issue linked from #79449 The issue is basically that But you can use The procedure basically becomes to first call |
This can still fail if the drive was mounted to a directory and not a drive letter. |
Absolutely true too, if the path isn't mounted as a drive letter, it won't be found using QueryDosDeviceW. But chances are good that people will probably be using mounting tools with a drive letter. If they really need to mount in a subdirectory, they can use a different mounting program that makes use of the mount manager. Eventually you could just give up and return a path like But I'm sure nobody would ever expect a "Canonicalize" function to return a path beginning with |
Yes this has been considered before. It stalled on the "weirdness" factor though. If someone wants to push for again, I'd be minded to support them. I would ask though, why Dokan defaults to not integrating with the mount manager? Should that not be the default? Tbh, I'm confused why that's even an option. |
Using the mount manager causes Windows to immediately generate a Recycle Bin and System Volume Information folder. |
I created a new project using 'cargo new rust-test --bin'
Imported project to Intellij and clicked run. (without Intellij fails as well, just less text)
Console:
'Niepoprawna funkcja.' means 'invalid function'
R is an in-memory drive created using ImDisk program.
cargo new ... cargo run works fine on external ssd drive.
So in-memory drive is probably the cause. Reporting because console output says you will appreciate it.
The text was updated successfully, but these errors were encountered: