Hm, this issue was closed with a comment that this may be a bug in Room, but I still run into the problem apparently with multiple processors when multiple rounds are involved. https://github.com/google/ksp/issues/1854 Any chance this could be reopened?
j
Jiaxiang
06/10/2024, 8:52 PM
can you add details of error messages from other processors to this issue? Feel free to reopen it.
r
ralf
06/10/2024, 8:53 PM
I did, I’ve added two stacktraces
👍 1
j
Jiaxiang
06/10/2024, 8:53 PM
Oh I saw you already added, reopened issue.
r
ralf
06/10/2024, 8:53 PM
Thanks
ralf
06/10/2024, 8:53 PM
I just reproduced this outside of the compile testing library. So it’s a general problem.
ralf
06/10/2024, 8:56 PM
I’ve updated the message.
j
Jiaxiang
06/10/2024, 8:56 PM
thanks
t
Ting-Yuan Huang
06/10/2024, 10:41 PM
Using elements across rounds is currently unsupported, because generated code may affect the elements. For example, the return type of a function may be an error in round 1 and defined by a class generated in round 2. In KSP1, caching elements across rounds happens to work for some cases but not all. In KSP2, the lifecycle check is more strict and the error is always thrown. This is not a regression.
KSP's deferral mechanism (returning symbols to be deferred from
process()
) is designed to handle this use case. Please try to use it and let us know if it doesn't serve your use case well.