I just filed https://github.com/bazelbuild/intellij/issues/50 which notes that the Bazel plugin for IntelliJ doesn't support "hotswap" reloading of classes.Is this really true? Does nobody at Google use hotswap debugging with Bazel?! It seems shocking to me, as if I must have overlooked something.
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/d9d11568-861e-4de2-bb97-3caed4aa250d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CAN3hOS-82ymmYDmV8JXQFz27x5GopP%2BcyvAJ3WY_0uO5zTCp_Q%40mail.gmail.com.
The "hotswap" that Dan talks about is a very different thing than Kush's work of keeping a persistent test runner in the background, which is mainly a performance improvement.Dan talks about the IDE feature where you can reload individual classes while you're actively debugging a running app (e.g. to try a fix without having to restart the app).I think that would be cool to have, but to be honest, I've never used it myself (maybe because debugging Bazel is such an annoying setup due to our C++ launcher, which prevents us from simply debugging Bazel like any other Java application).+Tom Lundell for a quick judgement on this feature request.
On Wed, Feb 1, 2017 at 11:32 AM 'Damien Martin-guillerez' via bazel-discuss <bazel-discuss@googlegroups.com> wrote:
Yes there is no hotswapping for test yet. It is a question of correctness but +Kush Chakraborty is working on having something similar using worker on tests.
On Tue, Jan 31, 2017 at 8:51 AM Dan Fabulich <danfa...@gmail.com> wrote:
I just filed https://github.com/bazelbuild/intellij/issues/50 which notes that the Bazel plugin for IntelliJ doesn't support "hotswap" reloading of classes.Is this really true? Does nobody at Google use hotswap debugging with Bazel?! It seems shocking to me, as if I must have overlooked something.
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/d9d11568-861e-4de2-bb97-3caed4aa250d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
I don't think I agree with that assessment; I think this is, intimately, an IDE feature.Hotswap debugging doesn't technically require that the IDE launch the process. You can attach an IDE to a remote JVM on another machine over the Java Debug Interface. In addition to setting breakpoints (EventRequestManager#createBreakpointRequest) and stepping through code (#createStepRequest), a JDI client can, if it chooses, transmit modified classes to the remote process (VirtualMachine#redefineClasses), and the JVM will replace whatever class it loaded naturally and with the class definition that the IDE transmitted over the wire.IDEs are the "normal" clients for JDI; they typically compile the classes and launch the JVM, launching it in debug mode and attaching to the JVM over the Java Debug Wire Protocol (JDWP). When you want to hot swap, you edit the file in the IDE, save, rebuild, and the IDE can then reload the class at that time.You raise an interesting point that, in the case of the Bazel IntelliJ plugin, the plugin forces the IDE to delegate compiling classes and launching the JVM to Bazel, but the IDE still owns the JDWP connection. IntelliJ handles the breakpoints, stepping through code, enumerating threads, etc.If you tried to add a bazel-side CLI feature for this, you'd have to have Bazel launch the process and then have Bazel connect to the JVM over JDWP. Then, when a class was rebuilt, Bazel could send the compiled class over the JDWP connection.But if Bazel owns the JDWP connection, then only Bazel could manage the rest of the debugging facilities. Bazel would have to provide a console UI for debugging java processes, like jdb, and then I wouldn't be able to use the IntelliJ UI that I know and love for stepwise debugging. (I guess in principle Bazel could run a JDWP proxy server? But that sounds Hard™)So I claim, the thing to do is for the Bazel plugin to finish the compilation and then notify the IDE of any rebuilt classes. IntelliJ could then transmit those classes via JDWP to the launched process. (And a similar feature would have to be implemented/reimplemented in Eclipse.)-Dan
On Feb 1, 2017, at 12:19 PM, Tom Lundell <to...@google.com> wrote:
I don't exactly see what the IDE has to do with this, in this case? It doesn't compile, deploy, or manage the JVM -- bazel does. Hotswapping would have to be a bazel-side feature before the IDE could take advantage.
On Wed, Feb 1, 2017 at 6:41 AM, Philipp Wollermann <phi...@google.com> wrote:
The "hotswap" that Dan talks about is a very different thing than Kush's work of keeping a persistent test runner in the background, which is mainly a performance improvement.Dan talks about the IDE feature where you can reload individual classes while you're actively debugging a running app (e.g. to try a fix without having to restart the app).I think that would be cool to have, but to be honest, I've never used it myself (maybe because debugging Bazel is such an annoying setup due to our C++ launcher, which prevents us from simply debugging Bazel like any other Java application).+Tom Lundell for a quick judgement on this feature request.