Skip to content
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

Remove uses of std::process::exit #729

Closed
jfecher opened this issue Feb 1, 2023 · 2 comments · Fixed by #963
Closed

Remove uses of std::process::exit #729

jfecher opened this issue Feb 1, 2023 · 2 comments · Fixed by #963
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@jfecher
Copy link
Contributor

jfecher commented Feb 1, 2023

Problem

std::process::exit prevents drops from running which has the potential to be problematic for e.g. open files or other IO relying on being closed cleanly.

Solution

Remove each use of std::process::exit, instead percolating the error up to nargo's main function and returning an error there.

Additional context

The nargo test PR brings us a bit closer in percolating up errors more to be caught by testing, but also adds more std::process::exit instances in doing so.

@phated
Copy link
Contributor

phated commented Feb 1, 2023

This is also important for things that get compiled to wasm, as std::process::exit causes a force exit in all WASI runtimes and breaks a lot of tooling (I had to deal with this in Circom).

@kevaundray
Copy link
Contributor

Assigning this to @Ethan-000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants