Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #13131 - ChrisDenton:windows-manifest, r=ehuss
Add a windows manifest file This adds a Windows [application manifest file](https://docs.microsoft.com/en-us/windows/win32/sbscs/application-manifests) to the built `cargo.exe` for windows msvc. This manifest file is used to enable modern features of Windows. [`rustc`](https://github.com/rust-lang/rust/tree/7df0c211ace4157009eebd015f1a083490faa0bc/compiler/rustc) has been using a similar manifest for about a year now. The manifest file does the following: * States our compatibility with Windows versions 7, 8, 8.1, 10 and 11. This allows avoiding unnecessary compatibility shims. * Sets the code page to UTF-8. This should have no real impact on existing code (which should work with any code page). That said it may avoid issues if dependencies do use the local code page because conversions to/from Unicode are lossy so if a Unicode code point has no local code page equivalent, information is lost. * Enable long path awareness. Mostly rust itself side-steps long path issues by using `\\?\` paths internally. However, this doesn't work for the current directory whereas using this option does. You can test that a manifest file has been embedded by extracting it to a new file: mt -nologo -inputresource:cargo.exe -out:embedded.manifest You can also examine the `.rsrc` (aka resource) section using `dumpbin` dumpbin /SECTION:.rsrc /ALL cargo.exe ### Additional info This also sets the [`/Wx` linker option](https://learn.microsoft.com/en-us/cpp/build/reference/wx-treat-linker-warnings-as-errors?view=msvc-170) which turns linker warnings into errors. When setting linker options manually, I prefer to also set this because, unless there are also linker errors, `rustc` will not show linker warnings by default. Linker warnings should be rare and usually do indicate an actual problem so not ignoring them should be fine.
- Loading branch information