sparrowwallet / sparrow

Desktop Bitcoin Wallet focused on security and privacy. Free and open source.
https://sparrowwallet.com/
Apache License 2.0
1.36k stars 192 forks source link

building from source - deterministic build, differences in modules #192

Open nyxnor opened 3 years ago

nyxnor commented 3 years ago

Hi 👋. I am trying to build from source. As instructed here https://t.me/sparrowwallet/4640 I used these instructions https://adoptopenjdk.net/installation.html?variant=openjdk16&jvmVariant=hotspot#linux-pkg. The adoptopenjdk successfully installs. Debian Stable (bullseye) amd64 install:

cd
sudo apt-get install -y wget apt-transport-https gnupg
wget https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public
gpg --no-default-keyring --keyring ./adoptopenjdk-keyring.gpg --import public
gpg --no-default-keyring --keyring ./adoptopenjdk-keyring.gpg --export --output adoptopenjdk-archive-keyring.gpg
rm adoptopenjdk-keyring.gpg
sudo mv adoptopenjdk-archive-keyring.gpg /usr/share/keyrings
echo "deb [signed-by=/usr/share/keyrings/adoptopenjdk-archive-keyring.gpg] https://adoptopenjdk.jfrog.io/adoptopenjdk/deb $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/adoptopenjdk.list
sudo apt-get update -y
sudo apt-cache search adoptopenjdk
sudo apt-get install -y adoptopenjdk-16-hotspot
git clone --recursive git@github.com:sparrowwallet/sparrow.git
cd sparrow

Problem occurs here ./gradlew jpackage.

sudo ./gradlew jpackage
Downloading https://services.gradle.org/distributions/gradle-7.1-bin.zip
..........10%...........20%...........30%..........40%...........50%...........60%..........70%...........80%...........90%...........100%

Welcome to Gradle 7.1!

Here are the highlights of this release:
 - Faster incremental Java compilation
 - Easier source set configuration in the Kotlin DSL

For more details see https://docs.gradle.org/7.1/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

> Task :createDelegatingModules
/home/nyxnor/Documents/git/sparrow/build/jlinkbase/tmpjars/org.jdbi.v3.sqlobject/module-info.java:2: warning: [module] module name component v3 should avoid terminal digits
open module org.jdbi.v3.sqlobject {
                    ^
1 warning
/home/nyxnor/Documents/git/sparrow/build/jlinkbase/tmpjars/org.apache.commons.lang3/module-info.java:2: warning: [module] module name component lang3 should avoid terminal digits
open module org.apache.commons.lang3 {
                              ^
1 warning
/home/nyxnor/Documents/git/sparrow/build/jlinkbase/tmpjars/org.antlr.antlr4.runtime/module-info.java:2: warning: [module] module name component antlr4 should avoid terminal digits
open module org.antlr.antlr4.runtime {
                     ^
1 warning
/home/nyxnor/Documents/git/sparrow/build/jlinkbase/tmpjars/org.jdbi.v3.core/module-info.java:2: warning: [module] module name component v3 should avoid terminal digits
open module org.jdbi.v3.core {
                    ^
1 warning
/home/nyxnor/Documents/git/sparrow/build/jlinkbase/tmpjars/io.reactivex.rxjava2/module-info.java:2: warning: [module] module name component rxjava2 should avoid terminal digits
open module io.reactivex.rxjava2 {
                        ^
1 warning
/home/nyxnor/Documents/git/sparrow/build/jlinkbase/tmpjars/de.mkammerer.argon2/module-info.java:2: warning: [module] module name component argon2 should avoid terminal digits
open module de.mkammerer.argon2 {
                        ^
1 warning

> Task :jlink
WARNING: signed modular JAR /home/nyxnor/Documents/git/sparrow/build/jlinkbase/jlinkjars/bcprov-jdk15on-1.64.jar is currently not supported

> Task :jpackage FAILED
Error: Invalid or unsupported type: [rpm]

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':jpackage'.
> Process 'command '/usr/lib/jvm/adoptopenjdk-16-hotspot-amd64/bin/jpackage'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 5m 2s
19 actionable tasks: 19 executed

with --info

> Task :jpackage FAILED
Caching disabled for task ':jpackage' because:
  Build cache is disabled
Task ':jpackage' is not up-to-date because:
  Task has failed previously.
Watching 1047 directories to track changes
Watching 1012 directories to track changes
runtimeImageDir: /home/nyxnor/Documents/git/sparrow/build/image
taskData: org.beryx.jlink.data.JPackageTaskData(moduleName:com.sparrowwallet.sparrow, mainClass:com.sparrowwallet.sparrow.MainApp, customImageData:null, imageDir:/home/nyxnor/Documents/git/sparrow/build/extension 'jlink' property 'imageName', runtimeImageDir:/home/nyxnor/Documents/git/sparrow/build/image, jpackageData:org.beryx.jlink.data.JPackageData(jpackageHome:, outputDir:jpackage, imageOutputDir:/home/nyxnor/Documents/git/sparrow/build/jpackage, imageName:Sparrow, imageOptions:[--icon, src/main/deploy/package/linux/Sparrow.png, --resource-dir, src/main/deploy/package/linux/], resourceDir:null, targetPlatformName:null, skipInstaller:false, installerType:null, installerOutputDir:/home/nyxnor/Documents/git/sparrow/build/jpackage, installerName:Sparrow, appVersion:1.5.0, icon:null, installerOptions:[--file-associations, src/main/deploy/psbt.properties, --file-associations, src/main/deploy/txn.properties, --file-associations, src/main/deploy/bitcoin.properties, --file-associations, src/main/deploy/aopp.properties, --license-file, LICENSE, --resource-dir, src/main/deploy/package/linux/, --linux-shortcut, --linux-rpm-license-type, ASL 2.0], args:[], jvmArgs:[--add-opens=javafx.graphics/com.sun.javafx.css=org.controlsfx.controls, --add-opens=javafx.graphics/javafx.scene=org.controlsfx.controls, --add-opens=javafx.controls/com.sun.javafx.scene.control.behavior=org.controlsfx.controls, --add-opens=javafx.controls/com.sun.javafx.scene.control.inputmap=org.controlsfx.controls, --add-opens=javafx.graphics/com.sun.javafx.scene.traversal=org.controlsfx.controls, --add-opens=javafx.base/com.sun.javafx.event=org.controlsfx.controls, --add-opens=javafx.controls/javafx.scene.control.cell=com.sparrowwallet.sparrow, --add-opens=org.controlsfx.controls/impl.org.controlsfx.skin=com.sparrowwallet.sparrow, --add-opens=org.controlsfx.controls/impl.org.controlsfx.skin=javafx.fxml, --add-opens=javafx.graphics/com.sun.javafx.tk=centerdevice.nsmenufx, --add-opens=javafx.graphics/com.sun.javafx.tk.quantum=centerdevice.nsmenufx, --add-opens=javafx.graphics/com.sun.glass.ui=centerdevice.nsmenufx, --add-opens=javafx.controls/com.sun.javafx.scene.control=centerdevice.nsmenufx, --add-opens=javafx.graphics/com.sun.javafx.menu=centerdevice.nsmenufx, --add-opens=javafx.graphics/com.sun.glass.ui=com.sparrowwallet.sparrow, --add-opens=javafx.graphics/com.sun.javafx.application=com.sparrowwallet.sparrow, --add-opens=java.base/java.net=com.sparrowwallet.sparrow, --add-opens=java.base/java.io=com.google.gson, --add-reads=com.sparrowwallet.merged.module=java.desktop, --add-reads=com.sparrowwallet.merged.module=java.sql, --add-reads=com.sparrowwallet.merged.module=com.sparrowwallet.sparrow, --add-reads=com.sparrowwallet.merged.module=logback.classic, --add-reads=com.sparrowwallet.merged.module=com.fasterxml.jackson.databind, --add-reads=com.sparrowwallet.merged.module=com.fasterxml.jackson.annotation, --add-reads=com.sparrowwallet.merged.module=com.fasterxml.jackson.core], defaultJPackageHome:/usr/lib/jvm/adoptopenjdk-16-hotspot-amd64, secondaryLaunchers:[], launcherName:sparrow, JPackageHomeOrDefault:/usr/lib/jvm/adoptopenjdk-16-hotspot-amd64))
Starting process 'command '/usr/lib/jvm/adoptopenjdk-16-hotspot-amd64/bin/jpackage''. Working directory: /home/nyxnor/Documents/git/sparrow Command: /usr/lib/jvm/adoptopenjdk-16-hotspot-amd64/bin/jpackage --type rpm --dest /home/nyxnor/Documents/git/sparrow/build/jpackage --name Sparrow --app-version 1.5.0 --app-image /home/nyxnor/Documents/git/sparrow/build/jpackage/Sparrow --file-associations src/main/deploy/psbt.properties --file-associations src/main/deploy/txn.properties --file-associations src/main/deploy/bitcoin.properties --file-associations src/main/deploy/aopp.properties --license-file LICENSE --resource-dir src/main/deploy/package/linux/ --linux-shortcut --linux-rpm-license-type ASL 2.0
Successfully started process 'command '/usr/lib/jvm/adoptopenjdk-16-hotspot-amd64/bin/jpackage''
Error: Invalid or unsupported type: [rpm]

Watching 1042 directories to track changes
Watching 1076 directories to track changes
:jpackage (Thread[Execution worker for ':' Thread 2,5,main]) completed. Took 0.483 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':jpackage'.
> Process 'command '/usr/lib/jvm/adoptopenjdk-16-hotspot-amd64/bin/jpackage'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
19 actionable tasks: 1 executed, 18 up-to-date
Watching 1075 directories to track changes
Watching 1075 directories to track changes
Watching 1074 directories to track changes
Watching 1073 directories to track changes
Watching 1072 directories to track changes
Watching 1071 directories to track changes
Watching 1070 directories to track changes
Watching 1069 directories to track changes
Watching 1068 directories to track changes
Watching 1067 directories to track changes
Watching 1066 directories to track changes
Watching 1066 directories to track changes
Watching 1066 directories to track changes
Watching 1065 directories to track changes
Watching 1064 directories to track changes
Watching 1063 directories to track changes
Watching 1063 directories to track changes

with --stacktrace

> Task :jpackage FAILED
Error: Invalid or unsupported type: [rpm]

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':jpackage'.
> Process 'command '/usr/lib/jvm/adoptopenjdk-16-hotspot-amd64/bin/jpackage'' finished with non-zero exit value 1

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':jpackage'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:188)
        at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:186)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:174)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:79)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:79)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:74)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:408)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:395)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:388)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:374)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/adoptopenjdk-16-hotspot-amd64/bin/jpackage'' finished with non-zero exit value 1
        at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:414)
        at org.gradle.process.ExecResult$assertNormalExitValue.call(Unknown Source)
        at org.beryx.jlink.impl.JPackageTaskImpl$_execute_closure1.doCall(JPackageTaskImpl.groovy:106)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.beryx.jlink.impl.JPackageTaskImpl.execute(JPackageTaskImpl.groovy:70)
        at org.beryx.jlink.JPackageTask.jpackageTaskAction(JPackageTask.groovy:80)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.run(ExecuteActionsTaskExecuter.java:506)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:74)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:74)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:491)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:474)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:106)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:271)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:249)
        at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:83)
        at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:37)
        at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:50)
        at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:47)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:79)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:79)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:47)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:37)
        at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:68)
        at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:38)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:50)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:36)
        at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:41)
        at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:74)
        at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55)
        at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51)
        at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:29)
        at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:54)
        at org.gradle.internal.execution.steps.CaptureStateAfterExecutionStep.execute(CaptureStateAfterExecutionStep.java:35)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:60)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:27)
        at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:174)
        at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:74)
        at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:45)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:40)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:29)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:36)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:22)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:99)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:92)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:52)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:85)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:42)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:91)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:49)
        at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:106)
        at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:51)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:72)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:46)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:86)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:86)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:32)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:43)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:31)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:40)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution$2.withWorkspace(ExecuteActionsTaskExecuter.java:284)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:40)
        at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
        at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:44)
        at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:33)
        at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:76)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:185)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:174)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:79)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:79)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:74)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:408)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:395)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:388)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:374)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
19 actionable tasks: 1 executed, 18 up-to-date
craigraw commented 3 years ago

Hi - thanks for attempting a build, and for posting your detailed notes!

You should be able to get this fixed with

sudo apt-get install rpm-build

Debian typically doesn't have this package by default. You can also skip creating the installers altogether by editing build.gradle and changing line 201 to:

skipInstaller = true

I will create more detailed instructions on creating a reproducible build before releasing the next version. Note that you will need to have the same version of the JDK to create the same binaries as the official releases (starting from 1.5.0). It's likely this is already the case (check with java --version) but otherwise:

sudo apt-get install -y adoptopenjdk-16-hotspot=16.0.1+9-3
nyxnor commented 3 years ago
java --version
openjdk 16.0.1 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-16.0.1+9 (build 16.0.1+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-16.0.1+9 (build 16.0.1+9, mixed mode, sharing)

The above does not show the -3 of the version. This does: dpkg -l adoptopenjdk-16-hotspot

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                    Version      Architecture Description
+++-=======================-============-============-=============================================================
ii  adoptopenjdk-16-hotspot 16.0.1+9-3   amd64        OpenJDK Development Kit 16 (JDK) with Hotspot by AdoptOpenJDK
sudo apt-get install -y rpm
sudo ./gradlew jpackage
Starting a Gradle Daemon (subsequent builds will be faster)

> Task :jpackage
[scrubbed] Creating association with null extension.
[scrubbed] Creating association with null extension.
[scrubbed] Creating association with null extension.
[scrubbed] Creating association with null extension.
[scrubbed] Creating association with null extension.
[scrubbed] Creating association with null extension.
[scrubbed] Creating association with null extension.
[scrubbed] Creating association with null extension.

BUILD SUCCESSFUL in 55s
19 actionable tasks: 1 executed, 18 up-to-date

:100:

Complete debian install:

cd
sudo apt-get install -y wget apt-transport-https gnupg rpm
wget https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public
gpg --no-default-keyring --keyring ./adoptopenjdk-keyring.gpg --import public
gpg --no-default-keyring --keyring ./adoptopenjdk-keyring.gpg --export --output adoptopenjdk-archive-keyring.gpg
rm adoptopenjdk-keyring.gpg
sudo mv adoptopenjdk-archive-keyring.gpg /usr/share/keyrings
echo "deb [signed-by=/usr/share/keyrings/adoptopenjdk-archive-keyring.gpg] https://adoptopenjdk.jfrog.io/adoptopenjdk/deb $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/adoptopenjdk.list
sudo apt-get update -y
sudo apt-cache search adoptopenjdk
sudo apt-get install -y adoptopenjdk-16-hotspot=16.0.1+9-3
git clone --recursive git@github.com:sparrowwallet/sparrow.git
cd sparrow
git reset --hard 0b4785e01c72e9a819fea040d1fc9f667ea46c87 # git checkout 1.5.0-beta1
sudo ./gradlew jpackage

  1. Could you specify the date instead of at this time on the next release? https://github.com/sparrowwallet/sparrow#building The release binaries are reproducible (pre codesigning and installer packaging at this time).
nyxnor commented 3 years ago

Please provide clear instructions how to verify. I noticed my packages do not have the -beta1 in the name, even tough I used the 1.5.0-beta1 tag.

sudo find . -name "*.deb"
./build/jpackage/sparrow_1.5.0-1_amd64.deb
cd build/jpackage/
ls
Sparrow  sparrow_1.5.0-1_amd64.deb  sparrow-1.5.0-1.x86_64.rpm
drwxr-xr-x 4 root root      4096 Sparrow
-rw-r--r-- 1 root root  98327380 sparrow_1.5.0-1_amd64.deb
-rw-r--r-- 1 root root 102586743 sparrow-1.5.0-1.x86_64.rpm

sha256sum sparrow_1.5.0-1_amd64.deb 
761944923ace5ee4b0fcf2fe98b93662e9e6e9fdea9aa4d54b69929cbb5de437  sparrow_1.5.0-1_amd64.deb

sha256sum sparrow-1.5.0-1.x86_64.rpm 
4098db8fe2037e1f69c19b8c588605bd4ac0ffed48d8e98cf2b41d3a8a11e6f9  sparrow-1.5.0-1.x86_64.rpm

git describe --tags
1.5.0-beta1

Trying again:

git clone --recursive git@github.com:sparrowwallet/sparrow.git
cd sparrow/
git checkout 1.5.0-beta1
sudo ./gradlew jpackage

> Task :createDelegatingModules
/home/nyxnor/Documents/git/sparrow/build/jlinkbase/tmpjars/org.jdbi.v3.sqlobject/module-info.java:2: warning: [module] module name component v3 should avoid terminal digits
open module org.jdbi.v3.sqlobject {
                    ^
1 warning
/home/nyxnor/Documents/git/sparrow/build/jlinkbase/tmpjars/org.apache.commons.lang3/module-info.java:2: warning: [module] module name component lang3 should avoid terminal digits
open module org.apache.commons.lang3 {
                              ^
1 warning
/home/nyxnor/Documents/git/sparrow/build/jlinkbase/tmpjars/org.antlr.antlr4.runtime/module-info.java:2: warning: [module] module name component antlr4 should avoid terminal digits
open module org.antlr.antlr4.runtime {
                     ^
1 warning
/home/nyxnor/Documents/git/sparrow/build/jlinkbase/tmpjars/org.jdbi.v3.core/module-info.java:2: warning: [module] module name component v3 should avoid terminal digits
open module org.jdbi.v3.core {
                    ^
1 warning
/home/nyxnor/Documents/git/sparrow/build/jlinkbase/tmpjars/io.reactivex.rxjava2/module-info.java:2: warning: [module] module name component rxjava2 should avoid terminal digits
open module io.reactivex.rxjava2 {
                        ^
1 warning
/home/nyxnor/Documents/git/sparrow/build/jlinkbase/tmpjars/de.mkammerer.argon2/module-info.java:2: warning: [module] module name component argon2 should avoid terminal digits
open module de.mkammerer.argon2 {
                        ^
1 warning

> Task :jlink
WARNING: signed modular JAR /home/nyxnor/Documents/git/sparrow/build/jlinkbase/jlinkjars/bcprov-jdk15on-1.64.jar is currently not supported

> Task :jpackage
[23:23:48.624] Creating association with null extension.
[23:23:48.625] Creating association with null extension.
[23:23:48.869] Creating association with null extension.
[23:23:48.869] Creating association with null extension.
[23:24:02.119] Creating association with null extension.
[23:24:02.119] Creating association with null extension.
[23:24:04.530] Creating association with null extension.
[23:24:04.530] Creating association with null extension.

BUILD SUCCESSFUL in 2m 26s
19 actionable tasks: 19 executed

See the warning above about bcprovv-jdk15on-1.64.jar.

cd build/jpackage/
ls -l
total 196216
drwxr-xr-x 4 root root      4096 Sparrow
-rw-r--r-- 1 root root  98329612 sparrow_1.5.0-1_amd64.deb
-rw-r--r-- 1 root root 102586919 sparrow-1.5.0-1.x86_64.rpm

I am in the sparrow telegram group if you prefer for fast test instructions.

nyxnor commented 3 years ago

Excellent, it worked, Final version POSIX compliant but uses debian package manager and sources.list.d, which is different for other distros. Adapt accordingly with this guide https://adoptopenjdk.net/installation.html#.

#!/bin/sh

GIT_TAG="1.5.0-beta1"
ADOPTOPENJDK_VERSION_MAJOR="16"
ADOPTOPENJDK_VERSION_COMPLETE="16.0.1+9-3"
CRAIG_64BIT_KEY="E946 1833 4C67 4B40" # spaced out | source: https://keybase.io/craigraw
CRAIG_EMAIL="craigraw@gmail.com"
NESSARY_PACKAGES="wget apt-transport-https gnupg rpm"

cd || exit 1
mkdir sparrow
cd sparrow || exit 1
mkdir sparrow-build
cd sparrow-build || exit 1
printf "\n# Installing necessary packages\n\n"
sudo apt install -y ${NESSARY_PACKAGES}
printf "\n\n# Adding adoptopenjdk signing key\n\n"
wget https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public
gpg --no-default-keyring --keyring ./adoptopenjdk-keyring.gpg --import public
gpg --no-default-keyring --keyring ./adoptopenjdk-keyring.gpg --export --output adoptopenjdk-archive-keyring.gpg
rm adoptopenjdk-keyring.gpg
sudo mv adoptopenjdk-archive-keyring.gpg /usr/share/keyrings
printf %s"deb [signed-by=/usr/share/keyrings/adoptopenjdk-archive-keyring.gpg] https://adoptopenjdk.jfrog.io/adoptopenjdk/deb $(lsb_release -sc) main\n" >/dev/null | sudo tee /etc/apt/sources.list.d/adoptopenjdk.list
printf "\n\n# Installing adoptopenjdk\n\n"
sudo apt update -y
sudo apt install -y adoptopenjdk-"${ADOPTOPENJDK_VERSION_MAJOR}"-hotspot="${ADOPTOPENJDK_VERSION_COMPLETE}"
printf "\n\n# Cloning recursively sparrow git repository\n\n"
git clone --recursive git@github.com:sparrowwallet/sparrow.git
cd sparrow || exit 1
git checkout --quiet "${GIT_TAG}"
printf "\n\n# Building binaries from source\n\n"
sudo ./gradlew jpackage

cd || exit 1
cd sparrow || exit 1
mkdir sparrow-github-binaries
cd sparrow-github-binaries || exit 1
printf "\n\n# Downloading Craig's pgp pub key and verifying with indicated 64bit key\n\n"
curl https://keybase.io/craigraw/pgp_keys.asc | gpg --import
KEY_VERIFICATION=$(gpg --fingerprint "${CRAIG_EMAIL}" | grep -c "${CRAIG_64BIT_KEY}")
[ "${KEY_VERIFICATION}" -ne 1 ] && { printf "64bit key wanted does NOT match the imported key\n" ; exit 1 ; }
printf "\n\n# Dowloading binaries provided on Github\n\n"
wget https://github.com/sparrowwallet/sparrow/releases/download/"${GIT_TAG}"/sparrow-"${GIT_TAG}"-manifest.txt
wget https://github.com/sparrowwallet/sparrow/releases/download/"${GIT_TAG}"/sparrow-"${GIT_TAG}"-manifest.txt.asc
wget https://github.com/sparrowwallet/sparrow/releases/download/"${GIT_TAG}"/sparrow-"${GIT_TAG}".tar.gz
VERIFY_MANIFEST_KEY=$(printf %s"$(gpg --verify sparrow-${GIT_TAG}-manifest.txt.asc sparrow-${GIT_TAG}-manifest.txt 2>&1)" | grep -c "Good signature")
[ "${VERIFY_MANIFEST_KEY}" -ne 1 ] && { printf "WARNING: manifest.txt.asc does NOT verify manifest.txt with a 'Good Signature'\n" ; exit 1 ; }
COMPARE_MANIFEST_WITH_TARGZ=$(sha256sum -c sparrow-"${GIT_TAG}"-manifest.txt --ignore-missing | grep -c "sparrow-${GIT_TAG}.tar.gz: OK")
[ "${COMPARE_MANIFEST_WITH_TARGZ}" -ne "1" ] && { printf %s"WARNING: manifest.txt sha256sum does NOT match with sparrow-${GIT_TAG}.tar.gz\n" ; exit 1 ; }
sudo tar -xf sparrow-"${GIT_TAG}".tar.gz
printf "\n"
sha256sum ~/sparrow/sparrow-github-binaries/Sparrow/bin/Sparrow # just to send to stdout
sha256sum ~/sparrow/sparrow-build/sparrow/build/jpackage/Sparrow/bin/Sparrow # just to send to stdout
SHASUM_DOWNLOADED_BINARIES=$(sha256sum ~/sparrow/sparrow-github-binaries/Sparrow/bin/Sparrow | cut -c1-64)
SHASUM_BUILT_BINARIES=$(sha256sum ~/sparrow/sparrow-build/sparrow/build/jpackage/Sparrow/bin/Sparrow | cut -c1-64)
[ "${SHASUM_DOWNLOADED_BINARIES}" = "${SHASUM_BUILT_BINARIES}" ] \
&& printf %s"\nEXCELLENT: Build is Reproducible for TAG=${GIT_TAG} --> Binaries provided on Github does match built binaries\n" \
|| printf %s"\nWARNING: Build is NOT reproducible for TAG=${GIT_TAG} --> Binaries provided on Github does NOT match built binaries\n"
cd || exit 1
craigraw commented 3 years ago

Thanks for this, good work!

Note that you are checking the hash on the bin/Sparrow executable only - it is better IMO to check all the files in the Sparrow folder (for example using diff -r).

I've created a first draft of instructions for creating a reproducible build at https://github.com/sparrowwallet/sparrow/blob/master/docs/reproducible.md. Feedback appreciated.

I'd like to add your script at the end for Debian/Ubuntu users - let me know if that's ok?

nyxnor commented 3 years ago

I'd like to add your script at the end for Debian/Ubuntu users - let me know if that's ok?

Of course, let me compare all of the file first as explained above and include in the script.

Running:

diff -r ~/sparrow/sparrow-github-binaries/Sparrow/ ~/sparrow/sparrow-build/sparrow/build/jpackage/Sparrow/

:( lib/runtime/lib/modules differ

Binary files /home/nyxnor/sparrow/sparrow-github-binaries/Sparrow/lib/runtime/lib/modules and /home/nyxnor/sparrow/sparrow-build/sparrow/build/jpackage/Sparrow/lib/runtime/lib/modules differ
$ sha256sum ~/sparrow/sparrow-build/sparrow/build/jpackage/Sparrow/lib/runtime/lib/modules 
cfee1336f60670911a0696f88c486b60da205c84108921e074ef68618b284766  /home/nyxnor/sparrow/sparrow-build/sparrow/build/jpackage/Sparrow/lib/runtime/lib/modules

$ sha256sum ~/sparrow/sparrow-github-binaries/Sparrow/lib/runtime/lib/modules
22da75d7f2d5916450c4d2724309b1e9060da09dffc2afa06435e8d894bcbf53  /home/nyxnor/sparrow/sparrow-github-binaries/Sparrow/lib/runtime/lib/modules

Can you verify if yours match with mine? java --version

java --version
openjdk 16.0.1 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-16.0.1+9 (build 16.0.1+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-16.0.1+9 (build 16.0.1+9, mixed mode, sharing)
craigraw commented 3 years ago

Damn, that's unfortunate. Would it be possible to install diffoscope to check what the differences are in the modules file?

nyxnor commented 3 years ago
diffoscope ~/sparrow/sparrow-build/sparrow/build/jpackage/Sparrow/lib/runtime/lib/modules ~/sparrow/sparrow-github-binaries/Sparrow/lib/runtime/lib/modules
+[ Too much input for diff (SHA256: 2e1bf91ea64db6fab958dfea600b32564953d58432e232c530edb4651d966a45) ]
craigraw commented 3 years ago

Sorry, I missed out a step. For each modules file, you need to extract first using jimage (which you should have as part of the JDK install. e.g.

jimage extract ~/sparrow/sparrow-build/sparrow/build/jpackage/Sparrow/lib/runtime/lib/modules

It will extract to whatever folder you're currently in, so I find it best to create two empty folders first, one for each module.

You can then run diffoscope to compare the folders against each other, which should be more manageable for it to handle.

nyxnor commented 3 years ago

When the result comes, will post, seems to be a long task.

It did not save to a file by default, will have to run again. From stdout it just seems to be the modificaton time of the file:

│ │ │ │ │ @@ -1,8 +1,8 @@
│ │ │ │ │  
│ │ │ │ │    Size: 4096         Blocks: 8          IO Block: 4096   directory
│ │ │ │ │  Links: 3
│ │ │ │ │  Access: (0755/drwxr-xr-x)  Uid: ( 1000/  nyxnor)   Gid: ( 1000/  nyxnor)
│ │ │ │ │  
│ │ │ │ │ -Modify: 2021-09-09 13:35:11.210034324 +0000
│ │ │ │ │ +Modify: 2021-09-09 13:36:13.711649829 +0000
│ │ │ │ │   --- build/modules-extracted/simple.json.rpc.server/com/github/arteam/simplejsonrpc
│ │ │ │ ├── +++ github-binaries/modules-extracted/simple.json.rpc.server/com/github/arteam/simplejsonrpc
│ │ │ │ │ ├── stat {}
│ │ │ │ │ │ @@ -1,8 +1,8 @@
│ │ │ │ │ │  
│ │ │ │ │ │    Size: 4096       Blocks: 8          IO Block: 4096   directory
│ │ │ │ │ │  Links: 3
│ │ │ │ │ │  Access: (0755/drwxr-xr-x)  Uid: ( 1000/  nyxnor)   Gid: ( 1000/  nyxnor)
│ │ │ │ │ │  
│ │ │ │ │ │ -Modify: 2021-09-09 13:35:11.210034324 +0000
│ │ │ │ │ │ +Modify: 2021-09-09 13:36:13.711649829 +0000
│ │ │ │ │ │   --- build/modules-extracted/simple.json.rpc.server/com/github/arteam/simplejsonrpc/server
│ │ │ │ │ ├── +++ github-binaries/modules-extracted/simple.json.rpc.server/com/github/arteam/simplejsonrpc/server
craigraw commented 3 years ago

Diffoscope can be a bit too picky sometimes!

I think it would help to use diff -r on the two folders to narrow things down. Then diffoscope can be used directly on the files that actually differ in content, not date (which is immaterial to us here). Sorry for not providing clear instructions from the start.

nyxnor commented 3 years ago

nyxnor@momma-deb:~/sparrow/modules$ diffoscope build/modules-extracted/com.sparrowwallet.drongo/com/sparrowwallet/drongo/Network.class github-binaries/modules-extracted/com.sparrowwallet.drongo/com/sparrowwallet/drongo/Network.class
--- build/modules-extracted/com.sparrowwallet.drongo/com/sparrowwallet/drongo/Network.class
+++ github-binaries/modules-extracted/com.sparrowwallet.drongo/com/sparrowwallet/drongo/Network.class
├── procyon -ec {}
@@ -4,15 +4,14 @@
 public enum Network
 {
     MAINNET("mainnet", 0, "1", 5, "3", "bc", ExtendedKey.Header.xprv, ExtendedKey.Header.xpub, 8332), 
     TESTNET("testnet", 111, "mn", 196, "2", "tb", ExtendedKey.Header.tprv, ExtendedKey.Header.tpub, 18332), 
     REGTEST("regtest", 111, "mn", 196, "2", "bcrt", ExtendedKey.Header.tprv, ExtendedKey.Header.tpub, 18443), 
     SIGNET("signet", 111, "mn", 196, "2", "tb", ExtendedKey.Header.tprv, ExtendedKey.Header.tpub, 38332);

-    public static final String BLOCK_HEIGHT_PROPERTY = "com.sparrowwallet.blockHeight";
     private final String name;
     private final int p2pkhAddressHeader;
     private final String p2pkhAddressPrefix;
     private final int p2shAddressHeader;
     private final String p2shAddressPrefix;
     private final String bech32AddressHrp;
     private final ExtendedKey.Header xprvHeader;

nyxnor@momma-deb:~/sparrow/modules$ diffoscope build/modules-extracted/com.sparrowwallet.drongo/com/sparrowwallet/drongo/protocol/ScriptType$9.class github-binaries/modules-extracted/com.sparrowwallet.drongo/com/sparrowwallet/drongo/protocol/ScriptType$9.class
--- build/modules-extracted/com.sparrowwallet.drongo/com/sparrowwallet/drongo/protocol/ScriptType.class
+++ github-binaries/modules-extracted/com.sparrowwallet.drongo/com/sparrowwallet/drongo/protocol/ScriptType.class
├── procyon -ec {}
@@ -1064,15 +1064,15 @@
         @Override
         public TransactionSignature.Type getSignatureType() {
             return TransactionSignature.Type.SCHNORR;
         }

         @Override
         public List<PolicyType> getAllowedPolicyTypes() {
-            return ((Network.get() == Network.MAINNET && LocalDate.now().isAfter(ScriptType.TAPROOT_MAINNET_ACTIVATION_DATE)) || (System.getProperty("com.sparrowwallet.blockHeight") != null && Integer.parseInt(System.getProperty("com.sparrowwallet.blockHeight")) >= 709632) || Network.get() == Network.TESTNET || Network.get() == Network.REGTEST || Network.get() == Network.SIGNET) ? List.of(PolicyType.SINGLE) : Collections.emptyList();
+            return ((Network.get() == Network.MAINNET && LocalDate.now().isAfter(ScriptType.TAPROOT_MAINNET_ACTIVATION_DATE)) || Network.get() == Network.TESTNET || Network.get() == Network.REGTEST || Network.get() == Network.SIGNET) ? List.of(PolicyType.SINGLE) : Collections.emptyList();
         }
     };

     private static final LocalDate TAPROOT_MAINNET_ACTIVATION_DATE;
     private final String name;
     private final String description;
     private final String defaultDerivationPath;
@@ -1253,15 +1253,15 @@

     private static /* synthetic */ ScriptType[] $values() {
         return new ScriptType[] { ScriptType.P2PK, ScriptType.P2PKH, ScriptType.MULTISIG, ScriptType.P2SH, ScriptType.P2SH_P2WPKH, ScriptType.P2SH_P2WSH, ScriptType.P2WPKH, ScriptType.P2WSH, ScriptType.P2TR };
     }

     static {
         $VALUES = $values();
-        TAPROOT_MAINNET_ACTIVATION_DATE = LocalDate.of(2021, Month.NOVEMBER, 17);
+        TAPROOT_MAINNET_ACTIVATION_DATE = LocalDate.of(2021, Month.NOVEMBER, 22);
         SINGLE_KEY_TYPES = new ScriptType[] { ScriptType.P2PK, ScriptType.P2TR };
         SINGLE_HASH_TYPES = new ScriptType[] { ScriptType.P2PKH, ScriptType.P2SH, ScriptType.P2SH_P2WPKH, ScriptType.P2SH_P2WSH, ScriptType.P2WPKH, ScriptType.P2WSH };
         ADDRESSABLE_TYPES = new ScriptType[] { ScriptType.P2PKH, ScriptType.P2SH, ScriptType.P2SH_P2WPKH, ScriptType.P2SH_P2WSH, ScriptType.P2WPKH, ScriptType.P2WSH, ScriptType.P2TR };
         NON_WITNESS_TYPES = new ScriptType[] { ScriptType.P2PK, ScriptType.P2PKH, ScriptType.P2SH };
         WITNESS_TYPES = new ScriptType[] { ScriptType.P2SH_P2WPKH, ScriptType.P2SH_P2WSH, ScriptType.P2WPKH, ScriptType.P2WSH, ScriptType.P2TR };
     }
 }

nyxnor@momma-deb:~/sparrow/modules$ diffoscope build/modules-extracted/com.sparrowwallet.drongo/com/sparrowwallet/drongo/protocol/ScriptType.class github-binaries/modules-extracted/com.sparrowwallet.drongo/com/sparrowwallet/drongo/protocol/ScriptType.class
--- build/modules-extracted/com.sparrowwallet.drongo/com/sparrowwallet/drongo/protocol/ScriptType.class
+++ github-binaries/modules-extracted/com.sparrowwallet.drongo/com/sparrowwallet/drongo/protocol/ScriptType.class
├── procyon -ec {}
@@ -1064,15 +1064,15 @@
         @Override
         public TransactionSignature.Type getSignatureType() {
             return TransactionSignature.Type.SCHNORR;
         }

         @Override
         public List<PolicyType> getAllowedPolicyTypes() {
-            return ((Network.get() == Network.MAINNET && LocalDate.now().isAfter(ScriptType.TAPROOT_MAINNET_ACTIVATION_DATE)) || (System.getProperty("com.sparrowwallet.blockHeight") != null && Integer.parseInt(System.getProperty("com.sparrowwallet.blockHeight")) >= 709632) || Network.get() == Network.TESTNET || Network.get() == Network.REGTEST || Network.get() == Network.SIGNET) ? List.of(PolicyType.SINGLE) : Collections.emptyList();
+            return ((Network.get() == Network.MAINNET && LocalDate.now().isAfter(ScriptType.TAPROOT_MAINNET_ACTIVATION_DATE)) || Network.get() == Network.TESTNET || Network.get() == Network.REGTEST || Network.get() == Network.SIGNET) ? List.of(PolicyType.SINGLE) : Collections.emptyList();
         }
     };

     private static final LocalDate TAPROOT_MAINNET_ACTIVATION_DATE;
     private final String name;
     private final String description;
     private final String defaultDerivationPath;
@@ -1253,15 +1253,15 @@

     private static /* synthetic */ ScriptType[] $values() {
         return new ScriptType[] { ScriptType.P2PK, ScriptType.P2PKH, ScriptType.MULTISIG, ScriptType.P2SH, ScriptType.P2SH_P2WPKH, ScriptType.P2SH_P2WSH, ScriptType.P2WPKH, ScriptType.P2WSH, ScriptType.P2TR };
     }

     static {
         $VALUES = $values();
-        TAPROOT_MAINNET_ACTIVATION_DATE = LocalDate.of(2021, Month.NOVEMBER, 17);
+        TAPROOT_MAINNET_ACTIVATION_DATE = LocalDate.of(2021, Month.NOVEMBER, 22);
         SINGLE_KEY_TYPES = new ScriptType[] { ScriptType.P2PK, ScriptType.P2TR };
         SINGLE_HASH_TYPES = new ScriptType[] { ScriptType.P2PKH, ScriptType.P2SH, ScriptType.P2SH_P2WPKH, ScriptType.P2SH_P2WSH, ScriptType.P2WPKH, ScriptType.P2WSH };
         ADDRESSABLE_TYPES = new ScriptType[] { ScriptType.P2PKH, ScriptType.P2SH, ScriptType.P2SH_P2WPKH, ScriptType.P2SH_P2WSH, ScriptType.P2WPKH, ScriptType.P2WSH, ScriptType.P2TR };
         NON_WITNESS_TYPES = new ScriptType[] { ScriptType.P2PK, ScriptType.P2PKH, ScriptType.P2SH };
         WITNESS_TYPES = new ScriptType[] { ScriptType.P2SH_P2WPKH, ScriptType.P2SH_P2WSH, ScriptType.P2WPKH, ScriptType.P2WSH, ScriptType.P2TR };
     }
 }

nyxnor@momma-deb:~/sparrow/modules$ diffoscope build/modules-extracted/com.sparrowwallet.drongo/com/sparrowwallet/drongo/wallet/Wallet.class github-binaries/modules-extracted/com.sparrowwallet.drongo/com/sparrowwallet/drongo/wallet/Wallet.class
--- build/modules-extracted/com.sparrowwallet.drongo/com/sparrowwallet/drongo/wallet/Wallet.class
+++ github-binaries/modules-extracted/com.sparrowwallet.drongo/com/sparrowwallet/drongo/wallet/Wallet.class
├── procyon -ec {}
│ @@ -200,18 +200,14 @@
         final Iterator<Wallet> iterator = this.getChildWallets().iterator();
         while (iterator.hasNext()) {
             set.remove(((Wallet)iterator.next()).getStandardAccountType());
         }
         return set.isEmpty();
     }

-    public boolean isWhirlpoolChildWallet() {
-        return !this.isMasterWallet() && StandardAccount.WHIRLPOOL_ACCOUNTS.contains(this.getStandardAccountType());
-    }
-    
     public boolean isWhirlpoolMixWallet() {
         return !this.isMasterWallet() && StandardAccount.WHIRLPOOL_MIX_ACCOUNTS.contains(this.getStandardAccountType());
     }

     public void setName(final String name) {
         this.name = name;
     }

nyxnor@momma-deb:~/sparrow/modules$ diffoscope build/modules-extracted/java.base/jdk/internal/module/SystemModules$all.class github-binaries/modules-extracted/java.base/jdk/internal/module/SystemModules$all.class

nyxnor@momma-deb:~/sparrow/modules$ diffoscope build/modules-extracted/java.base/jdk/internal/module/SystemModules$default.class github-binaries/modules-extracted/java.base/jdk/internal/module/SystemModules$default.class
nyxnor commented 3 years ago

What is can see from the first diff, it was this new commit after the release https://github.com/sparrowwallet/drongo/commit/38783d68a49ecf5d8c8640edb299d693f455b2a9. My guess, I can checkout to any tag on sparrowwallet/sparrow, but it pulls the latest commits in sparrowwallet/drongo. Cloning recursively I see:

Submodule path 'drongo': checked out '38783d68a49ecf5d8c8640edb299d693f455b2a9'

As drongo does not tag to checkout, will need to reset --hard to a commit before the release, which is https://github.com/sparrowwallet/drongo/commit/0b40c20ab252e29ac192bca34d834b8c3eed04a0

You could do the same tag for drongo OR indicate the commit in your code to act from there, but this is not good I think OR I will need to specify the commit everytime and check drongo repo for the commit hash.


Almost there, let me see the diff again...., will run on a clean machine when this works here.

sh sparrow-build.sh 
# Installing necessary packages

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
apt-transport-https is already the newest version (2.2.4).
gnupg is already the newest version (2.2.27-2).
rpm is already the newest version (4.16.1.2+dfsg1-3).
wget is already the newest version (1.21-1+b1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

# Adding adoptopenjdk signing key

public                                                [ <=>                                                                                                        ]   3.08K  --.-KB/s    in 0.02s   
gpg: keybox './adoptopenjdk-keyring.gpg' created
gpg: key 8AC3B29174885C03: public key "AdoptOpenJDK (used for publishing RPM and DEB files) <adoptopenjdk@gmail.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1

# Installing adoptopenjdk

Hit:1 http://deb.debian.org/debian bullseye InRelease
Get:2 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB]                   
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [36.8 kB]                                                                    
Hit:4 https://deb.torproject.org/torproject.org bullseye InRelease                                                                                                       
Get:5 http://security.debian.org/debian-security bullseye-security/main Sources [19.4 kB]
Get:6 http://security.debian.org/debian-security bullseye-security/main amd64 Packages [30.4 kB]
Get:7 http://security.debian.org/debian-security bullseye-security/main Translation-en [16.3 kB]
Hit:8 https://packagecloud.io/firstlookmedia/code/debian bullseye InRelease                                  
Fetched 147 kB in 2s (85.9 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
3 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
adoptopenjdk-16-hotspot is already the newest version (16.0.1+9-3).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

# Cloning recursively sparrow git repository

Cloning into 'sparrow'...
Enter passphrase for key '/home/nyxnor/.ssh/id_ed25519': 
remote: Enumerating objects: 13322, done.
remote: Counting objects: 100% (2535/2535), done.
remote: Compressing objects: 100% (1626/1626), done.
remote: Total 13322 (delta 1172), reused 1801 (delta 494), pack-reused 10787
Receiving objects: 100% (13322/13322), 169.59 MiB | 527.00 KiB/s, done.
Resolving deltas: 100% (6894/6894), done.
Submodule 'drongo' (git@github.com:sparrowwallet/drongo.git) registered for path 'drongo'
Cloning into '/home/nyxnor/sparrow/sparrow-build/sparrow/drongo'...
Enter passphrase for key '/home/nyxnor/.ssh/id_ed25519': 
remote: Enumerating objects: 3837, done.        
remote: Counting objects: 100% (1465/1465), done.        
remote: Compressing objects: 100% (873/873), done.        
remote: Total 3837 (delta 561), reused 1137 (delta 260), pack-reused 2372        
Receiving objects: 100% (3837/3837), 1.25 MiB | 785.00 KiB/s, done.
Resolving deltas: 100% (1683/1683), done.
Submodule path 'drongo': checked out '38783d68a49ecf5d8c8640edb299d693f455b2a9'
HEAD is now at 0b40c20 support required script types on child wallets

# Building binaries from source

Starting a Gradle Daemon (subsequent builds will be faster)

> Task :createDelegatingModules
/home/nyxnor/sparrow/sparrow-build/sparrow/build/jlinkbase/tmpjars/org.jdbi.v3.sqlobject/module-info.java:2: warning: [module] module name component v3 should avoid terminal digits
open module org.jdbi.v3.sqlobject {
                    ^
1 warning
/home/nyxnor/sparrow/sparrow-build/sparrow/build/jlinkbase/tmpjars/org.apache.commons.lang3/module-info.java:2: warning: [module] module name component lang3 should avoid terminal digits
open module org.apache.commons.lang3 {
                              ^
1 warning
/home/nyxnor/sparrow/sparrow-build/sparrow/build/jlinkbase/tmpjars/org.antlr.antlr4.runtime/module-info.java:2: warning: [module] module name component antlr4 should avoid terminal digits
open module org.antlr.antlr4.runtime {
                     ^
1 warning
/home/nyxnor/sparrow/sparrow-build/sparrow/build/jlinkbase/tmpjars/org.jdbi.v3.core/module-info.java:2: warning: [module] module name component v3 should avoid terminal digits
open module org.jdbi.v3.core {
                    ^
1 warning
/home/nyxnor/sparrow/sparrow-build/sparrow/build/jlinkbase/tmpjars/io.reactivex.rxjava2/module-info.java:2: warning: [module] module name component rxjava2 should avoid terminal digits
open module io.reactivex.rxjava2 {
                        ^
1 warning
/home/nyxnor/sparrow/sparrow-build/sparrow/build/jlinkbase/tmpjars/de.mkammerer.argon2/module-info.java:2: warning: [module] module name component argon2 should avoid terminal digits
open module de.mkammerer.argon2 {
                        ^
1 warning

> Task :jlink
WARNING: signed modular JAR /home/nyxnor/sparrow/sparrow-build/sparrow/build/jlinkbase/jlinkjars/bcprov-jdk15on-1.64.jar is currently not supported

> Task :jpackage
[22:51:18.852] Creating association with null extension.
[22:51:18.852] Creating association with null extension.
[22:51:19.167] Creating association with null extension.
[22:51:19.168] Creating association with null extension.
[22:51:33.368] Creating association with null extension.
[22:51:33.369] Creating association with null extension.
[22:51:36.382] Creating association with null extension.
[22:51:36.382] Creating association with null extension.

BUILD SUCCESSFUL in 3m 23s
19 actionable tasks: 19 executed

# Downloading Craig's pgp pub key, importing it and verifying with indicated 64bit key

gpg: key E94618334C674B40: "Craig Raw <craigraw@gmail.com>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1

# Dowloading binaries provided on Github

sparrow-1.5.0-beta1-manifest.txt                  100%[===========================================================================================================>]     560  --.-KB/s    in 0s      
sparrow-1.5.0-beta1-manifest.txt.asc              100%[===========================================================================================================>]     873  --.-KB/s    in 0s      
sparrow-1.5.0-beta1.tar.gz                        100%[===========================================================================================================>]  97.89M   617KB/s    in 3m 35s  

# Verifying files

$ gpg --verify sparrow-1.5.0-beta1-manifest.txt.asc sparrow-1.5.0-beta1-manifest.txt
gpg: Signature made Mon 06 Sep 2021 12:30:20 PM CEST
gpg:                using RSA key D4D0D3202FC06849A257B38DE94618334C674B40
gpg: Good signature from "Craig Raw <craigraw@gmail.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: D4D0 D320 2FC0 6849 A257  B38D E946 1833 4C67 4B40

$ sha256sum -c --ignore-missing sparrow-1.5.0-beta1-manifest.txt 
sparrow-1.5.0-beta1.tar.gz: OK

$ sha256sum ~/sparrow/sparrow-github-binaries/Sparrow/bin/Sparrow
1e273ebc51baabed4f0383db56a28fa2825baecba7b1b79f2edb502bda81bc99  /home/nyxnor/sparrow/sparrow-github-binaries/Sparrow/bin/Sparrow

$ sha256sum ~/sparrow/sparrow-build/sparrow/build/jpackage/Sparrow/bin/Sparrow
1e273ebc51baabed4f0383db56a28fa2825baecba7b1b79f2edb502bda81bc99  /home/nyxnor/sparrow/sparrow-build/sparrow/build/jpackage/Sparrow/bin/Sparrow

$ diff -r ~/sparrow/sparrow-build/sparrow/build/jpackage/Sparrow/ ~/sparrow/sparrow-github-binaries/Sparrow/
Binary files /home/nyxnor/sparrow/sparrow-build/sparrow/build/jpackage/Sparrow/lib/runtime/lib/modules and /home/nyxnor/sparrow/sparrow-github-binaries/Sparrow/lib/runtime/lib/modules differ

# Using sparrowwallet/sparrow tag=1.5.0-beta1 and sparrowwallet/drongo commit=0b40c20ab252e29ac192bca34d834b8c3eed04a0

# WARNING: Build is NOT reproducible --> Binaries provided on Github does NOT match built binaries

AAAAAAAA, most of the difference is gonne now, check what lasts:

mkdir -p ~/sparrow/modules/build/modules-extracted ~/sparrow/modules/github-binaries/modules-extracted
sudo cp ~/sparrow/sparrow-build/sparrow/build/jpackage/Sparrow/lib/runtime/lib/modules ~/sparrow/modules/build/
sudo cp ~/sparrow/sparrow-github-binaries/Sparrow/lib/runtime/lib/modules  ~/sparrow/modules/github-binaries/
cd ~/sparrow/modules/build/modules-extracted || exit 1
jimage extract ../modules
cd ~/sparrow/modules/github-binaries/modules-extracted || exit 1
jimage extract ../modules
cd || exit 1
diff -r ~/sparrow/modules/build/modules-extracted ~/sparrow/modules/github-binaries/modules-extracted/
Binary files /home/nyxnor/sparrow/modules/build/modules-extracted/java.base/jdk/internal/module/SystemModules$all.class and /home/nyxnor/sparrow/modules/github-binaries/modules-extracted/java.base/jdk/internal/module/SystemModules$all.class differ
Binary files /home/nyxnor/sparrow/modules/build/modules-extracted/java.base/jdk/internal/module/SystemModules$default.class and /home/nyxnor/sparrow/modules/github-binaries/modules-extracted/java.base/jdk/internal/module/SystemModules$default.class differ

It appears the $ does not permit the file to be read correctly, see this:

diffoscope ~/sparrow/modules/build/modules-extracted/java.base/jdk/internal/module/SystemModules\$all.class ~/sparrow/modules/github-binaries/modules-extracted/java.base/jdk/internal/module/SystemModules\$all.class

Shows no result the above, need to transform to text \$ as below (I cut the output cause it is two big, but it is the same thing repetdly, see files at the end:

diffoscope ~/sparrow/modules/build/modules-extracted/java.base/jdk/internal/module/SystemModules\$all.class ~/sparrow/modules/github-binaries/modules-extracted/java.base/jdk/internal/module/SystemModules\$all.class
         builder87.opens(new ModuleDescriptor.Opens[0]);
         builder87.uses(of20);
         builder87.provides(new ModuleDescriptor.Provides[0]);
         builder87.packages(Set.of("com.github.arteam.simplejsonrpc.client", "com.github.arteam.simplejsonrpc.client.builder", "com.github.arteam.simplejsonrpc.client.exception", "com.github.arteam.simplejsonrpc.client.generator", "com.github.arteam.simplejsonrpc.client.metadata"));
         builder87.version("1.0");
-        array[72] = builder87.build(1494625572);
+        array[72] = builder87.build(1683523855);
         final Builder builder88 = new Builder("simple.json.rpc.server");
         builder88.open(true);
         builder88.requires(new ModuleDescriptor.Requires[] { Builder.newRequires(of12, "com.fasterxml.jackson.databind"), Builder.newRequires(of12, "com.google.common"), Builder.newRequires(of12, "java.base"), Builder.newRequires(of12, "org.slf4j"), Builder.newRequires(of12, "simple.json.rpc.core") });
         builder88.exports(new ModuleDescriptor.Exports[] { Builder.newExports(of, "com.github.arteam.simplejsonrpc.server") });
         builder88.opens(new ModuleDescriptor.Opens[0]);
         builder88.uses(of20);
         builder88.provides(new ModuleDescriptor.Provides[0]);
         builder88.packages(Set.of("com.github.arteam.simplejsonrpc.server", "com.github.arteam.simplejsonrpc.server.metadata"));
         builder88.version("1.0");
-        array[73] = builder88.build(555683016);
+        array[73] = builder88.build(744581299);
         final Builder builder89 = new Builder("tornadofx.controls");
         builder89.open(true);
         builder89.requires(new ModuleDescriptor.Requires[] { Builder.newRequires(of12, "java.base"), Builder.newRequires(of12, "javafx.controls") });
         builder89.exports(new ModuleDescriptor.Exports[] { Builder.newExports(of, "tornadofx.control") });
         builder89.opens(new ModuleDescriptor.Opens[0]);
         builder89.uses(of20);
         builder89.provides(new ModuleDescriptor.Provides[0]);
         builder89.packages(Set.of("tornadofx.control", "tornadofx.control.skin", "tornadofx.converter", "tornadofx.property", "tornadofx.table"));
         builder89.version("1.0.4");
-        array[74] = builder89.build(1570093334);
+        array[74] = builder89.build(1758991617);
         final Builder builder90 = new Builder("com.sparrowwallet.sparrow");
         builder90.open(true);
diffoscope ~/sparrow/modules/build/modules-extracted/java.base/jdk/internal/module/SystemModules\$default.class ~/sparrow/modules/github-binaries/modules-extracted/java.base/jdk/internal/module/SystemModules\$default.class
--- /home/nyxnor/sparrow/modules/build/modules-extracted/java.base/jdk/internal/module/SystemModules$default.class
+++ /home/nyxnor/sparrow/modules/github-binaries/modules-extracted/java.base/jdk/internal/module/SystemModules$default.class
├── procyon -ec {}
@@ -449,55 +449,55 @@
         builder20.requires(new ModuleDescriptor.Requires[] { Builder.newRequires(of12, "java.base"), Builder.newRequires(of12, "javafx.base"), Builder.newRequires(of12, "javafx.controls"), Builder.newRequires(of12, "javafx.graphics") });
         builder20.exports(new ModuleDescriptor.Exports[] { Builder.newExports(of, "de.codecentric.centerdevice") });
         builder20.opens(new ModuleDescriptor.Opens[0]);
         builder20.uses(of20);
         builder20.provides(new ModuleDescriptor.Provides[0]);
         builder20.packages(Set.of("de.codecentric.centerdevice", "de.codecentric.centerdevice.dialogs.about", "de.codecentric.centerdevice.glass", "de.codecentric.centerdevice.icns", "de.codecentric.centerdevice.labels", "de.codecentric.centerdevice.listener", "de.codecentric.centerdevice.util"));
         builder20.version("2.1.7");
-        array[9] = builder20.build(-218088662);
+        array[9] = builder20.build(-29190379);
         final Builder builder21 = new Builder("co.nstant.in.cbor");
         builder21.open(true);
         builder21.requires(new ModuleDescriptor.Requires[] { Builder.newRequires(of12, "java.base") });
         builder21.exports(new ModuleDescriptor.Exports[] { Builder.newExports(of, "co.nstant.in.cbor") });
         builder21.opens(new ModuleDescriptor.Opens[0]);
         builder21.uses(of20);
         builder21.provides(new ModuleDescriptor.Provides[0]);
         builder21.packages(Set.of("co.nstant.in.cbor", "co.nstant.in.cbor.builder", "co.nstant.in.cbor.decoder", "co.nstant.in.cbor.encoder", "co.nstant.in.cbor.model"));
         builder21.version("0.9");
-        array[10] = builder21.build(-1386751763);
+        array[10] = builder21.build(-1197853480);
         final Builder builder22 = new Builder("com.beust.jcommander");
         builder22.open(true);
         builder22.requires(new ModuleDescriptor.Requires[] { Builder.newRequires(of12, "java.base") });
         builder22.exports(new ModuleDescriptor.Exports[] { Builder.newExports(of, "com.beust.jcommander") });
         builder22.opens(new ModuleDescriptor.Opens[0]);
         builder22.uses(of20);
         builder22.provides(new ModuleDescriptor.Provides[0]);
         builder22.packages(Set.of("com.beust.jcommander", "com.beust.jcommander.converters", "com.beust.jcommander.defaultprovider", "com.beust.jcommander.internal", "com.beust.jcommander.validators"));
         builder22.version("1.81");
-        array[11] = builder22.build(121114450);
+        array[11] = builder22.build(310012733);
         final Builder builder23 = new Builder("com.fasterxml.jackson.core");
         builder23.open(true);
         builder23.requires(new ModuleDescriptor.Requires[] { Builder.newRequires(of12, "java.base") });

Files

diffoscope-all.class.txt diffoscope-default.class.txt

craigraw commented 3 years ago

Thanks for the detailed feedback. It looks like there is an element of Java's build process that is non-deterministic. I will need to see what kind of workarounds are possible.

Re checking out the right version of drongo, I used the following to do it in one step:

git clone --recursive --branch 1.5.0-beta1 git@github.com:sparrowwallet/sparrow.git

Will update the docs accordingly.

RequestPrivacy commented 3 years ago

Following the current build guide and using skdman.io for managing the JDK I was able to reproducibility build sparrow1.5.0-beta1.

The hashes of the /Sparrow/bin/Sparrow binary match and diff -r between the provided and build /Sparrow folder doesn't give me an output. The .deb and .rpm packages have a different sha256 hash though?

craigraw commented 3 years ago

The .deb and .rpm packages have a different sha256 hash though?

Yes, there are still some known minor issues with them (generally around file timestamps). Good that you got the build to match though!

craigraw commented 3 years ago

For clarity (this issue is getting quite long) I've added a separate issue in #197 to address the problem in https://github.com/sparrowwallet/sparrow/issues/192#issuecomment-916388002.

I've spun up another Ubuntu VM today and managed to reproduce the release. Investigation into the source has not yet turned up any interesting clues as to the cause for this particular difference.

@nyxnor one other thing that's probably worth trying is to clean the build system before building again, and checking to see if you get the same results. You can do this with:

./gradlew clean jpackage
nyxnor commented 3 years ago

@RequestPrivacy Just to be certain, the folder you compared where these: the first the one was cloned from github and built and the second the uncompressed tar.gz extracted from github release page?

diff -r ~/sparrow/build/jpackage/Sparrow/ ~/Sparrow/

Tried this: ./gradlew clean jpackage, same result, output differences in modules.

sdk will be the nest step now to manage java version inside docker so I dont mess different java packages.

RequestPrivacy commented 3 years ago

@nyxnor exactly, I downloaded the file from https://github.com/sparrowwallet/sparrow/releases/download/1.5.0-beta1/sparrow-1.5.0-beta1.tar.gz, extracted it and compared the whole Sparrow-Folder with the one of my build (in /sparrow/build/jpackage/Sparrow).

nyxnor commented 3 years ago

Tested now on a clean image on docker installing java only from sdk as instructed, did not work, modules continue to differ. I have no more ideas right now, using sdk or the adoptopenjdk debian package still results the same differences.

This is a video using the adoptopenjdk deb package, but same result using sdk

https://user-images.githubusercontent.com/69700936/133101031-1fe8a483-5ff3-4db9-b204-6e696bf0fb28.mp4

RequestPrivacy commented 3 years ago

Would really like to help here but it was my first build ever, so don't know whats different on my machine (Linux Mint). Will probably spin up a VM to test again and also record it for NVKs bitcoinbinary site.

craigraw commented 3 years ago

A solution is being sought in this thread: https://mail.openjdk.java.net/pipermail/jigsaw-dev/2021-September/014708.html

craigraw commented 3 years ago

@nyxnor could I ask you to put SystemModules$default.class and SystemModules$all.class from your build into a .zip and attach to a new comment on #197 (as I have done for the release build)? @AlanBateman has requested these files for comparison.

nyxnor commented 3 years ago

Yes. Let me build.

nyxnor commented 2 years ago

https://github.com/sparrowwallet/sparrow/issues/197#issuecomment-1228487647

nyxnor commented 2 years ago

Build doc is using the wrong temurin version, it should be the 18.

user@host:~$ sudo apt-get install temurin-17-jdk=18.0.1+10
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Version '18.0.1+10' for 'temurin-17-jdk' was not found

user@host:~$ apt-cache show temurin-18-jdk | grep Version
Version: 18.0.2+9
Version: 18.0.1+10
Version: 18+36

user@host:~$ apt-cache show temurin-17-jdk | grep Version
Version: 17.0.4.1.0+1
Version: 17.0.4.0.0+8
Version: 17.0.3.0.0+7
Version: 17.0.2.0.0+8-1
Version: 17.0.1.0.0+12-1
nyxnor commented 2 years ago
curl --tlsv1.2 --proto =https --location -o adoptium.asc https://packages.adoptium.net/artifactory/api/gpg/key/public

gpg --import --import-options show-only adoptium.asc
## should see: 3B04D753C9050D9A5D343F39843C48A565F8F04B

sudo cp adoptium.asc /usr/share/keyrings/

echo "deb [signed-by=/usr/share/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | sudo tee /etc/apt/sources.list.d/adoptium.list

sudo apt update -y

sudo apt-get install -y temurin-18-jdk=18.0.1+10

sudo update-alternatives --config java
nyxnor commented 2 years ago
git clone --recursive --branch master https://github.com/sparrowwallet/sparrow.git

cd sparrow

git checkout f1a662ba
## https://github.com/sparrowwallet/sparrow/issues/619#issuecomment-1209304845

./gradlew jpackage
nyxnor commented 2 years ago

Comparing against https://github.com/craigraw/beta/releases/tag/1.6.6-no-debug-stripping

diff -r /tmp/Sparrow/ ~/sparrow/build/jpackage/Sparrow/
Binary files /tmp/Sparrow/lib/runtime/lib/modules and /home/user/sparrow/build/jpackage/Sparrow/lib/runtime/lib/modules differ
nyxnor commented 2 years ago
$ diff -r /tmp/Sparrow/ ~/sparrow/build/jpackage/Sparrow/
Binary files /tmp/Sparrow/lib/runtime/lib/com.sparrowwallet.drongo/com/sparrowwallet/drongo/wallet/FinalizingPSBTWallet.class and /home/user/sparrow/build/jpackage/Sparrow/lib/runtime/lib/com.sparrowwallet.drongo/com/sparrowwallet/drongo/wallet/FinalizingPSBTWallet.class differ
Binary files /tmp/Sparrow/lib/runtime/lib/com.sparrowwallet.drongo/com/sparrowwallet/drongo/wallet/WalletModel.class and /home/user/sparrow/build/jpackage/Sparrow/lib/runtime/lib/com.sparrowwallet.drongo/com/sparrowwallet/drongo/wallet/WalletModel.class differ
Binary files /tmp/Sparrow/lib/runtime/lib/modules and /home/user/sparrow/build/jpackage/Sparrow/lib/runtime/lib/modules differ
nyxnor commented 2 years ago

The drongo problem is probably because I checkout out f1a662ba of sparrow, and I need to manually set the commit that was made on drongo repo before then this one on sparrow.

So I probably need to set drongo repo to checkout 8cdea77, which was the commit made to drongo before f1a662ba was made to sparrow.

But still difference in modules.

But really, when it is reproducible with correct documentation, let me know, it is simply not at this stage.

nyxnor commented 2 years ago
git clone --recursive --branch master https://github.com/sparrowwallet/sparrow.git

cd sparrow

git checkout f1a662ba
## https://github.com/sparrowwallet/sparrow/issues/619#issuecomment-1209304845

cd drongo
git checkout 8cdea77
## last commit made to drongo before f1a662ba was made to sparrow

cd ..

./gradlew jpackage
## the drongo commit will make the build fail for rpm, I just ignored it because the other files were already built

$ ./gradlew clean jpackage

> Configure project :
Project : => 'com.sparrowwallet.sparrow' Java module

> Task :createDelegatingModules
/home/user/sparrow/build/jlinkbase/tmpjars/org.antlr.antlr4.runtime/module-info.java:2: warning: [module] module name component antlr4 should avoid terminal digits
open module org.antlr.antlr4.runtime {
                     ^
1 warning
/home/user/sparrow/build/jlinkbase/tmpjars/io.reactivex.rxjava2/module-info.java:2: warning: [module] module name component rxjava2 should avoid terminal digits
open module io.reactivex.rxjava2 {
                        ^
1 warning
/home/user/sparrow/build/jlinkbase/tmpjars/de.mkammerer.argon2/module-info.java:2: warning: [module] module name component argon2 should avoid terminal digits
open module de.mkammerer.argon2 {
                        ^
1 warning
/home/user/sparrow/build/jlinkbase/tmpjars/org.jdbi.v3.sqlobject/module-info.java:2: warning: [module] module name component v3 should avoid terminal digits
open module org.jdbi.v3.sqlobject {
                    ^
1 warning
/home/user/sparrow/build/jlinkbase/tmpjars/org.jdbi.v3.core/module-info.java:2: warning: [module] module name component v3 should avoid terminal digits
open module org.jdbi.v3.core {
                    ^
1 warning
/home/user/sparrow/build/jlinkbase/tmpjars/org.apache.commons.lang3/module-info.java:2: warning: [module] module name component lang3 should avoid terminal digits
open module org.apache.commons.lang3 {
                              ^
1 warning

> Task :jlink
WARNING: signed modular JAR /home/user/sparrow/build/jlinkbase/jlinkjars/bcprov-jdk15on-1.64.jar is currently not supported

> Task :jpackage FAILED
[15:14:35.348] Creating association with null extension.
[15:14:35.348] Creating association with null extension.
[15:14:35.348] Creating association with null extension.
[15:14:35.694] Creating association with null extension.
[15:14:35.694] Creating association with null extension.
[15:14:35.695] Creating association with null extension.
java.io.IOException: Command [rpmbuild, -bb, /tmp/jdk.jpackage13588902113937676505/SPECS/sparrow.spec, --define, %_sourcedir /tmp/jdk.jpackage13588902113937676505/images, --define, %_rpmdir /home/user/sparrow/build/jpackage, --define, %_topdir /tmp/jdk.jpackage13588902113937676505, --define, %_rpmfilename sparrow-1.6.6-1.x86_64.rpm] exited with 1 code

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':jpackage'.
> Process 'command '/usr/lib/jvm/temurin-18-jdk-amd64/bin/jpackage'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 28s
21 actionable tasks: 15 executed, 6 up-to-date

And finally:

$ diff -r build/jpackage/Sparrow/ /tmp/Sparrow/; echo $?
0

So when there is a proper release that is reproducible, let me know, because for now I have to checkout certain commits on the main repo and on the submodule which is simply not clean in the documentation.

nyxnor commented 2 years ago

Here is what I suggest, make a release on https://github.com/sparrowwallet/drongo/releases when you make on https://github.com/sparrowwallet/sparrow/releases

Use the same git tag or at least mention the tags on the reproducible docs.

craigraw commented 2 years ago

Typo in the build doc fixed in 252ec580.

The file at https://github.com/craigraw/beta/releases/tag/1.6.6-no-debug-stripping is not an official release, but merely a test at the time to ensure that the binary debug stripping fix was working. From your results above I see that you have managed to reproduce as well. The next official release will include the debug stripping fix (which only manifested on recent systems), and will be tagged as per the build docs.

nyxnor commented 2 years ago

Great, please also tag drongo repo with the same tag else everytime a builder will need to set the commit manually.