Sloeber / arduino-eclipse-plugin

A plugin to make programming the arduino in eclipse easy
https://eclipse.baeyens.it/
422 stars 132 forks source link

Update WorkAround.java #1688

Open kb1sph opened 1 month ago

kb1sph commented 1 month ago

Fixed missing quotes for ARDUINO_HOST_OS, ARDUINO_FQBN and ARDUINO_VARIANT that prevent compiling.

jantje commented 1 month ago

This is a very tricky part of the code as all platforms are a bit different. Which board did you do this for? Which arduino sketch can be used to test the issue and the fix?

kb1sph commented 1 month ago

When compiling two different ESP32 boards with multiple sketches using the latest ardiono-esp32 core I was getting an error. I had previously reported this bug, https://github.com/Sloeber/arduino-eclipse-plugin/issues/1649. This seams to fix the bug. I noticed the problem when I realized that sloeber makes a modified version of the platform.txt file and almost all of the variables with quotes had the added backslash, but those three that were causing a failure to compile did not have the backsplash even though they had quotes. Seemed like a pretty obvious fix, so I modified the platform.sloeber.txt file and then it compiled. I then searched the code for the part that makes that file and added lines similar to the already existing ones to replace the quotes with three backslashes and a quote just like the other ones above it in the code.

jantje commented 1 month ago

The pull request does not build because of code error shown below. How did you test this? image

UPDATE: FYI if you change anything in the workaround creation you should update the line below so Sloeber knows it should recreate the sloeber.txt files private static final String FIRST_SLOEBER_WORKAROUND_LINE = "#Sloeber created TXT file V3.00.test 26 ";

kb1sph commented 3 weeks ago

My apologies, someone when I typed the changed on no sleep, I hit the period instead of underscore on 2 out of 3 lines. I corrected that. Also updated that to say test 26 as you mentioned. As far as testing it, I have not tested compiling because I don't have a suitable environment to compile right now. I was thinking about setting up a virtual machine just for it. But I tested the changes that the added code makes and it worked, so the proposed changes seemed obvious based on your existing code. I just had some typos unfortunately. Hopefully the change should be good now.

jantje commented 3 weeks ago

But I tested the changes that the added code makes and it worked,

It looks to me you tested with sloeber v4.X and made the changes to V5.X and according to my tests the changes are not needed in V5 as lots of ESP32 problems should be fixed in there. Unfortunately V5 is not 100% compatible with V4 and the "convert to sloeber" method leaves some manual work. Have you tried V5? You can find the latest version in the latest successful build after you clicked actions at the top of this page. Here is the link to the latest successful build https://github.com/Sloeber/arduino-eclipse-plugin/actions/runs/11582425343

kb1sph commented 3 weeks ago

Does Sloeber not install this update when you go to Help -> Check for Updates? I downloaded the new version and extracted it to it's own director (C:\Sloeber5) and when I start it I got this. image Version still says 4.4.2 (image not changed yet?) Here's what the log showed.

