eclipse-corrosion / corrosion

Eclipse Corrosion - Rust edition in Eclipse IDE
Eclipse Public License 2.0
223 stars 31 forks source link

Build on macOS doesn't work #412

Closed dominikj111 closed 2 years ago

dominikj111 commented 2 years ago

Hello, I tried to build by my self and got couple issues, but stuck on one I can't to go over.

My environment System: macOS Monterey 12.6 Java: openjdk 17.0.4.1

I did build by this command JAVA_HOME=/usr/local/Cellar/openjdk@17/17.0.4.1 ./mvnw clean verify as I'm not allowed to change it globally, but this shouldn't by an issue.

And it can be seen that I'm using brew package version of Java.

  1. I have first question if there is minimum Java version requirement as it took me a bit energy to realize.

  2. I've got first issue where build failed, but I've got the info messages where "parent 1.2.4-SNAPSHOT" succeed as well as the "[bundle] Rust edition in Eclipse IDE 1.2.4-SNAPSHOT", but the "[test-bundle] Tests for Corrosion 1.0.0-SNAPSHOT" failed and rest have been skipped. I have got this message "Failed to execute goal org.eclipse.tycho: tycho-surefire-plugin:3.0.0-SNAPSHOT:". But this problem disappeared because of next issue.

  3. Failed to resolve target definition file:/Users/dominikjelinek/my/Development/projects/@corrosion/org.eclipse.corrosion/../target-platform/target-platform.target: Could not find "org.junit.jupiter.api/0.0.0" in the repositories of the current location

After investigation, I see that my target-platform.target has all units versions set to 0.0.0 what doesn't look right. So I suppose I've missed something from this page https://github.com/eclipse/corrosion/blob/master/CONTRIBUTING.md but honestly it is not really clear to start quickly.

mickaelistria commented 2 years ago

Thanks for the report. Indeed, some external changes are causing issues in the current build. I'm trying to fix that.

mickaelistria commented 2 years ago

I've fixed the build so now a simple mvn verify should work when using master.

dominikj111 commented 2 years ago

Great, just tested it and I'm still getting an issue. But I think this time it is related to my side. I'm not sure how to deal with this one.

I'm wondering if I need to install some swt cocoa external dependencies for my setup.

So as before I have this line in the console [test-bundle] Tests for Corrosion 1.0.0-SNAPSHOT ... FAILURE

and this in the log file

eclipse.buildId=unknown
java.version=17.0.4.1
java.vendor=Homebrew
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_GB
Framework arguments:  -application org.eclipse.tycho.surefire.osgibooter.uitest -testproperties /Users/dominikjelinek/my/Development/projects/@corrosion/org.eclipse.corrosion.tests/target/surefire.properties
Command-line arguments:  -data /Users/dominikjelinek/my/Development/projects/@corrosion/org.eclipse.corrosion.tests/target/work/data -application org.eclipse.tycho.surefire.osgibooter.uitest -testproperties /Users/dominikjelinek/my/Development/projects/@corrosion/org.eclipse.corrosion.tests/target/surefire.properties

!ENTRY org.eclipse.swt.gtk.linux.aarch64 2 0 2022-09-29 09:52:03.088
!MESSAGE Could not resolve module: org.eclipse.swt.gtk.linux.aarch64 [87]
  Unresolved requirement: Require-Capability: eclipse.platform; filter:="(& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=aarch64))"
  Unresolved requirement: Require-Capability: eclipse.platform; filter:="(& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=aarch64))"

!ENTRY org.eclipse.swt.win32.win32.x86_64 2 0 2022-09-29 09:52:03.089
!MESSAGE Could not resolve module: org.eclipse.swt.win32.win32.x86_64 [86]
  Unresolved requirement: Require-Capability: eclipse.platform; filter:="(& (osgi.ws=win32) (osgi.os=win32) (osgi.arch=x86_64))"
  Unresolved requirement: Require-Capability: eclipse.platform; filter:="(& (osgi.ws=win32) (osgi.os=win32) (osgi.arch=x86_64))"

!ENTRY org.eclipse.swt.cocoa.macosx.aarch64 2 0 2022-09-29 09:52:03.090
!MESSAGE Could not resolve module: org.eclipse.swt.cocoa.macosx.aarch64 [153]
  Unresolved requirement: Require-Capability: eclipse.platform; filter:="(& (osgi.ws=cocoa) (osgi.os=macosx) (osgi.arch=aarch64) )"
  Unresolved requirement: Require-Capability: eclipse.platform; filter:="(& (osgi.ws=cocoa) (osgi.os=macosx) (osgi.arch=aarch64) )"

!ENTRY org.eclipse.swt.gtk.linux.x86_64 2 0 2022-09-29 09:52:03.090
!MESSAGE Could not resolve module: org.eclipse.swt.gtk.linux.x86_64 [120]
  Unresolved requirement: Require-Capability: eclipse.platform; filter:="(& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=x86_64))"
  Unresolved requirement: Require-Capability: eclipse.platform; filter:="(& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=x86_64))"

!ENTRY org.eclipse.osgi 4 0 2022-09-29 09:52:03.090
!MESSAGE Application error
!STACK 1
org.eclipse.swt.SWTException: Invalid thread access
    at org.eclipse.swt.SWT.error(SWT.java:4918)
    at org.eclipse.swt.SWT.error(SWT.java:4833)
    at org.eclipse.swt.SWT.error(SWT.java:4804)
    at org.eclipse.swt.widgets.Display.error(Display.java:1164)
    at org.eclipse.swt.widgets.Display.createDisplay(Display.java:915)
    at org.eclipse.swt.widgets.Display.create(Display.java:899)
    at org.eclipse.swt.graphics.Device.<init>(Device.java:132)
    at org.eclipse.swt.widgets.Display.<init>(Display.java:753)
    at org.eclipse.swt.widgets.Display.<init>(Display.java:744)
    at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:741)
    at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:183)
    at org.eclipse.ui.internal.ide.application.IDEApplication.createDisplay(IDEApplication.java:182)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:125)
    at org.eclipse.tycho.surefire.osgibooter.UITestApplication.runApplication(UITestApplication.java:33)
    at org.eclipse.tycho.surefire.osgibooter.AbstractUITestApplication.run(AbstractUITestApplication.java:127)
    at org.eclipse.tycho.surefire.osgibooter.UITestApplication.start(UITestApplication.java:42)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1440)
mickaelistria commented 2 years ago

You may want to ignore the tests at the moment, adding -DskipTests to the mvn verify command. It could be a bug that -XstartOnFirstThread is not received here; as I don't have a mac, I don't think I'll be able to reproduce.

mickaelistria commented 2 years ago

I'm closing it here, since the build does work (but tests do not). Please open a new ticket for further analysis.