godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.14k stars 21.19k forks source link

[4.4.dev2, Windows] Project manager list uses unix time 0 for all projects #96812

Closed a-johnston closed 2 months ago

a-johnston commented 2 months ago

Tested versions

System information

Godot v4.4.dev2.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3080 Ti (NVIDIA; 32.0.15.6070) - 12th Gen Intel(R) Core(TM) i7-12700K (20 Threads)

Issue description

All projects in the 4.4.dev2 project manager show up with a last edited time of 1970-01-01 00:00:00 causing the default sorting of the list to be effectively random: image

Notably, projects saved in 4.4.dev2 and then reopened with 4.4.dev1 show the correct last edited time for the project so it's likely the project manager is just using the wrong value, or reading the value incorrectly: image

Steps to reproduce

Open the project manager and look at timestamps / try to sort projects by Last Edited

Minimal reproduction project (MRP)

N/A, issue is with the project manager

a-johnston commented 2 months ago

This is potentially related to https://github.com/godotengine/godot/pull/96398; the verbose log is full of Failed to get modified time for: C:/Users/<user>/Documents/godot/<project name>/project.godot which would result in returning a timestamp of 0. These messages do not appear for 4.4.dev1

Hilderin commented 2 months ago

Strangely, I'm able to reproduce the problem with 4.4 dev 2 but not in dev build on master or using the commit from the dev 2: 97ef3c8 I have a lot of "Failed to get modified time for:" in verbose log.

matheusmdx commented 2 months ago

Strangely, I'm able to reproduce the problem with 4.4 dev 2 but not in dev build on master or using the commit from the dev 2: 97ef3c8

I'm trying to bisect this rn and something i noticied is this issue doesn't happen compiling with msvc2022 but shows the problem when compiled with mingw.


This is godot compiled with msvc2022:

image


This is godot compiled with mingw:

image

Hilderin commented 2 months ago

Oh!!! That probably explain why the artefact from Github CI seems to work fine. Never used mingw to build Godot, but I'll try.

a-johnston commented 2 months ago

Ah good catch! Yeah I can confirm that when compiling 97ef3c8 with msvc I don't see any Failed to get modified time for and the regressions described in this issue as well as https://github.com/godotengine/godot/issues/96810 and https://github.com/godotengine/godot/issues/96828 are no longer present

Hilderin commented 2 months ago

Check that: https://stackoverflow.com/questions/76611362/wstat-for-extended-length-path-prefixed-with-in-mingw64 (\\?\) was added in front file name for all Window file operations in #91902

Hilderin commented 2 months ago

I confirm that building with MinGW-w64 MSVCRT, _wstat fails when file name starts with (\\?\). It works with MinGW-w64 UCRT. If I comment this and compile with MinGW-w64 MSVCRT, call to _wstat works again:

if (!r_path.is_network_share_path() && !r_path.begins_with(R"(\\?\)")) {
     r_path = R"(\\?\)" + r_path;
}

This issue is a regression from #91902 @bruvzg

bruvzg commented 2 months ago

Modification time should be fixed by https://github.com/godotengine/godot/pull/74830