SnosMe / poe-dat-viewer

Path of Exile .dat file viewer
https://snosme.github.io/poe-dat-viewer
40 stars 11 forks source link

Zig master can't build dat-analysis #23

Open zao opened 2 months ago

zao commented 2 months ago

With the current master of Zig as of 2024-09-05 (version 0.14.0-dev.1421+f87dd43c1), trying to replicate the steps in the GitHub workflows on an Ubuntu 24.04 machine fails for dat-analysis:

zao@poe-dat-vm:~/poe-dat-viewer$ env -C lib/src/dat-analysis/ zig build -Doptimize=ReleaseSmall
/home/zao/poe-dat-viewer/lib/src/dat-analysis/build.zig:16:33: error: no field named 'path' in union 'Build.LazyPath'
        .root_source_file = .{ .path = "./analysis.zig" },
                                ^~~~
/home/zao/tools/zig-linux-x86_64-0.14.0-dev.1421+f87dd43c1/lib/std/Build.zig:2209:22: note: union declared here
pub const LazyPath = union(enum) {
                     ^~~~~

Patching this to read b.path("./analysis.zig"), gets me past this part to another problem:

zao@poe-dat-vm:~/poe-dat-viewer$ env -C lib/src/dat-analysis/ zig build -Doptimize=ReleaseSmall
/home/zao/poe-dat-viewer/lib/src/dat-analysis/build.zig:20:12: error: no field named 'export_symbol_names' in struct 'Build.Step.Compile'    module.export_symbol_names = &[_][]const u8{
           ^~~~~~~~~~~~~~~~~~~
/home/zao/tools/zig-linux-x86_64-0.14.0-dev.1421+f87dd43c1/lib/std/Build/Step/Compile.zig:1:1: note: struct declared here
const builtin = @import("builtin");
^~~~~

This problem I have not found a solution to yet. I guess I could work around by using an older Zig version, but it'd be nice if things work out of the box, particularly as this might also affect CI.

zao commented 2 months ago

Not quite sure what the proper way to do this is, as the same errors manifest down through 0.12.0, with 0.11.0 having a different fault:

/home/zao/poe-dat-viewer/lib/src/dat-analysis/build.zig:23:12: error: no field named 'entry' in struct 'Build.Step.Compile'
    module.entry = .disabled;
           ^~~~~
/home/zao/tools/zig-linux-x86_64-0.11.0/lib/std/Build/Step/Compile.zig:1:1: note: struct declared here
const builtin = @import("builtin");
^~~~~