chung-leong / zigar

Enable the use of Zig code in JavaScript project
https://chung-leong.github.io/zigar/
MIT License
182 stars 3 forks source link

Bunch of failed tests on 32-bit Windows #408

Closed chung-leong closed 4 months ago

chung-leong commented 4 months ago
  1) Integration tests (node-zigar, Debug)
       Zig Benchmarks Game
         should produce the right results for the reverse-complement example:

      AssertionError: expected true to be false
      + expected - actual

      -true
      +false

      at Context.<anonymous> (file:///C:/Users/Chung%20Leong/zigar/zigar-compiler/test/integration/benchmarks-game/tests.js:162:30)

  2) Integration tests (node-zigar, Debug)
       Built-in functions
         should produce SHA1 hash matching that from Node native function:

      AssertionError: expected 62 to equal 236
      + expected - actual

      -62
      +236

      at Context.<anonymous> (file:///C:/Users/Chung%20Leong/zigar/zigar-compiler/test/integration/builtin-functions/tests.js:39:26)

  3) Integration tests (node-zigar, Debug)
       Function calling
         should correctly auto-cast compatible typed arrays and buffers to primitive pointer:

      AssertionError: expected [ 0n ] to deeply equal [ 4026531840n ]
      + expected - actual

       [
      -  "0"
      +  "4026531840"
       ]

      at Context.<anonymous> (file:///C:/Users/Chung%20Leong/zigar/zigar-compiler/test/integration/function-calling/tests.js:351:34)

  4) Integration tests (node-zigar, Debug)
       Function calling
         should call C functions:
     Error: Zig compilation failed

install
+- WriteFile
   +- zig build-lib call-c-functions Debug x86-windows 1 errors
C:\Users\CHUNGL~1\AppData\Local\Temp\zigar-build\call-c-functions-674913cd\.zig-cache\o\58d5b492fbf77a2cb1a7e1caf7614167\cimport.zig:1878:35: error: comptime call of extern function
error: the following command failed with 1 compilation errors:
C:\Users\Chung Leong\.zvm\0.13.0\zig.exe build-lib -ODebug -target x86-windows -mcpu baseline --dep module -Mroot=C:\Users\Chung Leong\zigar\zigar-compiler\zig\stub-c.zig -I C:\Users\Chung Leong\zigar\zigar-compiler\test\integration\function-calling -Mmodule=C:\Users\Chung Leong\zigar\zigar-compiler\test\integration\function-calling\call-c-functions.zig -lc --cache-dir C:\Users\CHUNGL~1\AppData\Local\Temp\zigar-build\call-c-functions-674913cd\.zig-cache --global-cache-dir C:\Users\Chung Leong\AppData\Local\zig --name call-c-functions -dynamic --listen=-
Build Summary: 0/3 steps succeeded; 1 failed (disable with --summary none)
install transitive failure
+- WriteFile transitive failure
   +- zig build-lib call-c-functions Debug x86-windows 1 errors
   +- zig build-lib call-c-functions Debug x86-windows (reused)
error: the following build command failed with exit code 1:
C:\Users\CHUNGL~1\AppData\Local\Temp\zigar-build\call-c-functions-674913cd\.zig-cache\o\b7e8f337af5a31731c73254c5dded2bd\build.exe C:\Users\Chung Leong\.zvm\0.13.0\zig.exe C:\Users\CHUNGL~1\AppData\Local\Temp\zigar-build\call-c-functions-674913cd C:\Users\CHUNGL~1\AppData\Local\Temp\zigar-build\call-c-functions-674913cd\.zig-cache C:\Users\Chung Leong\AppData\Local\zig --seed 0x37798dd5 -Zf951c24b2239cb2c -Doptimize=Debug -Dtarget=x86-windows

      at runCompiler (file:///C:/Users/Chung%20Leong/zigar/zigar-compiler/dist/index.js:5504:11)
      at async compile (file:///C:/Users/Chung%20Leong/zigar/zigar-compiler/dist/index.js:5465:7)
      at async load (file:///C:/Users/Chung%20Leong/zigar/node-zigar/dist/index.js:71:26)
      at async nextLoad (node:internal/modules/esm/hooks:864:22)
      at async Hooks.load (node:internal/modules/esm/hooks:447:20)
      at async MessagePort.handleMessage (node:internal/modules/esm/worker:196:18)

  5) Integration tests (node-zigar, Debug)
       Function calling
         should call variadic functions:

      AssertionError: expected [ '0', '0', '0' ] to deeply equal [ '-10.25', '-200.25', '-3000.25' ]
      + expected - actual

       [
      -  "0"
      -  "0"
      -  "0"
      +  "-10.25"
      +  "-200.25"
      +  "-3000.25"
       ]

      at Context.<anonymous> (file:///C:/Users/Chung%20Leong/zigar/zigar-compiler/test/integration/function-calling/tests.js:611:25)

  6) Integration tests (node-zigar, Debug)
       Memory allocation
         should provide allocator to function returning string:

      AssertionError: expected 'Numbers: 123, 0, 3.14' to equal 'Numbers: 123, 456, 3.14'
      + expected - actual

      -Numbers: 123, 0, 3.14
      +Numbers: 123, 456, 3.14

      at Context.<anonymous> (file:///C:/Users/Chung%20Leong/zigar/zigar-compiler/test/integration/memory-allocation/tests.js:14:25)

  7) Integration tests (node-zigar, Debug)
       Type handling
         Int
           should handle int in struct:

      AssertionError: expected { number1: -5, …(1) } to deeply equal { number1: -5, number2: -444n }
      + expected - actual

       {
         "number1": -5
      -  "number2": "-1906965479424"
      +  "number2": "-444"
       }

      at Context.<anonymous> (file:///C:/Users/Chung%20Leong/zigar/zigar-compiler/test/integration/type-handling/int/tests.js:95:44)
chung-leong commented 4 months ago

sha1 test failure appears to be a regression in the standard library: https://github.com/ziglang/zig/issues/20466

chung-leong commented 4 months ago

Another regression in 0.13.0: https://github.com/ziglang/zig/issues/20469

chung-leong commented 4 months ago

And another: https://github.com/ziglang/zig/issues/20470