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

Expose logger statistics #165

Merged
merged 1 commit into from
Jan 15, 2021
Merged

Expose logger statistics #165

merged 1 commit into from
Jan 15, 2021

Conversation

neetopia
Copy link
Contributor

@neetopia neetopia commented Nov 24, 2020

When seeing errors or exceptions in logger event, pass the original binding context back to fail compilation.

This is quite tricky since there might be errors recorded in processor that are not related to compiler errors. A better solution need to change compiler plugin extension point to support such custom 'fail on sight' style AnalysisResult. Alternatively it is also doable to just throw exception in KSP to fail compilation but that might be too aggressive.

Since error out works now, we no longer need to fail compilation here, however it is still worth to expose logger statistics for future usage.

AnalysisResult.success(bindingTrace.bindingContext, module, shouldGenerateCode = false)
} else {
AnalysisResult.success(BindingContext.EMPTY, module, shouldGenerateCode = false)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious, why not simply changing BindingContext.EMPTY to bindingTrace.bindingContext?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because we don't want to fail processing in this branch.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This kind of explanation isn't really helpful. Please provide more information next time. For example, there are other errors from compiler such as symbol not found that are not fatal to ksp.

@neetopia neetopia changed the title work around to make ksp fail execution on error or exception log event Expose logger statistics Jan 12, 2021
@neetopia neetopia merged commit 23b1c1c into google:master Jan 15, 2021
@neetopia neetopia deleted the logger branch January 15, 2021 00:02
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.

2 participants