Skip to content

Sdk does not build in Zig 0.12.0 and Above #27

@Sewer56

Description

@Sewer56

In Zig 0.12.0 and above the SDK fails to build with the following message

/home/sewer/Project/tinyvg-sdk/build.zig.zon:1:2: error: missing top-level 'paths' field
.{
 ^

Providing the path as .paths = .{"."}, as per

Results in errors related to auto-generated code that's presumably derived from build.zig

/home/sewer/.cache/zig/p/1220cf55c10add71a9cd2591dbe118ffa9a9198e21069e440fae1f6e3eef6f274733/build.zig:11:9: error: local variable is never mutated
    var main_tests = b.addTest(.{
        ^~~~~~~~~~
/home/sewer/.cache/zig/p/1220cf55c10add71a9cd2591dbe118ffa9a9198e21069e440fae1f6e3eef6f274733/build.zig:11:9: note: consider using 'const'
/home/sewer/Project/tinyvg-sdk/build.zig:15:10: error: no field named 'source_file' in struct 'Build.Module.CreateOptions'
        .source_file = .{ .path = "src/lib/tinyvg.zig" },
         ^~~~~~~~~~~
/usr/lib/zig/std/Build/Module.zig:146:27: note: struct declared here
pub const CreateOptions = struct {
                          ^~~~~~
referenced by:
    runBuild__anon_8821: /usr/lib/zig/std/Build.zig:2080:37
    main: /usr/lib/zig/compiler/build_runner.zig:300:29
    remaining reference traces hidden; use '-freference-trace' to see all reference traces
/home/sewer/.cache/zig/p/12203d04cafc97f952d74cdb077e74c0ab3414f9f6b5fbd159112c62bfa584a0dbed/build.zig:3:21: error: root struct of file 'std' has no member named 'build'
pub fn build(b: *std.build.Builder) void {
                 ~~~^~~~~~
/usr/lib/zig/std/std.zig:1:1: note: struct declared here
pub const ArrayHashMap = array_hash_map.ArrayHashMap;
^~~

I've tried digging a bit deeper. For example reading the 0.12.0 release notes,
and fixing up cases I identified such as Unnecessary use of var, but at the end of the day, the build error still persists. Some code, presumably derived from build.zig isn't quite right.

In any case, I've not used Zig before, therefore I'm not entirely sure with regards of what needs to be done here. I just wanted to mess around with the code, convert a few files, and run some numbers on the files. Maybe even write a decoder for .NET, since doing a ~40 instruction GC transition for every single method call is far from ideal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions