From 77c145fa02ed06686c84290b2d158035cd7aa294 Mon Sep 17 00:00:00 2001 From: Emil <65846814+emil28092005@users.noreply.github.com> Date: Thu, 24 Sep 2026 02:19:09 +0300 Subject: [PATCH] Fix Windows diagnostic paths and schema fixture timeout --- cmake/BuildService.cmake | 9 ++++++++- src/editor/build_diagnostics.cpp | 6 ++++-- tests/build_diagnostics_tests.cpp | 3 ++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/cmake/BuildService.cmake b/cmake/BuildService.cmake index 51d25ab..012a0a2 100644 --- a/cmake/BuildService.cmake +++ b/cmake/BuildService.cmake @@ -23,5 +23,12 @@ if(BUILD_TESTING) target_link_libraries(faset_build_schema_tests PRIVATE faset_build_service faset_authoring faset_editor_commands) add_dependencies(faset_build_schema_tests faset_build_schema_tool) add_test(NAME build_schema_publication COMMAND faset_build_schema_tests $ ${PROJECT_SOURCE_DIR}) - set_tests_properties(build_schema_publication PROPERTIES TIMEOUT 60) + # This fixture performs many full cache invalidations and process launches. + # Windows runner startup and antivirus overhead exceed 60 seconds even when + # individual native fixture commands finish normally. + if(WIN32) + set_tests_properties(build_schema_publication PROPERTIES TIMEOUT 240) + else() + set_tests_properties(build_schema_publication PROPERTIES TIMEOUT 60) + endif() endif() diff --git a/src/editor/build_diagnostics.cpp b/src/editor/build_diagnostics.cpp index 8c23a41..154ca06 100644 --- a/src/editor/build_diagnostics.cpp +++ b/src/editor/build_diagnostics.cpp @@ -28,7 +28,9 @@ std::string strip_ansi(std::string_view text) { } std::string normalize_path(std::string path) { std::replace(path.begin(), path.end(), '\\', '/'); - path = std::filesystem::path(path).lexically_normal().generic_string(); + // Compiler output is UTF-8. Constructing a path from a narrow string on + // Windows can decode it through the process code page and lose Unicode. + path = generic_path_to_utf8(path_from_utf8(path).lexically_normal()); while (path.size() > 1 && path.back() == '/') path.pop_back(); return path; @@ -46,7 +48,7 @@ std::string project_source(std::string raw, const std::filesystem::path& project if (raw.starts_with("lua: ")) raw.erase(0, 5); std::replace(raw.begin(), raw.end(), '\\', '/'); - for (const auto& component : std::filesystem::path(raw)) + for (const auto& component : path_from_utf8(raw)) if (component == "..") return {}; const auto path = normalize_path(std::move(raw)); diff --git a/tests/build_diagnostics_tests.cpp b/tests/build_diagnostics_tests.cpp index 3856dae..a413aa1 100644 --- a/tests/build_diagnostics_tests.cpp +++ b/tests/build_diagnostics_tests.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -25,7 +26,7 @@ void contracts() { rows[0].at("line") == 6 && rows[0].at("severity") == "error" && rows[0].at("message") == "unexpected symbol near '='", "Lua syntax error and ANSI stripping work"); - const auto windows = fs::path(R"(C:\Café)"); + const auto windows = path_from_utf8(R"(C:\Café)"); rows = editor::parse_build_diagnostics( R"(C:\Café\Scripts\Game.cpp(17,4): error C2143: syntax error)" "\n" R"(C:\Café\Scripts\Game.cpp:19:2: warning: suspicious conversion)" "\n",