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

@ -28,7 +28,10 @@
#include <algorithm>
#include <cstring>
#include <regex>
#include <dlfcn.h>
#ifndef _WIN32
# include <dlfcn.h>
#endif
#include <cmath>
@ -331,6 +334,8 @@ static RegisterPrimOp primop_import({
}
});
#ifndef _WIN32 // TODO implement via DLL loading on Windows
/* Want reasonable symbol names, so extern C */
/* !!! Should we pass the Pos or the file name too? */
extern "C" typedef void (*ValueInitializer)(EvalState & state, Value & v);
@ -403,6 +408,8 @@ void prim_exec(EvalState & state, const PosIdx pos, Value * * args, Value & v)
}
}
#endif
/* Return a string representing the type of the expression. */
static void prim_typeOf(EvalState & state, const PosIdx pos, Value * * args, Value & v)
{
@ -4593,6 +4600,7 @@ void EvalState::createBaseEnv()
)",
});
#ifndef _WIN32 // TODO implement on Windows
// Miscellaneous
if (evalSettings.enableNativeCode) {
addPrimOp({
@ -4606,6 +4614,7 @@ void EvalState::createBaseEnv()
.fun = prim_exec,
});
}
#endif
addPrimOp({
.name = "__traceVerbose",