-
Notifications
You must be signed in to change notification settings - Fork 251
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
Compilation error is not thrown from KSPLogger logging error in 1.6.10-1.0.3
#854
Comments
1.0.3
1.6.10-1.0.3
Yes it is. It is changed from returning COMPILATION_ERROR to OK to workaround this issue: All callers to the This reminds me that there can be issues when running from kotlin-compile-testing, for example 😢 May I know how you run KSP? |
btw, the upstream fix to KT-30172 is here: JetBrains/kotlin#3950 We'll roll back to return COMPILATION_ERROR once it is merged. |
We run it via kotlin-compile-testing in unit tests |
Adding some sample code snippet Sample SymbolProcessorProvider
Sample test
Output from the test in 1.0.2
Test passed Output from the test in 1.0.3
|
Thanks @ting-yuan for your response! Is there a workaround for raising the |
Here is a patch to KCT to partially fix this problem: Unfortunately INTERNAL_ERROR is no longer possible; Any previous INTERNAL_ERROR in KSP becomes COMPILATION_ERROR until the fix lands in Kotlin compiler and KSP switches back. I cannot think of any workaround in processors or outside of kotlin-compile-testing, because KSP always returns OK. It returns OK even when processor throws an exception. |
Fixed in another way in #865. |
I have a
SymbolProcessor
which was throwing aKotlinCompilation.ExitCode.Compilation.ExitCode.COMPILATION_ERROR
fromenvironment.logger.error()
as expected in1.0.2
. I have some unit tests to catch the error, which is now failing with1.0.3
because it returnsKotlinCompilation.ExitCode.Compilation.ExitCode.OK
, and theKSPLogger
API doesn't fail the compilation.Is this intended? If so, is there a more preferred way to fail the compilation?
The text was updated successfully, but these errors were encountered: