Skip to content

antd-zig source uses Zig APIs from incompatible versions; doesn't compile on any released Zig #78

@Nic-dorman

Description

@Nic-dorman

Bug

antd-zig/src/ can't be built against any released Zig (0.14.x or 0.15.x). The source mixes APIs that don't co-exist in any tagged release:

  • std.ArrayList(u8) = .empty initializer — introduced in Zig 0.15-dev (not present in 0.14.x).
  • client.open(method, uri, .{ ... }) on std.http.Client — present in 0.14.x, removed/renamed in 0.15.x.

build.zig.zon declares minimum_zig_version = "0.14.0", but neither 0.14.x nor 0.15.x can satisfy both calls.

Reproductions

Zig 0.14.1

src/json_helpers.zig:213:36: error: struct 'array_list.ArrayListAligned(u8,null)' has no member named 'empty'
    var list: std.ArrayList(u8) = .empty;
                                  ~^~~~~

Zig 0.15.2

src/antd.zig:102:25: error: no field or member function named 'open' in 'http.Client'
        var req = client.open(method, uri, .{
                  ~~~~~~^~~~~

Suggested fix

Pin to a single supported Zig version and audit the source for that target. Most likely Zig 0.14.x (the documented minimum) — that requires reverting the .empty initializers back to std.ArrayList(u8).init(allocator) (or equivalent). All std.ArrayList callsites in src/json_helpers.zig use the .empty form, so this is a sweep of a single file.

Alternatively: bump minimum_zig_version to 0.15.x and replace the http.Client.open calls with the new API (std.http.Client.request / similar) — bigger surface.

Adjacent

Also flagged in #70 (the arity-mismatch fix): the arity bug in 02-data.zig and 06-private-data.zig is real and type-correct, but I can't verify execution end-to-end here because of this compile error. The PR for #70 is still correct on the call-site shape; #70 should not block on this.

Environment

  • Tried with both Zig 0.14.1 and 0.15.2, installed via mise
  • antd-zig at main (today's clone), Ubuntu 24.04 LXC

Found while landing the arity fix from #70.

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