Skip to content

enhance manifest error messages to show depending package #23047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
andrewrk opened this issue Mar 2, 2025 · 0 comments
Open

enhance manifest error messages to show depending package #23047

andrewrk opened this issue Mar 2, 2025 · 0 comments
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. zig build system std.Build, the build runner, `zig build` subcommand, package management
Milestone

Comments

@andrewrk
Copy link
Member

andrewrk commented Mar 2, 2025

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.

@andrewrk andrewrk added enhancement Solving this issue will likely involve adding new logic or components to the codebase. zig build system std.Build, the build runner, `zig build` subcommand, package management labels Mar 2, 2025
@andrewrk andrewrk added this to the 0.15.0 milestone Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. zig build system std.Build, the build runner, `zig build` subcommand, package management
Projects
None yet
Development

No branches or pull requests

1 participant