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

fix duplicated classes in bootstrap jar #2347

Merged
merged 2 commits into from
Dec 16, 2021

Conversation

SylvainJuge
Copy link
Member

@SylvainJuge SylvainJuge commented Dec 16, 2021

What does this PR do?

Fixes a packaging issue introduced with #2341.
Classes that are copied as resources are being added to the bootstrap jar, and as a result Jacoco fails due to duplicated bytecode. In practice it might not have any effect at runtime as the classes are loaded by location only and can't be accessed by standard classloaders.

Doing a simple unzip -l apm-agent-bootstrap/target/apm-agent-bootstrap-1.28.2-SNAPSHOT.jar shows the issue.

Before:

Archive:  apm-agent-bootstrap/target/apm-agent-bootstrap-1.28.2-SNAPSHOT.jar
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  2021-12-16 09:53   META-INF/
       81  2021-12-16 09:53   META-INF/MANIFEST.MF
        0  2021-12-16 09:53   java/
        0  2021-12-16 09:53   java/lang/
     2899  2021-12-16 09:53   java/lang/IndyBootstrapDispatcher.class
        0  2021-12-16 09:53   bootstrap/
        0  2021-12-16 09:53   bootstrap/java/
        0  2021-12-16 09:53   bootstrap/java/lang/
     2899  2021-12-16 09:53   bootstrap/java/lang/IndyBootstrapDispatcher.esclazz
        0  2021-12-16 09:53   co/
        0  2021-12-16 09:53   co/elastic/
        0  2021-12-16 09:53   co/elastic/apm/
        0  2021-12-16 09:53   co/elastic/apm/agent/
        0  2021-12-16 09:53   co/elastic/apm/agent/modulesetter/
     1912  2021-12-16 09:53   co/elastic/apm/agent/modulesetter/ModuleSetter.class
        0  2021-12-16 09:53   bootstrap/co/
        0  2021-12-16 09:53   bootstrap/co/elastic/
        0  2021-12-16 09:53   bootstrap/co/elastic/apm/
        0  2021-12-16 09:53   bootstrap/co/elastic/apm/agent/
        0  2021-12-16 09:53   bootstrap/co/elastic/apm/agent/modulesetter/
     1912  2021-12-16 09:53   bootstrap/co/elastic/apm/agent/modulesetter/ModuleSetter.esclazz
        0  2021-12-16 09:53   META-INF/maven/
        0  2021-12-16 09:53   META-INF/maven/co.elastic.apm/
        0  2021-12-16 09:53   META-INF/maven/co.elastic.apm/apm-agent-bootstrap/
     6624  2021-12-16 09:53   META-INF/maven/co.elastic.apm/apm-agent-bootstrap/pom.xml
       78  2021-12-16 09:53   META-INF/maven/co.elastic.apm/apm-agent-bootstrap/pom.properties
---------                     -------
    16405                     26 files

After the change:

Archive:  apm-agent-bootstrap/target/apm-agent-bootstrap-1.28.2-SNAPSHOT.jar
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  2021-12-16 09:45   bootstrap/
        0  2021-12-16 09:45   bootstrap/co/
        0  2021-12-16 09:45   bootstrap/co/elastic/
        0  2021-12-16 09:45   bootstrap/co/elastic/apm/
        0  2021-12-16 09:45   bootstrap/co/elastic/apm/agent/
        0  2021-12-16 09:45   bootstrap/co/elastic/apm/agent/modulesetter/
        0  2021-12-16 09:45   bootstrap/java/
        0  2021-12-16 09:45   bootstrap/java/lang/
     1912  2021-12-16 09:45   bootstrap/co/elastic/apm/agent/modulesetter/ModuleSetter.esclazz
     2899  2021-12-16 09:45   bootstrap/java/lang/IndyBootstrapDispatcher.esclazz
---------                     -------

@SylvainJuge SylvainJuge added the await-release Mark issues that depend on next release, or PRs that are planned to be included label Dec 16, 2021
@apmmachine
Copy link
Contributor

apmmachine commented Dec 16, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-12-16T09:27:09.012+0000

  • Duration: 70 min 41 sec

  • Commit: 0d3a35f

Test stats 🧪

Test Results
Failed 0
Passed 2639
Skipped 21
Total 2660

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run benchmark tests : Run the benchmark test.

  • run compatibility tests : Run the JDK Compatibility test.

  • run integration tests : Run the APM-ITs.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@SylvainJuge SylvainJuge enabled auto-merge (squash) December 16, 2021 09:08
@SylvainJuge SylvainJuge merged commit e4a02a0 into elastic:master Dec 16, 2021
@SylvainJuge SylvainJuge deleted the fix-bootstrap-packaging branch December 16, 2021 10:37
@SylvainJuge SylvainJuge removed the await-release Mark issues that depend on next release, or PRs that are planned to be included label Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants