-
Notifications
You must be signed in to change notification settings - Fork 83
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
API tooling goes amok in Jenkins, need some extra logging #782
Comments
Irrespective of that, extra logging would be helpful especially when this is reported in the log ( instead of workspace - where user can actually see the baseline and Java version) |
I think one way would be to run this as a local build when it happens and then one can enable debug output of maven to see more details of what Tycho has computed... |
Tycho SNAPSHOTS will soon contain an improved ApiToolsMojo: this will allow to set a debug flag to print out more details about the used API baseline including EE and ApiTools version:
|
@iloveeclipse I have enabled Tycho 4.0.4-SNAPSHOT now: I consider this issue as done with that (as it is not a pure PDE issue actually), so if you still see any issues please let me know. |
Would the below errors from https://ci.eclipse.org/jdt/job/eclipse.jdt.core-Github/job/PR-1447/5 fit the bill of this issue?
Read: Analysis points to an existing type and complains that it has been removed. Really? |
Same here: https://ci.eclipse.org/jdt/job/eclipse.jdt.debug-github/job/PR-324/1/console @laeubi : please fix tycho or revert the changes to use latest tycho. |
@stephan-herrmann I don't think that these sarcastic undertones help to resolve the issue, I just want to remind to this (still not resolve) JDT issue where jdt is unable to compile valid java code into valid byte code (really? ;-) what works fine on javac (and now with Java 21 third preview will reach even greater audience): and yes there are some "insane" sideeffects possible with API tools see for example: and no one really likes to support bugfixing and/or improvements (I think @vik-chand is the only one somehow dedicated to it) in that area, why I suggested to discontinue this: but it does not get much attention back there why we have to live with that for a while. So here are some instructions for anyone who is willing to help understand/fixing the problem:
If you can see the problem (you should already get some debug output), go back to your IDE:
This one builds fine with the given instructions above, could you please try if you can reproduce the problem or any special jdt specific settings are required to reproduce the problem?
The PR fails to compile for me locally:
|
@stephan-herrmann @iloveeclipse can you please "replay" a failing build and add |
See https://ci.eclipse.org/jdt/job/eclipse.jdt.debug-github/job/PR-324/2/ |
and https://ci.eclipse.org/jdt/job/eclipse.jdt.core-Github/job/PR-1447/7/ |
Which exact error was it? One line is missing. Note, PR eclipse-jdt/eclipse.jdt.debug#324 doesn't change any signatures, and only touches PListParser in a different bundle. So whatever compilation error happened in ClasspathContainerTests it seem to be unrelated to the PR in question. Also I see no errors in the IDE with that PR. |
I found another build and replayed it but now now API tools errors: so it seems to be some kind of race condition in API tools or it depend on what is available on the I-Build repository... |
FYI, it's probably not helpful, but I see this kind of thing happen in my SDK IDE occasionally too. Sometimes there are just a sea of errors about removed things that are obviously not removed. The only reliable way I found to "fix" this is to delete the API baseline in the preferences and to let the Oomph setup build a new one. |
I just used the maven comandline for compile so maybe this is an intermediate problem.
At least it helps to understand that this is nothing that can be fixed at Tycho side. If it occurs again, it might be good to put a breakpoint at where the error is generated to see what state ApiTools make think the is a problem. |
The debug says for the simple (compiler) case:
anything suspicious? Here is the output from more complex failure with a larger baseline:
|
It might look like hijacking the thread but we should seriously ask ourselves - Is anyone willing to spend the time supporting PDE API tools? |
Last time only @vik-chand stepped up, I tried to fix some findings while developing Tycho but this seems hard to track as it is not always reproducible.
m2e also support calling the Tycho-Mojo for validation. |
I now tried to reproduce the problem locally with even Java 21 enabled, but the build succeeds as expected (except some warnings), so it does not seem to be directly related to Tycho. I even tried with a complete empty m2 repo to make sure there are no leftovers from previous builds. The only thing i noticed is that it sometime uses Java 17 and sometimes Java 21 as system component, this might be the autodiscovery feature of JDT, so if one can point me to how to disable this I can probably set that flag at Tycho (even though it does not seem to make api tools fail) maybe this is more some jobs running in parallel? I'll later try to install a job listener so verify this. |
If this recreates in the IDE, I could fix it. I tried to recreate it locally but it seemed to work. |
This is a good hint. For some reason, the API baseline has incorrect system library ( may be also incorrect plugins) |
Could it because of parallel API analysis @iloveeclipse ? Not sure if we disabled this during our API tool test cases. |
I always assumed that the API tooling for Tycho re-uses the API tooling from PDE. If that is not the case, I suggest to deprecate the PDE API tooling and mark it for deletion so that we COULD (do not have to) disable it after the API deletion period. |
Tycho has 2 different baseline verifications plugins - one on top of PDE API tools (used in Platform builds) and another based on bnd . |
Should help to understand strange API analysis errors. See eclipse-pde/eclipse.pde#782
So, after setting two VM properties on jenkins still API errors... Related log part: |
An observation: we see an increased number of API failures on jenkins from various repositories after switching to tycho 4.0.4 in eclipse-platform/eclipse.platform.releng.aggregator#1437. If API analysis was "just" not stable before, and mostly on JDT/Java 21, now it seem to be completely broken, independently on the repository. Can we revert to tycho 4.0.3 or at least check what could be changed in 4.0.4 that causes such major increase of API errors? |
I see the tycho doesn't use I see that the project is imported into the workspace: and the workspace autobuild is disabled: What I don't see is: where do we build the project, wait till it is built & check that compilation had no errors? |
If it is reproducible on a PR please let me know, currently the problem seems only on Jenkins infra what makes it hard to tackle.
The project is not compiled because API tools is using the JDT-AST to analyses projects that are of source type, if it is not a source type the classes compiled by Tycho are used, or we use the jar from the target platform. |
This PR constantly produces API errors in Jenkins: eclipse-jdt/eclipse.jdt.debug#324
This surprises me a lot. But if API tooling goes over sources, how it can miss whole types? Could you also in tycho add error log listener to Platform and report all errors/warnings in the platform to the maven output? I wonder if the AST couldn't be created because something couldn't be resolved but we miss these errors. |
Thinking more, I wonder if the build is needed because AST creation needs some referenced classes to be generated / available to resolve something. Could you please trigger project build in your tycho code, in the same way it was done in the original code of ApiAnalysisApplication? |
I checked out the pr and run
but build is successful :-\ So there must be something in Jenkins that is different and makes it behave not like a local (clean) build....
I have no clue ... especially I would expect it to always fail or always succeed ...
The main entry point (that is used by Tycho) is: Lines 109 to 130 in 27cf508
as you can see there is a distinction between a "binary" BundleComponent what works on precompiled jar but has no support for getting source references see: #785 what would be much better because actually always have a binary compiled jar what we actually want to compare ... Second case is the As explained here #782 (comment) one can even (remote) debug what happens exactly there when running with
Actually compiling the code (again) is what should be avoided as API this often has lead to (other) strange errors where there was an (intermediate) compilation problem. Also the old way showed exactly these errors we see now, so I first like to understand the cause of it and and make it more deterministic. I hope the added debugging might give a hint on whats going on when it fails. |
I'll try tomorrow with a fresh checkout to make sure there is nothing from a IDE build there... |
I wonder if we must explicitly wait for the JDT indexer. |
This is the one we might need to wait for. |
|
This did the trick for me to reproduce the problem on local machine! So it seems that the IDE is generating some kind of file(s) that later makes the API tools succeed. So I head over to my previously working checkout and deleted the
|
It might be related to |
I now have prepared a fix for Tycho here: also created: @vik-chand would be great if you can take a look at: |
@iloveeclipse @stephan-herrmann the bugfix is online now, please restart the failing builds to verify if it now works without problems. |
Build jdt.core/PR-1447/8 triggered by @iloveeclipse (thanks!) was successful. |
Very impressive detective work and teamwork! 🥇 |
I am on vacation this week. Will look at this list next week |
Is there a way to disable indexing all together? This seem to use additional memory and I like to see if it will work without: |
That should reduce possible side effects on API analysis. See eclipse-pde/eclipse.pde#782
Should help to understand strange API analysis errors. See eclipse-pde/eclipse.pde#782
Something similar to #771 (but not on Java 21), reported for this change (which doesn't break or add or remove any API): eclipse-platform/eclipse.platform.ui#1097.
Full maven log: https://ci.eclipse.org/platform/job/eclipse.platform.ui/job/PR-1097/4/consoleFull
Relevant part says that most of JFace API was removed. !?!?
I can only assume that something completely weird happening in the API application, like not finding any classes or comparing "empty" state with baseline etc.
Since we can't find the root cause, we should at least provide more data while reporting API errors.
This could be:
The text was updated successfully, but these errors were encountered: