Skip to content

enhance manifest error messages to show depending package #23047

@andrewrk

Description

@andrewrk

A manifest error message looks like this:

/home/andy/.cache/zig/tmp/5637316e8f9ebf88/build.zig.zon:2:13: error: name must be a valid bare zig identifier (hint: switch from string to enum literal)
    .name = "flow-syntax",
            ^~~~~~~~~~~~~

The file name points into a tmp directory because the hash has not yet been computed, so the data cannot be trusted.

This error message should be enhanced so that it also shows why the package was fetched. For example:

/home/andy/.cache/zig/tmp/5637316e8f9ebf88/build.zig.zon:2:13: error: name must be a valid bare zig identifier (hint: switch from string to enum literal)
    .name = "flow-syntax",
            ^~~~~~~~~~~~~
/home/andy/dev/zine/build.zig.zon:26:40: hint: fetched from here 
            .url = "git+https://github.com/neurocyte/flow-syntax?ref=zig-0.14#3711541e089780e4da3bd7294990ba60e5ea50bc",
                   ^

This hint should be recursive.

Also, when #14292 is implemented, the error should only be shown when all mirrors fail. A warning should be printed when one mirror fails but not another.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSolving this issue will likely involve adding new logic or components to the codebase.zig build systemstd.Build, the build runner, `zig build` subcommand, package management

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions