Possible handling macro without rebuild for scalac native image?
wisechengyi opened this issue · 2 comments
Hi!
https://github.com/graalvm/graalvm-demos/blob/master/scala-days-2018/scalac-native/README.md says
For macros to work the macro classes must be known to the image builder of the Scala compiler.
I am not too familiar with why that is the case, but is it technically possible not having to rebuild the scalac native image when macro changes? If so, what are steps to take?
We are currently evaluating a few options for low latency scala compilation, and this becomes a blocker because our codebase does have occasional macro changes.
@wisechengyi during the generation of the native image only the referenced and used classes are included in the final executable. When you change macros, most likely you'll make use of other classes that might not have been included in the original native image and it won't work without regenerating the executable with the changed macros.
In the future, GraalVM might offer the Java bytecode interpreter (like it does for the other supported languages) and it might be technically possible to load macros through that integration without rebuilding the base native image for scalac. However this is not currently possible.
I'll close this question issue, this is a repo with the demos. A more appropriate repository to ask questions about native image generation is the main one: oracle/graal.