zigzap / zap

blazingly fast backends in zig
MIT License
1.99k stars 71 forks source link

zig errors on variables that need to be treated as const instead of var #55

Closed akhildevelops closed 6 months ago

akhildevelops commented 6 months ago
akhil@ad:~/practice/immich$ zig build
/home/akhil/practice/immich/zap/build.zig:217:9: error: local variable is never mutated
    var announceybot_exe = b.addExecutable(.{
        ^~~~~~~~~~~~~~~~
/home/akhil/practice/immich/zap/build.zig:217:9: note: consider using 'const'
/home/akhil/practice/immich/zap/build.zig:203:9: error: local variable is never mutated
    var pkghash_exe = b.addExecutable(.{
        ^~~~~~~~~~~
/home/akhil/practice/immich/zap/build.zig:203:9: note: consider using 'const'
/home/akhil/practice/immich/zap/build.zig:15:9: error: local variable is never mutated
    var zap_module = b.createModule(.{
        ^~~~~~~~~~
/home/akhil/practice/immich/zap/build.zig:15:9: note: consider using 'const'
renerocksai commented 6 months ago

Very likely a zig version mismatch, you're probably using a nightly master build of zig instead of the required released version of zig.

See the readme.

There is a point in using the release version of zig: zap projects don't need to update their code and dependencies as zig master keeps evolving.

Released zig is not an old version of zig that you should avoid, it's the release version. Zig master is not even alpha.