Skip to content

Reproducible Build: need to inject JDK distribution details to rebuild #3563

Closed

Description

@hboutemy

rebuilding Mockito releases to check thatbuild can really be reproduced bit for bit: https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/org/mockito/mockito-core/README.md

for release 5.15.2, the only issue I get is in 3 .jar (not all):

├── META-INF/MANIFEST.MF
│ @@ -1,13 +1,13 @@
│  Manifest-Version: 1.0
│  Bundle-ManifestVersion: 2
│  Bundle-Name: mockito-errorprone
│  Bundle-SymbolicName: mockito-errorprone
│  Bundle-Version: 5.15.2
│ -Created-By: 21.0.5 (Azul Systems, Inc.)
│ +Created-By: 21.0.5 (Eclipse Adoptium)
│  Import-Package: com.google.errorprone;version="[2.23,3)",com.google.er
│   rorprone.bugpatterns;version="[2.23,3)",com.google.errorprone.fixes;v

which means the build is in theory reproducible, but in practice for these 3 jars I need to use EXACTLY 21.0.5 (Azul Systems, Inc.)

questions:

  • can I inject a build property to override the value automatically detected from effective JDK details?
  • do you have another strategy for rebuilders?

Activity

  1. hboutemy commented on Jan 3, 2025

    @hboutemy
    ContributorAuthor

    notice: I tried injecting -Pmanifest.createdBy='21.0.5 (Azul Systems, Inc.)' as done for Junit https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/org/junit/junit5/README.md
    but Mockito build did not take the value...

  2. TimvdLippe commented on Jan 3, 2025

    @TimvdLippe
    Contributor

    The relevant implementation in JUnit: junit-team/junit-framework@2a4326b#diff-b6c0ec6facb84213a6f79b874524c6093403e575490d547a04ac8e6102d33cba

    "Created-By" to (buildParameters.manifest.createdBy.orNull
        ?: "${System.getProperty("java.version")} (${System.getProperty("java.vendor")} ${System.getProperty("java.vm.version")})"),
    

    We configure ours for mockito-core here:

    manifest {
    attributes(
    "Premain-Class" to "org.mockito.internal.PremainAttach",
    "Can-Retransform-Classes" to "true",
    )
    }
    However, we define a convention for it and I think we should configure it for all artifacts here: https://github.com/mockito/mockito/blob/main/buildSrc/src/main/kotlin/mockito.java-library-conventions.gradle.kts

    Feel free to submit a PR to configure the property like JUnit does.

  3. JuyeopJang commented on Aug 7, 2025

    @JuyeopJang
    Contributor

    @TimvdLippe

    Hi, I’m interested in contributing to this issue. Would it be okay for me to take it on?

    If there are any contribution guidelines or specific things I should keep in mind while addressing it, I’d really appreciate it if you could share them.

    Thanks!

  4. TimvdLippe commented on Aug 9, 2025

    @TimvdLippe
    Contributor

    Feel free to do so! The CONTRIBUTING.md file has some instructions.

  5. added a commit that references this issue on Aug 11, 2025
    23eb8de
  6. JuyeopJang commented on Aug 11, 2025

    @JuyeopJang
    Contributor

    Hi @TimvdLippe,

    Thank you for the guidance. I've created a pull request #3704 to address this issue.

    I've followed the contribution guidelines and included a detailed description with manual verification steps.

    Looking forward to your feedback!

  7. added a commit that references this issue on Aug 11, 2025
    ad6ae2f
  8. added a commit that references this issue on Aug 16, 2025
    ecc3bcb
  9. added a commit that references this issue on Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions