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

Compilation errors in org.eclipse.tools.layout.spy and org.eclipse.ui.editors bundles in the IDE #1424

Closed
iloveeclipse opened this issue Sep 30, 2024 · 19 comments
Labels
bug Something isn't working regression Regression defect

Comments

@iloveeclipse
Copy link
Member

Not sure whether this is related to the split package issue or not, but using I20240929-1800 I see compilation errors in org.eclipse.tools.layout.spy and org.eclipse.ui.editors bundles.

The reason is that the compiler can't resolve org.eclipse.jdt.annotation anymore.

The only way to "fix" the errors is to add additional.bundles = org.eclipse.jdt.annotation line to the build.properties for each not compilable bundle.

Without looking into PDE / JDT code I can't understand why that is needed, as both affected bundles require the bundle in question in manifests via org.eclipse.jdt.annotation;resolution:=optional and I have the annotation bundle in both the workspace / target platform.

For me it looks like some PDE hard-coded hack, however, I don't understand why did it work last week with build I20240923-1800 but doesn't work this week with the new `I20240929-1800 SDK version.

I will provide patches for both bundle build files, but it would be better to understand why do we have such change first.

@iloveeclipse iloveeclipse added bug Something isn't working regression Regression defect labels Sep 30, 2024
iloveeclipse added a commit to iloveeclipse/eclipse.pde.ui that referenced this issue Sep 30, 2024
@iloveeclipse
Copy link
Member Author

Don't use additional bundles for this

Which solution do you propose?

@laeubi
Copy link
Contributor

laeubi commented Sep 30, 2024

Don't use additional bundles for this

Which solution do you propose?

At best JDT would support its own annotations out-of the box like PDE does for API-Tools and OSGi-DS/Bundle/... Annotations, or jars.extra.classpath can be used to specify (compile only) dependencies.

@iloveeclipse
Copy link
Member Author

I mean, which currently available solution exists to get an error free workspace?

@laeubi
Copy link
Contributor

laeubi commented Sep 30, 2024

I mean, which currently available solution exists to get an error free workspace?

jars.extra.classpath is available "since ever" ...

@iloveeclipse
Copy link
Member Author

Could you be so kind and provide the patch please? If I understand the linked ticket, currently it requires bundle file name, which is not nice as it has to be updated on every change.

@laeubi
Copy link
Contributor

laeubi commented Sep 30, 2024

jars.extra.classpath = platform:/plugin/org.eclipse.jdt.annotation should work

@iloveeclipse
Copy link
Member Author

OK, I wil try later, I understood the other ticket that symbolic name alone doesn't work.

@laeubi
Copy link
Contributor

laeubi commented Sep 30, 2024

I found this example that uses

jars.extra.classpath=platform:/plugin/org.apache.ant/lib/ant.jar,
   platform:/plugin/org.objectweb.asm

the first references a jar inside a bundle, the second only the bundle itself... still its odd that only you seem to seeing issues with that, the optional import is even not nice at all but should work (regardless of split packages).

@iloveeclipse
Copy link
Member Author

OK, in this particular case in org.eclipse.ui.editors nothing using jars.extra.classpath works:

jars.extra.classpath=platform:/plugin/org.eclipse.jdt.annotation_2.3.0.v20240111-2306.jar
jars.extra.classpath=platform:/plugin/org.eclipse.jdt.annotation
jars.extra.classpath=platform:/org.eclipse.jdt.annotation_2.3.0.v20240111-2306.jar
jars.extra.classpath=platform:/org.eclipse.jdt.annotation

Only additional.bundles = org.eclipse.jdt.annotation works.

@laeubi
Copy link
Contributor

laeubi commented Sep 30, 2024

jars.extra.classpath=platform:/plugin/org.eclipse.jdt.annotation is correct, you probably need to trigger update of the classpath container manually as I'm not sure this will taken automatically. If it does not work it needs to be fixed in PDE as this is used in other platform projects as well.

@merks
Copy link
Contributor

merks commented Sep 30, 2024

Funny I don't see such an error. Aren't the two bundles in the target platform?

image

@iloveeclipse
Copy link
Member Author

you probably need to trigger update of the classpath container manually

Tried to rebuild / close + rebuild, no way. Only IDE restart helped!

If it does not work it needs to be fixed in PDE as this is used in other platform projects as well.

The question is still: why it worked before and why it doesn't now?

iloveeclipse added a commit to iloveeclipse/eclipse.pde.ui that referenced this issue Sep 30, 2024
iloveeclipse added a commit to iloveeclipse/eclipse.platform.ui that referenced this issue Sep 30, 2024
@merks
Copy link
Contributor

merks commented Sep 30, 2024

Indeed. Another question, why does it work for me and not for you? The error suggests it's not in your target platform.

@iloveeclipse
Copy link
Member Author

Indeed. Another question, why does it work for me and not for you? The error suggests it's not in your target platform.

I have both annotation projects in my workspace. However, I've also tried to close them one by one, with no changes. Probably one need to restart IDE every time one changes here something...

@laeubi
Copy link
Contributor

laeubi commented Sep 30, 2024

I have now updated everything to the latest but the project compiles fine and annotation project is resolved
grafik

Probably one need to restart IDE every time one changes here something...

Right Click > Plugin Tools > Update Classpath... should be enough.

@merks
Copy link
Contributor

merks commented Sep 30, 2024

A freshly oomph IDE with the latest SDK installed and PDE and platform UI has no errors:

image

@HannesWell
Copy link
Member

Without looking into PDE / JDT code I can't understand why that is needed, as both affected bundles require the bundle in question in manifests via org.eclipse.jdt.annotation;resolution:=optional and I have the annotation bundle in both the workspace / target platform.

Have you tried what happens if you require the bundle non optionally?

Indeed. Another question, why does it work for me and not for you? The error suggests it's not in your target platform.

I have both annotation projects in my workspace. However, I've also tried to close them one by one, with no changes. Probably one need to restart IDE every time one changes here something...

Did you change the annotation projects in any way that they maybe don't resolve anymore?
Are they listed in the Target Platform State view? Bundles from the workspace are shown there too:
grafik

Because for me everything works as well using Build id: I20240929-1800 with the annotations in the TP.

@iloveeclipse
Copy link
Member Author

Another day, another issue. I couldn't reproduce with I20240930-1800 anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression Regression defect
Projects
None yet
Development

No branches or pull requests

4 participants