Open aalmiray opened 1 year ago
If the addMainModuleInfo task is invoked with reproducible archive settings (see docs) then entries for module-info.class won't be reproducible.
addMainModuleInfo
module-info.class
Sample project can be found at https://github.com/aalmiray/helloworld-jpms-reproducible
Building a non reproducible archive with ./gradle build yields
./gradle build
$ 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
./gradlew build -PreproducibleBuild=true
$ 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.
If the
addMainModuleInfo
task is invoked with reproducible archive settings (see docs) then entries formodule-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
yieldsBuilding a reproducible archive with
./gradlew build -PreproducibleBuild=true
yieldsTimestamp for
module-info.class
and its containing directories do not honor reproducible settings.