`!SESSION 2024-11-02 13:29:41.467 ----------------------------------------------- eclipse.buildId=unknown java.version=21.0.5 java.vendor=Eclipse Adoptium BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US Framework arguments: --perspective io.sloeber.product.perspective Command-line arguments: -os win32 -ws win32 -arch x86_64 --perspective io.sloeber.product.perspective

!ENTRY org.eclipse.ui.intro 4 0 2024-11-02 13:29:49.337 !MESSAGE C:\Sloeber5\introContent.xml (The system cannot find the file specified) !STACK 0 java.io.FileNotFoundException: C:\Sloeber5\introContent.xml (The system cannot find the file specified) at java.base/java.io.FileInputStream.open0(Native Method) at java.base/java.io.FileInputStream.open(FileInputStream.java:213) at java.base/java.io.FileInputStream.(FileInputStream.java:152) at java.base/java.io.FileInputStream.(FileInputStream.java:106) at java.base/sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:84) at java.base/sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:180) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:654) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:150) at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:861) at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:825) at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at java.xml/com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:247) at java.xml/com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:342) at java.xml/javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:178) at org.eclipse.ui.internal.intro.impl.model.loader.IntroContentParser.parse(IntroContentParser.java:87) at org.eclipse.ui.internal.intro.impl.model.loader.IntroContentParser.(IntroContentParser.java:55) at org.eclipse.ui.internal.intro.impl.model.IntroModelRoot.loadDOM(IntroModelRoot.java:879) at org.eclipse.ui.internal.intro.impl.model.IntroModelRoot.loadChildren(IntroModelRoot.java:203) at org.eclipse.ui.internal.intro.impl.model.AbstractIntroContainer.getChildren(AbstractIntroContainer.java:71) at org.eclipse.ui.internal.intro.impl.model.IntroModelRoot.loadModel(IntroModelRoot.java:164) at org.eclipse.ui.internal.intro.impl.model.loader.BaseExtensionPointManager.loadModel(BaseExtensionPointManager.java:98) at org.eclipse.ui.internal.intro.impl.model.loader.ExtensionPointManager.loadCurrentModel(ExtensionPointManager.java:64) at org.eclipse.ui.internal.intro.impl.model.loader.ExtensionPointManager.getCurrentModel(ExtensionPointManager.java:76) at org.eclipse.ui.intro.config.CustomizableIntroPart.init(CustomizableIntroPart.java:154) at org.eclipse.ui.internal.ViewIntroAdapterPart.init(ViewIntroAdapterPart.java:183) at org.eclipse.ui.internal.ViewReference.initialize(ViewReference.java:129) at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:344) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56) at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:977) at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:939) at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:139) at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:386) at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:312) at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:203) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:90) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:59) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42) at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:132) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:991) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:658) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$1.run(PartRenderingEngine.java:543) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:527) at org.eclipse.e4.ui.workbench.renderers.swt.ElementReferenceRenderer.createWidget(ElementReferenceRenderer.java:73) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:991) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:658) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showTab(StackRenderer.java:1389) at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.postProcess(LazyStackRenderer.java:114) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:676) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:72) at org.eclipse.e4.ui.workbench.renderers.swt.SashRenderer.processContents(SashRenderer.java:147) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:72) at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:662) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:672) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:762) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:727) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:711) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1079) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:639) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:546) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605) at org.eclipse.equinox.launcher.Main.run(Main.java:1481) `

After getting past that and trying to install the esp32 in Platforms and Boards, I get this error. image And the log file shows this

!ENTRY org.eclipse.ui.workbench 4 2 2024-11-02 15:18:30.959 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench". !STACK 0 java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0 at org.eclipse.ui.intro.config.CustomizableIntroPart.getPresentationControl(CustomizableIntroPart.java:329) at org.eclipse.ui.intro.config.CustomizableIntroPart.saveState(CustomizableIntroPart.java:393) at org.eclipse.ui.internal.ViewIntroAdapterPart.saveState(ViewIntroAdapterPart.java:198) at org.eclipse.ui.internal.ViewReference.persist(ViewReference.java:60) at org.eclipse.ui.internal.Workbench$14.run(Workbench.java:1221) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47) at org.eclipse.ui.internal.Workbench.persist(Workbench.java:1211) at org.eclipse.ui.internal.Workbench$40.runInUIThread(Workbench.java:2858) at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:148) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4099) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3715) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:639) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:546) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:668) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:605) at org.eclipse.equinox.launcher.Main.run(Main.java:1481)

I deleted everything and started fresh again to take a video of the process. It was too big to be uploaded here, but can be viewed on YouTube for now at this link.

https://www.youtube.com/watch?v=iR7qkZvp8nw

jantje commented 3 weeks ago

Version still says 4.4.2 (image not changed yet?)

Indeed I still need to change the image.

!ENTRY org.eclipse.ui.intro 4 0 2024-11-02 13:29:49.337 !MESSAGE C:\Sloeber5\introContent.xml (The system cannot find the file specified) !STACK 0

This is caused by an error in the perspectives which makes Sloeber not to be the perspective. Trying to fix this now. I think the second error is also related to not being in the Sloeber perspective and opening the wrong intro (which only happens at the very first run) After startup and switching to the sloeber perspective this should not impact usability

I deleted everything and started fresh again to take a video of the process.

The video seems to be marked private. I can't see it.