Description
The compiler heavily relies on hard-linking for managing the incremental compilation cache, but hard links are not available on all file systems. The compiler will fall back to actually copying the files which is potentially much slower. We should try to make the compiler detect if hard-linking is not available and suggest to the user that they move the cache directory onto a file system that supports hard links.
File systems that don't support hard links are FAT32, exFAT, and ReFS, and probably others. We could either try to somehow detect whether we are on one of those directly, or, maybe more robustly, just issue a general warning if all hard-linking fails but all copying succeeds.
See https://github.com/rust-lang/rust/blob/master/src/librustc_incremental/persist/fs.rs for relevant code.