1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00

Build a minimized Nix with MinGW

At this point many features are stripped out, but this works:

- Can run libnix{util,store,expr} unit tests
- Can run some Nix commands

Co-Authored-By volth <volth@volth.com>
Co-Authored-By Brian McKenna <brian@brianmckenna.org>
This commit is contained in:
John Ericson 2023-09-02 17:35:16 -04:00
parent 2248a3f545
commit 8433027e35
111 changed files with 1162 additions and 140 deletions

View file

@ -1342,8 +1342,16 @@ static void opListGenerations(Globals & globals, Strings opFlags, Strings opArgs
RunPager pager;
for (auto & i : gens) {
#ifdef _WIN32 // TODO portable wrapper in libutil
tm * tp = localtime(&i.creationTime);
if (!tp)
throw Error("cannot convert time");
auto & t = *tp;
#else
tm t;
if (!localtime_r(&i.creationTime, &t)) throw Error("cannot convert time");
if (!localtime_r(&i.creationTime, &t))
throw Error("cannot convert time");
#endif
logger->cout("%|4| %|4|-%|02|-%|02| %|02|:%|02|:%|02| %||",
i.number,
t.tm_year + 1900, t.tm_mon + 1, t.tm_mday,