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 sys.exit calls #5242

Closed
2 tasks done
kenodegard opened this issue Mar 18, 2024 · 2 comments · May be fixed by #5255
Closed
2 tasks done

Remove sys.exit calls #5242

kenodegard opened this issue Mar 18, 2024 · 2 comments · May be fixed by #5255
Labels
duplicate indicate issues/PRs that are duplicates of another source::community catch-all for issues filed by community members spike issue is for doing research work or prototyping; outcome is optional and not required type::tech-debt identifies or resolves some technical debt

Comments

@kenodegard
Copy link
Contributor

Checklist

  • I added a descriptive title
  • I searched open requests and couldn't find a duplicate

What is the idea?

These sys.exit calls in conda-build are very painful for downstream users of the code base as a library (i.e., conda-forge). The reason is that in the python exception hierarchy has the SystemExit exception raised by sys.exit and the standard Exception at the same level (https://docs.python.org/3/library/exceptions.html#exception-hierarchy). This means when one calls sys.exit, the invoking code cannot catch that exception without resorting to explicitly catching SystemExit as opposed to a normal Exception. The slight change in exception handling API breaks (at least my) expectations as a user of the code and has created quite a few mystery code crashes in the bot over the years.

Can we use a standard exception here and then have the conda-build CLI code handle that exception and call sys.exit?

Originally posted by @beckermr in #5237 (comment)

Why is this needed?

sys.exit calls are harder to catch/debug when using conda_build as an API.

What should happen?

Review and ideally remove all sys.exit calls.

Additional Context

No response

@kenodegard kenodegard added type::tech-debt identifies or resolves some technical debt source::community catch-all for issues filed by community members spike issue is for doing research work or prototyping; outcome is optional and not required labels Mar 18, 2024
@kenodegard
Copy link
Contributor Author

There are 88 sys.exit calls in conda-build

@kenodegard
Copy link
Contributor Author

Oops, this is a duplicate of #4209

@kenodegard kenodegard closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2024
@kenodegard kenodegard added the duplicate indicate issues/PRs that are duplicates of another label Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate indicate issues/PRs that are duplicates of another source::community catch-all for issues filed by community members spike issue is for doing research work or prototyping; outcome is optional and not required type::tech-debt identifies or resolves some technical debt
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant