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

Mysterious comparator errors on org.eclipse.jdt.core.compiler.batch #1395

Closed
iloveeclipse opened this issue Sep 25, 2023 · 20 comments · Fixed by #1401
Closed

Mysterious comparator errors on org.eclipse.jdt.core.compiler.batch #1395

iloveeclipse opened this issue Sep 25, 2023 · 20 comments · Fixed by #1401
Assignees
Labels
bug Something isn't working regression Regression defect
Milestone

Comments

@iloveeclipse
Copy link
Member

Follow up on #1388

After "fixing" the original issue we've observed in https://download.eclipse.org/eclipse/downloads/drops4/I20230922-1800/buildlogs/comparatorlogs/buildtimeComparatorUnanticipated.log.txt, the next build was OK but one build after was reported as unstable for exact same reason:

https://download.eclipse.org/eclipse/downloads/drops4/I20230923-1800/buildlogs/comparatorlogs/buildtimeComparatorUnanticipated.log.txt

1.  eclipse.jdt.core/org.eclipse.jdt.core.compiler.batch/pom.xml
   no-classifier: different
      org/eclipse/jdt/internal/compiler/ast/TypeReference.class: different
      org/eclipse/jdt/internal/compiler/parser/Parser.class: different
    The main artifact has been replaced with the baseline version.
    The following attached artifacts have been replaced with the baseline version: [sources]

However there is no artifactcomparisons.zip generated / linked to https://download.eclipse.org/eclipse/downloads/drops4/I20230923-1800/buildlogs.php that would show bytecode diff.

I assume this is a tycho issue, may be related to the "special" way we build org.eclipse.jdt.core.compiler.batch bundle for #1203.

Note: very last SDK build was OK, but only because we had real changes on batch compiler.

So what we need is:

  1. Understand where is the problem of "changed" bytecode is coming from (recent tycho change?).
  2. Make sure artifactcomparisons.zip is generated for org.eclipse.jdt.core.compiler.batch if buildtimeComparatorUnanticipated.log.txt
  3. Understand where is the problem of "changed" bytecode is coming from (Java 21 branch merged recently to jdt?).
@iloveeclipse iloveeclipse added bug Something isn't working regression Regression defect labels Sep 25, 2023
@iloveeclipse
Copy link
Member Author

@laeubi : could you please check this?

@laeubi
Copy link
Contributor

laeubi commented Sep 25, 2023

@iloveeclipse as far as I can see a released Tycho version is now used so you should not see any changes in Tycho

Only thing I could think of would be that a changed compiler is used in the I-Build but the published repository is published by another step using "old" compiler but the full I-Build is kind of a mystery, is this visible also in the local build when one runs https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/ ?

@iloveeclipse
Copy link
Member Author

is this visible also in the local build

As far as I know the artifactcomparisons.zip & Co are only generated for eclipse.org I-builds / website publishing.

@laeubi
Copy link
Contributor

laeubi commented Sep 25, 2023

If you specify -Dcompare-version-with-baselines.skip=false it should be enabled and fail the build, I think the I build works with this disabled an scans the log for such messages later on but @mickaelistria can maybe better tell here.

@mickaelistria
Copy link
Contributor

To fail the build in case of errors -Dcompare-version-with-baselines.skip=false should do the trick.
But I-Builds use another strategy (IIRC they do run the apitools application after the build) as they generate some report flles that plain Tycho check doesn't generate.

@laeubi
Copy link
Contributor

laeubi commented Sep 26, 2023

So how do I access the logfiles of the maven build?

I tried https://download.eclipse.org/eclipse/downloads/drops4/I20230925-1800/ > "View the logs for the current build." but this seems to only cover test result logs.

@laeubi
Copy link
Contributor

laeubi commented Sep 26, 2023

@iloveeclipse thanks, looking at the logs the problem is quite clear because the message is emitted at the phase where the compiler is build for the I-Build itself, I think at that stage we should simply disable the baseline replace check all together.

@iloveeclipse
Copy link
Member Author

Why did it work before?

@laeubi
Copy link
Contributor

laeubi commented Sep 26, 2023

It seems now JDT produces a little bit different byte-code, so what happens is this:

  1. compiler is compiled with "old" bytecode
  2. this compiler is then used to produce a compiler jar with "new" bytecode
  3. then this is deployed to the ibuild repository
  4. on the next cycle the compiler is compiled with "old" bytecode and compared to the artifact with "new" bytecode
  5. --> comparator error

@iloveeclipse
Copy link
Member Author

OK, is the "old" compiler == 4.29 version? The "new" one is created after merging Java 21 branch to master, and we know we had generation changes, see #1378 .

So @laeubi : could you push fixed maven call?

@laeubi
Copy link
Contributor

laeubi commented Sep 26, 2023

How to reproduce:

  1. fetch the aggregator repositories
  2. run mvn clean install -pl :eclipse-sdk-prereqs,:org.eclipse.jdt.core.compiler.batch -DlocalEcjVersion=99.99
  3. You see the follwoing warning in the build log:

[WARNING] MavenProject: org.eclipse.jdt:org.eclipse.jdt.core.compiler.batch:3.36.0-SNAPSHOT @ eclipse-aggregator/eclipse.platform.releng.aggregator/eclipse.jdt.core/org.eclipse.jdt.core.compiler.batch/pom.xml: baseline and build artifacts have same version but different contents
   no-classifier: different
      org/eclipse/jdt/internal/compiler/ast/ExpressionContext.class: different
      org/eclipse/jdt/internal/compiler/ast/TypeReference.class: different
      org/eclipse/jdt/internal/compiler/parser/Parser.class: different

laeubi added a commit to laeubi/eclipse.jdt.core that referenced this issue Sep 26, 2023
Currently the baseline settings are hardcoded (and always override the
platform parent configuration), this extract these into some properties
that can be overridden from the commandline.

This also adjust the Jenkinsfile to use this new way of selectively
disable replace/compare of the baseline in case of building the
compiler-compiler.

See eclipse-platform/eclipse.platform.releng.aggregator#1395
@laeubi
Copy link
Contributor

laeubi commented Sep 26, 2023

@akurtakov
Copy link
Member

one way to try workarounding the issue is:

Thinking more about it - it has to be done regardless of other fixes so all other builds use the new compiler not only the Ibuild.

@laeubi
Copy link
Contributor

laeubi commented Sep 26, 2023

Here is the fix for ibuild when JDT changes are merged:

iloveeclipse pushed a commit to eclipse-jdt/eclipse.jdt.core that referenced this issue Sep 26, 2023
Currently the baseline settings are hardcoded (and always override the
platform parent configuration), this extract these into some properties
that can be overridden from the commandline.

This also adjust the Jenkinsfile to use this new way of selectively
disable replace/compare of the baseline in case of building the
compiler-compiler.

See eclipse-platform/eclipse.platform.releng.aggregator#1395
@iloveeclipse
Copy link
Member Author

@laeubi : thanks, I've merged both commits. Are we ready for new IBuild, or should we wait for regular one?

@iloveeclipse
Copy link
Member Author

Are we ready for new IBuild,

There are also two Javadoc errors shown in releng tests that we could fix first.

@iloveeclipse
Copy link
Member Author

Thinking more about it - it has to be done regardless of other fixes so all other builds use the new compiler not only the Ibuild.

This should happen anyway after M1. Let us see if the two merged PRs fixed the issue.

@iloveeclipse
Copy link
Member Author

Let us see if the two merged PRs fixed the issue.

Yep: https://download.eclipse.org/eclipse/downloads/drops4/I20230926-0600/

@iloveeclipse iloveeclipse added this to the 4.30 M1 milestone Sep 26, 2023
robstryker pushed a commit to robstryker/eclipse.jdt.core that referenced this issue Jul 18, 2024
Currently the baseline settings are hardcoded (and always override the
platform parent configuration), this extract these into some properties
that can be overridden from the commandline.

This also adjust the Jenkinsfile to use this new way of selectively
disable replace/compare of the baseline in case of building the
compiler-compiler.

See eclipse-platform/eclipse.platform.releng.aggregator#1395
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
4 participants