-
Notifications
You must be signed in to change notification settings - Fork 362
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
b3sum does not support long path names on Windows 10 #145
Comments
I don't think we do anything particularly interesting with paths, other than get them from |
Same issue when using --no-mmap |
Enable Long Paths in Windows 10, Version 1607, and Later
|
As explained in the above link, the registry key is necessary but not sufficient, you also need an application manifest embedded within the executable. AFAIK, neither rustc nor cargo currently embed an application manifest; see rust-lang/rfcs#721 and rust-lang/cargo#7986 (and as a comment on the later points out, all the operating-system-specific code in the rust standard library and in any included C or Rust library must be audited first to make sure they won't break with paths longer than 260 characters). There seems to be a workaround to embed an application manifest: see https://crates.io/crates/embed_resource and as an example of it being used watchexec/watchexec#163 (watchexec/watchexec@570ed3a and watchexec/watchexec@838103f). And there's also another workaround, which is to use an external (non-embedded) application manifest: if there's a file called |
Internally, could you access files using UNC-style long paths to get around this limit? |
Tested on Windows 10 20H2 with b3sum_windows_x64_bin.exe 0.3.7 .\b3sum_windows_x64_bin.exe \\?\E:\Downloads\00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\AAA0000000000.txt
16b3a442c222b958453e73cb818a51a060bed10b9bf6649f2bbb43a9e57bff78 //?/E:/Downloads/00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000/AAA0000000000.txt |
These are the steps I followed to get Enable OS support for Windows 10 with the registry update:
Download load Windows SDK ISO: https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk/ Double click the ISO to mount it as a drive letter. Extract the msiexec /a "F:\Installers\Windows SDK for Windows Store Apps Tools-x86_en-us.msi" TARGETDIR="Full_Extract_Folder_Path" /qb You'll find Verify that path-to\mt.exe -inputresource:b3sum.exe -out:exported.manifest
\Windows Kits\10\bin\10.0.19041.0\x64\mt.exe You should see
In the same path where you have <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
</assembly> Embed the manifest inside path-to\mt.exe -manifest b3sum.exe.manifest -outputresource:b3sum.exe;1 That's it. Test |
Windows 10 1607 (and later) support path names longer than 260 characters. b3sum should support long path names as well. currently it will throw and error (os error 3).
The text was updated successfully, but these errors were encountered: