Skip to content

zls no longer builds on zig master, after changes to build.zig.zon format #2207

@demize

Description

@demize

build.zig.zon now requires both a fingerprint field for the package, as well as requiring a bare zig identifier for the package name. When trying to build the package directly, zig gives this vague error message:

/var/tmp/portage/dev-zig/zls-9999/work/zls-9999/build.zig.zon:2:13: error: expected enum literal
    .name = "zls",
            ^~~~~

though there's more detail when trying to import a package: e.g.,

$ zig fetch --save git+https://github.com/kubkon/zig-yaml#main
/home/demize/.cache/zig/tmp/fa4bb251005e6c73/build.zig.zon:2:13: error: name must be a valid bare zig identifier (hint: switch from string to enum literal)
    .name = "zig-yaml",
            ^~~~~~~~~~

zig will suggest a fingerprint field for you once you've updated the manifest to use a bare identifier for the name, however given this seems to extend to dependencies it may not be fixable purely by updating zls's manifest.

I'll note that this behavior may be subject to change; I'm running into it today because I just updated my system, and I'm using the "live" ebuild of zig on gentoo to try to track zig master, so it's possible they simply haven't actually implemented functionality to ensure that legacy packages still work properly.

I will also note that my version of zig, built from the latest commit to ziglang/zig#master, is the same as the version currently available on ziglang.org/download, 0.14.0-dev.3445+6c3cbb0c8.

See also: ziglang/zig#22994

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