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
Restructure JDT core to get proper ecj bundle #182
Conversation
@iloveeclipse +1 for moving the fragments into the ECJ bundle. They offer additional functionality to make the ECJ better integrate with the Java ecosystem. Technically they are not required for the IDE. However, they do make ECJ a better offering with those APIs and should be shipped together. It doesn't make sense to have them be separate fragments. My hypothesis is that they are separate because they have been created long time ago while JDT was much more strict with who and what goes into |
2e22ab5
to
b1cdb18
Compare
OK, got rebase working with |
b1cdb18
to
59091d2
Compare
@iloveeclipse I have no idea why but the unit Lines 97 to 101 in 53f5b7b
if I remove this the build can resolve ecj.core... |
This is probably because it was "artificially" generated out of jdt core and other bundles. OK, I will remove that later to see where the build will fail next. |
80a80c2
to
e8c3354
Compare
Hey Andrey,
|
@mpalat : sorry I haven't updated the patch here on last commit, below is the last state I've commented on #181. The split package is solved by reexporting packages, and yes, your understanding is correct. Update With the help from @laeubi I was able to fix first round of maven errors. Something was built, so that even (all gerrit?) tests were executed. So far only 24 failures in org.eclipse.jdt.apt.pluggable.tests. The same tests run fine in the IDE, and I don't see clear pointer why don't they run in maven. |
@stephan-herrmann can you help with the tests maybe? I see in one test:
this seems that on the maven setup something is either missing (e.g. "the" Processor) or such an item has unresolved requirements and thus can't be loaded. @iloveeclipse I don't know if there are maybe any resources relevant here, there is a stupid behaviour in PDE that it includes all resources in the IDE, but maintains a build.properties what resources are included when the bundle is build... so it might be that a resource that is required here is missing in the build-jar. Beside that, maybe it could reveal some issues if one is not using jdt.core but the compiler bundle directly where appropriate? But thats just a wild guess... |
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-antrun-plugin</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akurtakov can you maybe help here so we replace this by maven resource filtering? seems more suitable than an ant-run ... maybe similar to
https://github.com/eclipse-tycho/tycho/blob/master/tycho-core/pom.xml#L30
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's in my todo list to look at this one at some point.
I believe the problem with org.eclipse.jdt.apt.pluggable.tests could be that the org.eclipse.jdt.apt.pluggable.core imported wrong packages from old apt fragments of jdt core because the packages merged into batch compiler were not re-exported to jdt.core. |
e8c3354
to
dd585a0
Compare
Hmm, now it says
and I can reproduce in the IDE if I exclude compiler.apt fragment from the target platform. Same with test below
So that thing somehow can't find re-exported packages at runtime. batch plugin re-exports them to jdt core and it is fine for compilation, but that seem to be not enough at runtime. |
Have a look at
Perhaps it can just be removed for good, given that we no longer support ecj on Java < 6. |
Yep, that was it. |
dd585a0
to
afd8473
Compare
Cool, no test fails, let merge for RC1 !!! :-) Just a note for those who care: "git blame" still works for files in batch compiler, the moved files are understood as "moved" by git so the entire history is still there (at least in latest EGit). Now the boring part starts:
|
afd8473
to
43dd9f9
Compare
@ALL : if this state builds & tests are OK would it make sense to merge and "break" SDK build? This would at least make sure everyone else interested to get things done in SDK would need to help here. |
Yes, please. Now is the perfect time for that work. |
The org.eclipse.jdt.core.ecj.validation was a "dummy" bundle so far, used only to validate compilation issues in IDE. That one is renamed (org.eclipse.jdt.core.ecj.validation -> org.eclipse.jdt.core.compiler.batch) and is a proper maven library now. It is actually the ecj compiler library without any dependencies (except optional ant), that could be consumed by JDT and the rest of the world. It must be required and re-exported by JDT core. Unfortunately, there are two split packages: - org.eclipse.jdt.internal.compiler - org.eclipse.jdt.internal.compiler.parser So the new bundle exports them to jdt.core and jdt.core re-exports. org.eclipse.jdt.compiler.apt and org.eclipse.jdt.compiler.tool were fragments of jdt.core, now they are inside org.eclipse.jdt.core.compiler.batch. TODO: 1) What I did NOT tried is to re-write all the magic scripts that build and package separated ecj library out of jdt.core. 2) The 3 antadapter classes are now split over ecj and jdt core, because BuildJarIndex.java and CheckDebugAttributes.java depend on JDT core code. 3) ecj.1 and build_ecj.xml aren't touched yet. ecj.1 was touched last time 2017, it seem to be used for man pages. 4) pom from jdt core will need an adoption. 5) org.eclipse.jdt-feature need to be updated 6) TBC See - eclipse-jdt#181 - eclipse-platform/eclipse.platform.ua#18
43dd9f9
to
b96347a
Compare
OK, the build is green, I will merge that now, with ~100% probability to break SDK build. |
@iloveeclipse why do you think this will break SDK build (and what needs to be done/changed to mitigate this?). |
Because batch compiler / ecj jar had extra treatment and I'm pretty sure some of "extra" steps missing we don't run in Jenkins to "manually merge & copy & publish not-really-maven library to some SDK special places". E.g. there is a dedicated section for JDT Core Batch Compiler & source jars on download page: https://download.eclipse.org/eclipse/downloads/drops4/I20221201-0500/ I bet this will not work, as I have no idea where the final jars were produced and if the existing code finds them now in maven target directory. |
@akurtakov : I must be blind, I can't find where 4.27 build jobs are, I don't see them here: https://ci.eclipse.org/releng/view/Builds/ |
Is that what you are looking for? |
Arrgh. That's somehow hidden. I will trigger one now. |
I've added links to readme: eclipse-platform/eclipse.platform.releng.aggregator#733 |
The jobs are autocreated from git content in https://ci.eclipse.org/releng/job/Builds/ and https://ci.eclipse.org/releng/job/Builds/ . Real structure instead of jenkins view. |
First breakage can be fixed well inside JDT: https://github.com/eclipse-jdt/eclipse.jdt/blob/master/org.eclipse.jdt-feature/feature.xml |
[DRAFT] An idea how to restructure JDT core to get proper ecj bundle
The org.eclipse.jdt.core.ecj.validation was a "dummy" bundle so far,
used only to validate compilation issues in IDE.
That one should be renamed (org.eclipse.jdt.core.ecj.validation ->
org.eclipse.jdt.core.compiler.batch) and be a proper maven library.
It is actually the ecj compiler library without any dependencies, that
could be consumed by JDT and the rest of the world.
It must be required and re-exported by JDT core.
Unfortunately, there are two split packages:
org.eclipse.jdt.internal.compiler
org.eclipse.jdt.internal.compiler.parser
So the new bundle exports them to jdt.core and jdt.core re-exports.
org.eclipse.jdt.compiler.apt and org.eclipse.jdt.compiler.tool were
fragments of jdt.core, now they would be inside
org.eclipse.jdt.core.compiler.batch.
TODO:
and package separated ecj library out of jdt.core.
BuildJarIndex.java and CheckDebugAttributes.java depend on JDT core
code.
time 2017, it seem to be used for man pages.
See
NOTE:
Since the patch moves subtree, "usual" rebase in egit doesn't work (and I guess in github too)
To properly rebase it on latest master, following command should be used:
git rebase -s subtree master