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

Catch macro expansion exceptions in ScalacWorker #1489

Merged
merged 4 commits into from
Apr 4, 2023

Conversation

thirtyseven
Copy link
Contributor

Description

Catch scalac exceptions that occur during expansion of user macros so that the entire worker doesn't crash.

Motivation

Fixes #1488

Copy link
Collaborator

@liucijus liucijus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @thirtyseven! Would you be able to contribute an end to end test?

@thirtyseven
Copy link
Contributor Author

Thanks, @thirtyseven! Would you be able to contribute an end to end test?

I can take a stab at it, are there any existing e2e tests for the existing case of handling scala.reflect.internal.Types$TypeError that I can base it off of?

@thirtyseven
Copy link
Contributor Author

It doesn't appear that there are any, I'll try to add e2e tests for both cases.

@thirtyseven
Copy link
Contributor Author

@liucijus Actually, I couldn't figure out how to reproduce the previous scala.reflect.internal.Types$TypeError case, but I did manage to add a test for the new case. I've confirmed that it fails without the change from this PR.

@thirtyseven thirtyseven requested a review from liucijus April 3, 2023 08:02
@thirtyseven
Copy link
Contributor Author

Thanks for the review! FYI I do not have commit access so will need someone else to merge.

@liucijus liucijus merged commit 394c0aa into bazelbuild:master Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When ScalacWorker fails during macro evaluation, errors are not made available in build log
3 participants