Conversation
Add XSUM_widenStringAsUncPath which converts UTF-8 path to absolute UNC path with "\\?\" prefix.
|
For some reason, GH actions for MinGW fails at the following line of the Line 207 in fb93aa4 Error log |
|
I can't reproduce above error in my local msys environment. But here is a different issue from my local environment: Is this line fine? xxHash/tests/collisions/main.c Line 772 in 7aee8d0 Allocation size of size_t const tableSize = (size_t)((maxNbH+1) * hashByteSize);
...
void* const hashCandidates = malloc(tableSize);But size for Since Also, when I put |
|
This is great but also I think that Windows requires that there specifically be a manifest in the exe file. Looking into it, I think that we can simply make a file called xxhsum.manifest alongside the xxhsum.c and then cmake will automatically pick that up and link it in: https://cmake.org/cmake/help/v3.4/release/3.4.html#other Suggested xxhsum.manifest: |
|
@29039 While a manifest file is convenient, my goal is to provide broader compatibility. Please also note that this patch works correctly even without a manifest file. |
Note: So far it contains #pragma comment(lib) and pathcch.lib which only supports Windows 8+ or Windows Server 2012+. This issue must be fixed. This function supports 3 types of absolute path - Classic DOS path (C:\...) - Extended length path (\\?\...) - UNC path (\\...) Also relative path is properly converted to extended length path (\\?\...)
Now WIN32 CLI supports a file which ends with '.'. E.g. "my_file." test_trailing_period.bat tests it.
|
WIP. But now this PR supports long-path, UNC path and trailing period. e.g. TODO:
|
To keep compatibility, now CMakeFile.txt detects MSVC + Win10+ automatically. If user want to use MinGW, set XXHASH_WIN_TARGET_WIN10 to cmake. They set XXHSUM_WIN32_LONGPATH for C preprocessor.
|
Added cmake option
When cmake uses This switch enables long-path code via preprocessor macro |
|
Therefore, its result depends on Win10 version. ( So we need to check runtime Windows version for it. But it may be over-engineering for this small utility. Possible solutions are:
|
|
Sorry, just noticed this question:
I think that's reasonable |
|
@Cyan4973 , thanks. I forgot to add |
|
This PR is still tagged as "Draft". So at which stage is it ? cc @t-mat |
This PR fixes #1060.
XSUM_widenStringAsUncPath()incli/xsum_os_specific.c.XSUM_fopen()andXSUM_stat()use this new function.\\?\prefix.wchar_tpath.\\?\prefix.\\?\prefix automatically avoids classic DOS device quirks (e.g.COM1,NUL, etc)\\?\prefix is supported from Windows 2000. But I can't find any source from Microsoft :(tests/windows/00-test-all.batinvokes all tests.tests/windows/build-with-cmake.batbuildsxxhsumwithcmaketests/windows/test-long-path.battests issue xxhsum.exe Long MAX_PATH support over 260 characters in the path #1060.!__!tracks line number.:ERRORroutine uses it to indicate error with line number.