Hi,
this aims at generating the same output bytes during build runs. Currently, we have some extra options set by the android build environment on github CI and fdroidserver build machines to achieve this.
Summary of what we’ve already done:
- ‘EXTRA_LDFLAGS’: ‘-buildid=’
- environment “SOURCE_DATE_EPOCH”, getSourceDateEpoch()
- environment “BUILD_HOST”, “Catfriend1-syncthing-android”
- environment “BUILD_USER”, “reproducible-build”
Those together already produce a reproducible build within the F-Droid infrastructure (Syncthing-Fork Reproducibility Status).
Today, I’ve found more issues comparing my GitHub CI builds of the app to the F-Droid outputs and opened a topic on their support forum to work together with them ( Syncthing-Fork reproducible build - work in progress - Apps - F-Droid Forum ).
One remaining problem is:
Syncthing’s test data: which is not compiled in, but deleted by F-Droid’s build process as binary files are detected by their security scanner and disallowed in their build process (syncthing/lib/model/testdata at main · syncthing/syncthing · GitHub)
I’ve workaround by agreeing on “scanignore” with them, and got asked, if we could handle this more nicely within Syncthing’s own repo or build script here ( Update com.github.catfriend1.syncthingandroid.yml: testdata is not compiled in (!24168) · Merge requests · F-Droid / Data · GitLab ).
Before, we’ve just deleted the “testdata” file, resulting in the git checkout of the syncthing submodule no longer be clean. That threw differencing bytes into the built “libsyncthingnative.so” module. I’ve examined using 7zip and found “libsyncthing.native/.go.buildinfo” to contain the “dirty” flag string “vcs.modified=true”. While the github CI did not delete the “testdata” file and compiled the byte string to “vcs.modified=false”.
A quick research on Google turned out, we maybe could set “GOFLAGS=-buildvcs=false” for both F-Droid and GitHub CI builds of “Syncthing-Fork”?
===
Thinking about it, I would also welcome a central solution - if possible and sensible - in syncthing’s “build.go” script. We then could detect the Android build and act accordingly or set the above adjustments automatically if an env var like “REPRODUCIBLE_CI_BUILD=1” is present, as F-Droid’s team member Licaon_Kter suggested.
What do you think? Should we work together on this?
Kind regards, Catfriend1