Use UTF-8 for filesystem paths#50
Merged
Merged
Conversation
330bf18 to
13bb415
Compare
13bb415 to
1d1ece3
Compare
Upgrades to C++17 for all platforms.
Build with C++17 in bootstrap scripts and forge.lua. There's no portable local time conversion in C++20 and Forge doesn't use any other features from C++20. Might as well revert to C++17 for the increased compatibility. Bump dependency graph serialization format version to 33. The last write time for a target has changed from 32-bit time_t to a 64-bit file_time_type duration. This breaks compatibility with the existing format.
Changes tested behavior to require a drive letter for absolute paths on Windows. The update to use std::filesystem instead of Boost filesystem has brought with it a change in behavior of `is_absolute()` -- it now requires a drive letter to be considered an absolute path on Windows. This is better behavior than before where drives that started with "/" on Windows might end up being placed on different drives. Fixed by updating the tests to reflect the change in behavior.
Converts wide character paths to UTF-8 in forge_hooks_windows.cpp. The Windows Forge executable will ship with a manifest that sets its expected code page to be UTF-8 but because the forge_hooks DLL is injected into processes it needs to explicitly convert wide characters to UTF-8. The main Forge executable can then interpret these paths as UTF-8 too.
Any files specified in the "manifests" attribute of a target are collected, made absolute, and passed to "mt" invocations to be built into the embedded manifest that is linked into the executable.
Not strictly necessary because the on disk format hasn't changed but this will avoid any errors where wide character paths weren't converted correctly on Windows and written to the dependency graph on disk.
The original console output code page is saved and restored around running Forge. This ensures that any output, in particular UTF-8 encoded paths, printed to the console is shown correctly.
This is to support the maximum path length on Windows which we previously didn't do. Buffers are 32768 * 3 + 4 + 1 to account for maximum characters converted to UTF-8 plus "\\?\" and a null terminator.
- Remove Boost from bootstrap scripts - Remove Boost references from AGENTS.md - Remove unused boost_integration.cpp from src/error/error.forge - Remove BOOST_ALL_NO_LIB definitions that disable linking to Boost - Remove now unused src/boost/**
Also refactors existing hook tests into hook_tests.lua.
1d1ece3 to
2ea1631
Compare
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.
Replaces
boost::filesystemwithstd::filesystemso that the Boost dependency can be removed. Uses UTF-8 for all paths by specifying a manifest on Windows and explicitly converting paths to UTF-8 when they're detected inforge_hooks.dll.