Skip to content

handle panics during make() gracefully #14942

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
Tracked by #14647
andrewrk opened this issue Mar 16, 2023 · 1 comment
Open
Tracked by #14647

handle panics during make() gracefully #14942

andrewrk opened this issue Mar 16, 2023 · 1 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
Milestone

Comments

@andrewrk
Copy link
Member

Extracted from #14647.

Currently, if any build steps panic during make(), they dump stack trace to stderr, and the thread is lost. Instead, the stack trace and panic message should be captured as a step error, and a new thread should be spawned to replace the one that died.

Care should be taken to not accidentally capture panics from the build runner itself in this manner.

@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 16, 2023
@andrewrk andrewrk added this to the 0.12.0 milestone Mar 16, 2023
@matu3ba
Copy link
Contributor

matu3ba commented Mar 16, 2023

Related / where some code could be yanked from for the logic: #14351. Comparing against the global build runner thread id should be sufficient.
Not sure about the spawning logic: One either needs to store the thread ids in memory or spawn them from build runner thread.

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

2 participants