-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Properly support for Windows long file paths through Unicode Win32 API calls. #2410
base: master
Are you sure you want to change the base?
Commits on May 7, 2024
-
util.c: Add UTF8ToWin32Unicode() + Win32UnicodeToUTF8()
UTF8ToWin32Unicode() converts an UTF-8 string into the corresponding Windows UCS-2 one, and will be used to call Unicode Win32 API directly, in order to properly support long file paths everywhere. Win32UnicodeToUTF8() does the opposite, and will generally be used to display such native Win32 paths in error messages.
Configuration menu - View commit details
-
Copy full SHA for 52ba96e - Browse repository at this point
Copy the full SHA 52ba96eView commit details -
Add SystemDiskInterface and NullDiskInterface classes.
Add an intermediate DiskInterface derived class named SystemDiskInterface that performs real disk i/o without any intermediate caching. RealDiskInterface is now a derived class of SystemDiskInterface that adds a caching layer on Win32 only. Keeping the same name reduces the number of changes in this commit to the strict minimum. NullDiskInterface is provided to simplify custom DiskInterface implementations used in tests, in particular because new DiskInterface methods are going to be added in future commits, and adding the same method overrides NullDiskInterface will lower the changes to do in those implementations.
Configuration menu - View commit details
-
Copy full SHA for 947c82f - Browse repository at this point
Copy the full SHA 947c82fView commit details -
Remove Win32 ANSI calls from DiskInteface
Ensure Win32 Unicode APIs are called when trying to perform real disk i/o. This is necessary to properly support long file paths on Windows. For example, FindFirstFileExW() used in RealDiskInterface has not MAC_PATH restriction, though FindFirstFileExA() still does, even when long path support is enabled on the host machine. Note that generally speaking, it is unknown whether Windows CRT functions, such as fopen(), rename(), _unlink(), always properly support long file paths (it may very well depend on the version of MSVCRT linked to the executable), so it is better to err on the side of caution and always try to use the wide-char versions of these functions, when available, or to fall back to Unicode Win32 API functions otherwise. This applies here and the commits following this one in the same pull request.
Configuration menu - View commit details
-
Copy full SHA for 4290828 - Browse repository at this point
Copy the full SHA 4290828View commit details -
util.c: ReadFile(): support Win32 long paths.
Use CreateFileW() to ensure proper long path support on Win32.
Configuration menu - View commit details
-
Copy full SHA for 7874b1e - Browse repository at this point
Copy the full SHA 7874b1eView commit details -
Configuration menu - View commit details
-
Copy full SHA for bb6fc34 - Browse repository at this point
Copy the full SHA bb6fc34View commit details -
minidump-win32.cc: Use Win32 Unicode APIs.
+ Allow it to compile with cross-toolchains like Mingw.
Configuration menu - View commit details
-
Copy full SHA for c43020a - Browse repository at this point
Copy the full SHA c43020aView commit details -
Configuration menu - View commit details
-
Copy full SHA for eebdcc9 - Browse repository at this point
Copy the full SHA eebdcc9View commit details -
Configuration menu - View commit details
-
Copy full SHA for f78927e - Browse repository at this point
Copy the full SHA f78927eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7c40cef - Browse repository at this point
Copy the full SHA 7c40cefView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5771d8a - Browse repository at this point
Copy the full SHA 5771d8aView commit details -
BuildLog: Use DiskInterface instance.
Make the BuildLog class take a DiskInterface reference in its constructor, to ensure that all i/o operations use the same interface. + Adjust call sites accordingly. For tests, always use a SystemDiskInterface instead of the VirtualFileSystem instance when the latter is available, as this is exactly what the previous code was doing.
Configuration menu - View commit details
-
Copy full SHA for 5996e69 - Browse repository at this point
Copy the full SHA 5996e69View commit details -
Configuration menu - View commit details
-
Copy full SHA for e4085e5 - Browse repository at this point
Copy the full SHA e4085e5View commit details