Should we switch compilation state holder from Task.dest to a worker?
#6808
lefou
started this conversation in
Development
Replies: 1 comment 1 reply
-
|
One potential benefit of keeping the zinc analysis file in It's not clear to me what BSP problems you are talking about or how they relate to where the zinc analysis file is kept |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, compilation state is hold in a specific
Task.dest. That means, the only way to safely access that state is by evaluating that task and using it's result. But especially compilation processes have typically more state and interested parties than the singlecompiletask that holds the data.The most prominent issue is BSP. Due to the way the protocol is designed, BSP clients get access to the compilation target directory, whereas in Mill there isn't really an exposable dir. There is only a final
classesdir as a result of the compilation. This leads to a lot on idiosyncrasies in the Mill code. And we still have many issues with that, mostly visible as poor performance.But we have other state, that isn't directly exposed as a task result, but is nevertheless interesting. E.g. cached compiler messages. For example this question about a possibility to always should compiler messages. Wouldn't it be nice to have a task that simply can show all past but valid compiler messages like warnings and errors without forcing Mill to recompile everything by running
mill clean __.compilebefore?If we would hold the state in a Worker instead, we could have more than one task that access that state, without exposing everything. Most users of
compileare only interested in it's classpath contribution downstream, but not in the incremental state file. Butcompileitself is sometimes using the incremental information. But other information like cached previous compiler problems aren't accessible at all. Instead, we could have acomiledClassestask only returning the classes and acompilationProblemstask to access the compiler problems.Once we switch over to a worker approach, some currently hard to model issues can be implemented more elegantly or can be solved at all. For example, the open on-demand SemanticDB data generation via a compiler plugin as part of the normal compilation, could be solved much more elegantly and without touching the API surface of the modules.
Beta Was this translation helpful? Give feedback.
All reactions