should we hold off on `1.4.30-1.0.0-alpha02`?
# ksp
z
should we hold off on
1.4.30-1.0.0-alpha02
?
๐Ÿคซ 2
t
well, we planned to announce it tomorrow ๐Ÿ˜›
z
haha ok just checking, wasn't sure since it came right after alpha01 and figured you might be double checking something
t
Yeah, we found something funky after the alpha01 while testing and therefore need to pull it down. The alpha02 should be in a good shape but please allow us to give it more tests.
z
I just tested it out and seeing huge memory usage spikes. It OOMs
kotlin-compile-testing
tests
t
Thanks for trying it out. Let me take a look to see if we need alpha03 ๐Ÿ˜ข
๐Ÿ‘ 1
j
One thing I could think of from the commit is you didnโ€™t check if the processor has been invoked. With multiple round, if you have some files generated every round regardless of the input from annotated symbols, then multiple round will continue retrying for a fix point which never comes
t
I can repro. From the log, there are ~500 rounds for each of the failing tests.
z
That could do it, I don't think kotlin-compile-testing is aware of multiple rounds
Maybe this is me learning I should contribute it ๐Ÿ˜…
๐Ÿ˜€ 1
t
Thanks again for trying it out. We'll make a note of this API change in the release.
y
hmm we did have this OOM when updating kotlin to 1.4.30 in androidX infra
but it went away after ksp also updated to 1.4.30
z
yeah I'm not actually sure where kotlin-compile-testing is doing anything wrong ๐Ÿค”
I think I've figured it out, it has some tests that always generate files regardless of inputs, so it gets into a loop
even with this though, I see a stackoverflow crash coming from kotlinc analysis handling in my own tests here. Not totally sure what I'm looking at though, would be curious for thoughts https://github.com/ZacSweers/auto-service-ksp/pull/10#issuecomment-777281721
t
This looks like many rounds. @Jiaxiang?
org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.repeatAnalysisIfNeeded(KotlinToJVMBytecodeCompiler.kt:478)
z
I can't spot anything obviously wrong with what my plugin does though, unless it's something related to the fact that it only generates resources?
t
We'll investigate. Could be some termination problem. Repro is checking out the branch and
./gradlew :ksp:test
right?
z
just
./gradlew :processor:test
, no
:ksp
module
t
Thanks, let us try
๐Ÿ™‡ 1
j
it looks that
generateConfigFiles()
is called every round?
z
yes but it should only generate new files
unless....
wait I have an idea
j
it looks that a clear() on the
providers
might be a fix
๐Ÿ‘ 1
z
yup that's what I'm thinking
๐Ÿ‘ 1
yup that did it
sorry for the fire drill ๐Ÿ˜…
j
good to hear! Yeah I do think the multiple round infinite loop seems to be quite confusing and I might want to emphasis it in the next release note..
z
would it be helpful to maybe check for "re-generated" files? I.e. detect when something is in a loop
j
it is doable, I can simply add a check for file path in that case
z
๐Ÿ‘
j
but on the other hand, a processor should not generate to the same file in different rounds (it is not easy for ksp to check if the contents are identical), does it make sense for
CodeGenerator
to throw exceptions when user tries to create a new files that has been created in previous rounds?
z
I think so, it would have undefined behavior at best unless the goal is to allow later overwrites