Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xtext validation errors in Eclipse for DSL users #2717

Closed
jonahgraham opened this issue Jun 26, 2023 · 13 comments
Closed

Xtext validation errors in Eclipse for DSL users #2717

jonahgraham opened this issue Jun 26, 2023 · 13 comments
Milestone

Comments

@jonahgraham
Copy link

Using the 2023-09 M1 staging build I am getting a validation error on plug-ins in the launch configuration that I didn't see in 2023-06 release.

image

Steps to reproduce:

  1. Download eclipse-dsl-2023-09-M1-linux-gtk-x86_64.tar.gz and run it
  2. Create an XText project which has the mydsl simple example
  3. Run the Generate MyDsl (mydsl) Language Infrastructure Mwe2 launch
  4. Open the Launch Runtime Eclipse launch configuration Plug-ins tab
  5. Press Validate Plug-ins

The Validation screenshot reads:

  • The following problems were detected:
    • com.google.inject
      • Missing constraint: Import-Package: sun.misc; version="0.0.0"

Note that I don't see any failing behaviour with this warning, and I don't see a warning in the error log when launching the runtime eclipse. So I am starting here in xtext, but the error may certainly be somewhere else (such as PDE analysing differently that runtime, EPP missing a bundle, bad MANIFEST.MF for com.google.inject, or other).

In 2023-06 doing the same steps shows no validation errors. At the time of creating this bug report, the EPP build contains mostly the same content as 2023-06, except for Xtext.

@cdietrich
Copy link
Member

this is why i hate the p2 maven stuff.
any ideas how to resolve this?

cc @merks @HannesWell

switch back to good old orbit?

package-version=${version;===;${Bundle-Version}}
javax.inject-version-range=${range;[===,+);1}javax.inject-version=${version;===;1}
aopalliance-version-range=${range;[===,+);1.0}aopalliance-version=${version;===;1.0}
guava-version-range=${range;[===,+);30.1-jre}guava-version=${version;===;30.1-jre}
asm-version-range=${range;[===,+);9.1}asm-version=${version;===;9.1}

Eclipse-ExtensibleAPI: true

Export-Package:
!about.html,!about_files,
.internal.;x-internal:=true;version="${package-version}",
.implementation.;x-internal:=true;version="${package-version}",
.impl.;x-internal:=true;version="${package-version}",
*;version="${package-version}"

Import-Package:
!com.google.inject.*,
!javax.annotation,
!sun.misc,
*

is there a way to override the metadata in p2 maven?

@cdietrich cdietrich added this to the Release_2.32 milestone Jun 26, 2023
@cdietrich
Copy link
Member

p.s.: i am on vacation and wont be able to look into this anytime soon

@cdietrich
Copy link
Member

i also wonder why i dont see this when launching from dev eclipse.
is there a way to find out whi provides sun.misc from osgi console?

@jonahgraham
Copy link
Author

p.s.: i am on vacation and wont be able to look into this anytime soon

Please enjoy your vacation - thank you for providing an updated Xtext so early in the dev cycle so that we can resolve this issue with lots of time.

@cdietrich
Copy link
Member

well my time until september will also be very sparse so i definitively need some help here

@cdietrich
Copy link
Member

i also wonder why i see no error im maven too. nothing in the tooling indicates anything

@jonahgraham
Copy link
Author

Perhaps it is just a PDE issue - I will wait for comment from @HannesWell before i investigate further. And then hopefully we (me, Hannes, Ed) will have this resolved before you are back from vacation :-)

@cdietrich
Copy link
Member

sun.misc problem was also there with gson
eclipse-pde/eclipse.pde#482

@HannesWell
Copy link
Member

Perhaps it is just a PDE issue - I will wait for comment from @HannesWell before i investigate further. And then hopefully we (me, Hannes, Ed) will have this resolved before you are back from vacation :-)

I'm relatively sure that this is eclipse-pde/eclipse.pde#429.

Looking at the Manifest of guice I see (besides others):

Import-Package: [...],sun.misc
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))"

So Guice states it requires Java-1.8, but the JavaSE-1.8.profile in Equinox (on which PDE relies for bundles requiring osgi.ee 1.8) does not contain this package:
https://github.com/eclipse-equinox/equinox/blob/master/bundles/org.eclipse.osgi/JavaSE-1.8.profile

You can replicate this also with a Bundle-RequiredExecutionEnvironment: JavaSE-1.8, when your Plug-in imports the package sun.misc, then you get:
grafik

In the Target Platform State view of the staged Eclipse-DSL 2023-09 you can see a similar resolution error.
grafik

So the problem is either in equinox for providing incomplete profiles or in PDE on relying on them. Anyway I'll take care of this.
Anyway, I'll take care of this. Anyone interested is invited to join the discussion in the PDE issue.

switch back to good old orbit?

As it was mentioned in eclipse-pde/eclipse.pde#429 artifacts from Orbit have similar issues.

@jonahgraham
Copy link
Author

Thank you so much @HannesWell for the clear explanation. I will follow along on the PDE issue and close this one.

@merks
Copy link
Contributor

merks commented Jun 26, 2023

It's nice to see an issue resolved after a long eventful flight to Montreal!

@HannesWell
Copy link
Member

Perhaps it is just a PDE issue - I will wait for comment from @HannesWell before i investigate further. And then hopefully we (me, Hannes, Ed) will have this resolved before you are back from vacation :-)

I'm relatively sure that this is eclipse-pde/eclipse.pde#429.

This issue is fixed in PDE since yesterday.
I was not able to update the Eclipse-DSL with the 4.29-I-builds repo to the lastest versions of the SDK plugins, but if I use the Eclipse-SDK I-build and the following TP resolves without any error.

<target name="xtext">
	<locations>
		<location includeAllPlatforms="false" includeConfigurePhase="true"
			includeMode="planner" includeSource="true" type="InstallableUnit">
			<repository location="https://download.eclipse.org/eclipse/updates/4.29-I-builds/" />
			<repository location="https://download.eclipse.org/modeling/tmf/xtext/updates/composite/latest/" />
			<unit id="org.eclipse.sdk.feature.group" version="0.0.0" />
			<unit id="org.eclipse.xtext.sdk.feature.group" version="0.0.0" />
		</location>
	</locations>
</target>

If I start a simple Eclipse Application based only on the features org.eclipse.sdk and org.eclipse.xtext.sdk it just launches without any error.
So therefore I assume this issue is finally fixed, but it should be verified with the next SimRel staging that contains the latest sdk I-build.

@cdietrich
Copy link
Member

Thx @HannesWell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants