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

Can not create reproducible archive #18

Open
aalmiray opened this issue Jun 27, 2023 · 0 comments
Open

Can not create reproducible archive #18

aalmiray opened this issue Jun 27, 2023 · 0 comments

Comments

@aalmiray
Copy link
Contributor

aalmiray commented Jun 27, 2023

If the addMainModuleInfo task is invoked with reproducible archive settings (see docs) then entries for module-info.class won't be reproducible.

Sample project can be found at https://github.com/aalmiray/helloworld-jpms-reproducible

Building a non reproducible archive with ./gradle build yields

$ unzip -l build/libs/helloworld-jpms-reproducible-1.0.0.jar 
Archive:  build/libs/helloworld-jpms-reproducible-1.0.0.jar
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  06-27-2023 19:31   META-INF/
       46  06-27-2023 19:31   META-INF/MANIFEST.MF
        0  06-27-2023 19:31   com/
        0  06-27-2023 19:31   com/acme/
      530  06-27-2023 19:31   com/acme/App.class
        0  06-27-2023 19:31   META-INF/versions/
        0  06-27-2023 19:31   META-INF/versions/11/
      183  06-27-2023 19:31   META-INF/versions/11/module-info.class
---------                     -------
      759                     8 files

Building a reproducible archive with ./gradlew build -PreproducibleBuild=true yields

$ unzip -l build/libs/helloworld-jpms-reproducible-1.0.0.jar 
Archive:  build/libs/helloworld-jpms-reproducible-1.0.0.jar
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  02-01-1980 00:00   META-INF/
       46  02-01-1980 00:00   META-INF/MANIFEST.MF
        0  02-01-1980 00:00   com/
        0  02-01-1980 00:00   com/acme/
      530  02-01-1980 00:00   com/acme/App.class
        0  06-27-2023 19:31   META-INF/versions/
        0  06-27-2023 19:31   META-INF/versions/11/
      183  06-27-2023 19:31   META-INF/versions/11/module-info.class
---------                     -------
      759                     8 files

Timestamp for module-info.class and its containing directories do not honor reproducible settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant