chung-leong / pb2zig

Pixel Bender to Zig code translator
MIT License
17 stars 1 forks source link

Compilation error with Zig 0.11.0 #38

Closed chung-leong closed 3 months ago

chung-leong commented 3 months ago
1) Integration tests
       should correctly translate bezier-aligner.pbk:
     Error: Zig compilation failed

zig build-lib bezier-aligner ReleaseSmall x86_64-linux-gnu: error: the following command failed with 1 compilation errors:
/home/cleong/.zvm/0.11.0/zig build-lib /home/cleong/pb2zig/pb2zig/node_modules/zigar-compiler/zig/stub-c.zig -lc -OReleaseSmall --cache-dir /tmp/zigar-build/bezier-aligner-6926699f/zig-cache --global-cache-dir /home/cleong/.cache/zig --name bezier-aligner -dynamic -target x86_64-linux-gnu -mcpu x86_64 --mod exporter::/home/cleong/pb2zig/pb2zig/node_modules/zigar-compiler/zig/exporter-c.zig --mod module::/home/cleong/pb2zig/pb2zig/test/zig-output/bezier-aligner.zig --deps exporter,module --listen=- 
Build Summary: 0/3 steps succeeded; 1 failed (disable with --summary none)
install transitive failure
+- WriteFile transitive failure
   +- zig build-lib bezier-aligner ReleaseSmall x86_64-linux-gnu 1 errors
   +- zig build-lib bezier-aligner ReleaseSmall x86_64-linux-gnu (reused)
/home/cleong/pb2zig/pb2zig/test/zig-output/bezier-aligner.zig:285:75: error: invalid builtin function: '@abs'

      at file:///home/cleong/pb2zig/pb2zig/node_modules/zigar-compiler/dist/index.js:5243:17
      at ChildProcess.exithandler (node:child_process:430:5)
      at ChildProcess.emit (node:events:514:28)
      at maybeClose (node:internal/child_process:1105:16)
      at ChildProcess._handle.onexit (node:internal/child_process:305:5)
chung-leong commented 3 months ago

@abs() is not in 0.11.0 and a comptime if() doesn't stop the error. Need to have version specific code, I think.

chung-leong commented 3 months ago

We're going to junk support for 0.11.0 anyway. Let's just go with a dumb fix for now.