Repository navigation
Conversation
Since 26e75c4 the mod runtime passes \\?\ paths to std::filesystem. With the documented MSYS2 mingw64 toolchain (GCC 16.2) the status calls go through the CRT's stat, which rejects extended paths: create_directories fails with EINVAL, is_directory, is_regular_file and exists report nothing there, and remove reports nothing removed. The runtime then fails at "cannot create mods directory" and the host runs without mods; mod_presentation_only_test and long_path_test fail in run_c_tests.sh. ModPaths now has kind/exists/is_directory/is_regular_file/is_symlink, create_directories and remove, which use GetFileAttributesW, CreateDirectoryW, DeleteFileW and RemoveDirectoryW on Windows and the std::filesystem calls elsewhere. The runtime and the long-path fixture use them; rename and the file streams keep working with extended paths. The relative-input case of long_path_test now runs from the fixture root: lexically_relative(current_path()) returned an empty path when the caller's directory spelled the drive letter "c:" and the fixture "C:".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since 26e75c4 (#282) the mod runtime hands
\\?\paths tostd::filesystem. With the MSYS2 mingw64 toolchain from the README (GCC 16.2 here), libstdc++'s status calls go through the CRT'sstat, which doesn't accept extended paths:\\?\pathcreate_directoriesEINVAL, also when the directory existsis_directory,is_regular_file,existsENOENT)removecreate_directory,rename,ifstream/ofstreamSo on Windows
scan()stops at "cannot create mods directory: Invalid argument", the host printsmods: unavailable, andrun_c_tests.shfails inmod_presentation_only_test.long_path_testfails in its own fixture setup (create_directories(fixture_io(...))).Change
ModPathsgetskind,exists,is_directory,is_regular_file,is_symlink,create_directoriesandremove. On Windows they useGetFileAttributesW,CreateDirectoryW,DeleteFileWandRemoveDirectoryWon the extended path; elsewhere they're thestd::filesystemcalls.create_directorieswalks the plain absolute path and creates each missing level through its extended form.mod_runtime.cppuses them where it passedfor_io(...)to a status call,create_directoriesorremove.renameand the streams stay as they are.long_path_testuses them for its fixture (creating directories, checking, the payload removal and cleanup).above.lexically_relative(fs::current_path())returned an empty path when the caller's directory spelled the drive letterc:and the fixtureC:(Windows keeps whatever spelling the caller used), so the case tested an empty path, and whether it passed depended on the caller's directory.Testing
On Windows 11, MSYS2 mingw64 GCC 16.2:
mod_presentation_only_testfails with "cannot create mods directory: Invalid argument";long_path_testfails with "filesystem error: cannot create directories: Invalid argument".long_path_testwith the working directory spelledC:\…andc:\….I haven't built it with MSVC or on Linux/macOS. Off Windows the helpers are the plain
std::filesystemcalls.