endojs/Exo

Port to Windows (non-WSL)

Closed this issue · 3 comments

Port to Windows (non-WSL)

At least the dependency on swing-store-lmdb currently prevents running on Windows natively, as importing the lmdb module results in unresolved symbols. Venemo/node-lmdb#151 (comment) may have a fix.

SwingSet needs synchronous reads of the database in order to function. Perhaps we should use swing-store-simple under Windows natively.

Solved with a patch to node-lmdb:

diff --git a/node_modules/node-lmdb/binding.gyp b/node_modules/node-lmdb/binding.gyp
index 325a9aa..fe775fc 100644
--- a/node_modules/node-lmdb/binding.gyp
+++ b/node_modules/node-lmdb/binding.gyp
@@ -7,7 +7,7 @@
   "targets": [
     {
       "target_name": "node-lmdb",
-      "win_delay_load_hook": "false",
+      "win_delay_load_hook": "true",
       "sources": [
         "dependencies/lmdb/libraries/liblmdb/mdb.c",
         "dependencies/lmdb/libraries/liblmdb/midl.c",
@@ -58,7 +58,21 @@
           }
         }],
         ["OS=='win'", {
-            "libraries": ["ntdll.lib"]
+            "libraries": ["ntdll.lib"],
+            "configurations": {
+              "Release": {
+                "msvs_settings": {
+                  "VCLinkerTool": {
+                    "AdditionalOptions": [
+                      "/LTCG:OFF"
+                    ]
+                  },
+                  "VCCLCompilerTool": {
+                    "WholeProgramOptimization": "false"
+                  }
+                }
+              }
+            }
         }],
         ["use_fixed_size=='true'", {
           "defines": ["MDB_FIXEDSIZE"],

Agoric/agoric-sdk#2494 plus current Pledger is enough to get working under Windows.