konsoletyper / teavm

Compiles Java bytecode to JavaScript, WebAssembly and C
https://teavm.org
Apache License 2.0
2.55k stars 260 forks source link

Plugin incompatible with newest version of IDEA #903

Closed Ihromant closed 2 months ago

Ihromant commented 2 months ago

When trying to update to new IDEA, get the warning: Plugin incompatible with the new build found: teavm-idea-0.10.0-dev-11

catfoolyou commented 2 months ago

Yeah, I'm getting problems with IDEA as well. Compiling from the command line works fine though.

konsoletyper commented 2 months ago

Did you try to delete plugin and install it again? I have no idea why this happens, configuration looks ok, but IDEA still refuses to update plugin without any clear explanation (even nothing in logs).

Ihromant commented 2 months ago

No, I don't want to stop my development process when I'll not be able to restore previous state. I'm relying on some 0.10 functionality, so "stabilizing" with 0.9.2 is not an easy option. So for now I'm just not updating IDEA with TeaVM plugin. I don't know whether https://github.com/konsoletyper/teavm/issues/685 is complicated to implement, but this could resolve similar issues in the future.

konsoletyper commented 2 months ago

@Ihromant I don't understand your concern. Why you just don't remove plugin and install it again? If it does not work, what is the problem to download plugin (see here) and install it from disk?

konsoletyper commented 2 months ago

If you only need dev server from plugin, you can as well switch to Gradle and use new Gradle task for running it

Ihromant commented 2 months ago

IDEA shows hint that this plugin is uncompatible with newer version of IDEA. I suppose that it won't be installed correctly. This would mean that I need downgrade IDEA somehow.

konsoletyper commented 2 months ago

@Ihromant can you provide a screenshot?

Ihromant commented 2 months ago

Hm, It dissappeared. But 2 weeks ago I seen it. Will check and update the issue.

Ihromant commented 2 months ago

Screenshot_2024-04-12_16-21-25

konsoletyper commented 2 months ago

Yes, but what's the problem to remove plugin, then update IDEA, then install plugin again?

Ihromant commented 2 months ago

What should I do when it will fail? Downgrade IDEA?

konsoletyper commented 2 months ago

IF it fails, you can download plugin and install it as a file

Ihromant commented 2 months ago

After the update build just isn't starting. Screenshot_2024-04-12_18-37-23 Button clean and rebuild isn't working as well. I knew that I should'nt allow this update.

Ihromant commented 2 months ago

0.9.2 is working BTW. I suppose that now I need to workaround missing functionality and fixes.

konsoletyper commented 2 months ago

@Ihromant I fixed plugin. Now you can build from master and install it from file

Ihromant commented 2 months ago

@konsoletyper Unfortunately you don't fix the plugin. I installed it from disk, it has same issue as on screenshot above. So reverted back to 0.9.2.

konsoletyper commented 2 months ago

@Ihromant for me everything works now. What exactly did you do to install plugin from disk? Why is the plugin is a show-stopper for you? For what exactly are you using it?

Ihromant commented 2 months ago

Replaced jar in https://www.jetbrains.com/help/idea/directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#-6yxhtq_168 and reloaded IDEA (even using "Invalidate caches"). I'm using it to hot-reload code when I'm developing by pressing "Build". Also sometimes I'm debugging JS in IDEA (I don't like debugging in browser).

Ihromant commented 2 months ago

Other approach helped. I replaced only one class DevServerRunner.class using archive manager directly in jar. Now it works, thanks.

konsoletyper commented 2 months ago

Replaced jar in

Replaced with what?

You don't need to replace anything. You just build plugin and install it via GUI.

Ihromant commented 2 months ago

Replaced DevServerRunner.class in teavm-plugin.jar (using archive manager).

As a conclusion of this issue, I would like to suggest prioritizing https://github.com/konsoletyper/teavm/issues/685 . In this case there is no need for feature-builds of plugin and anybody can stay on stable plugin version and try newer versions of TeaVM.

konsoletyper commented 2 months ago

@Ihromant #685 won't solve issues like this. Actually, there are two issues: false "incompatibility" with IDEA (I think that was an issue somewhere in IDEA) and issue with building. The second issue was not with IDEA plugin, but with TeaVM itself. Either TeaVM 0.10.0-dev-11 was embedded into IDEA plugin or was taken from Gradle, the issue would be reproducible. Another problem is that whenever I fix #685, it would work only in one direction (i.e. newer version of IDEA plugin would be compatible with older versions of TeaVM), but not in both.

Ihromant commented 2 months ago

I can explain. To try teavm-dev version I am forced to update plugin (maybe it's possible to "hack" by replacing teavm jar in plugin folder, but even if it is working, it is still hack). During development you can break some plugin functionality and this issue comes together with dev-version. In this case fix is that nobody is forced to update plugin to try new TeaVM version. Also if something fails, he can easily roll back to stable version (or other dev version). Still I don't understand why it won't be compatible with future versions of TeaVM? Plugin jar itself is only 80 kb, I don't thins that it depends heavily on TeaVM classlib/compiler etc. Still, maybe I'm not understanding something.

konsoletyper commented 2 months ago

ring development you can break some plugin functionality and this issue comes together with dev-version. In this case fix is that nobody is forced to update plugin to try new TeaVM version.

Yes, but in this case it was the issue in TeaVM itself, not with plugin.

Also if something fails, he can easily roll back to stable version (or other dev version).

And now there's no problem just to download "latest stable" version and keep using it.

Still I don't understand why it won't be compatible with future versions of TeaVM? Plugin jar itself is only 80 kb, I don't thins that it depends heavily on TeaVM classlib/compiler etc. Still, maybe I'm not understanding something.

Plugin and TeaVM would communicate with each other via some interface. When this interface changes, only a new version of plugin can understand it. And plugin is also aware about older versions of interface. But it can't speculate about future versions of TeaVM. Anyway, such compatibility things always require extra efforts, which mean time. And time I always lack.