fdroid: make reproducible#20807
Conversation
Jenkins BuildsClick to see older builds (102)
|
7ba7df5 to
2e541bd
Compare
5ba93cc to
f3f6548
Compare
| def keystore = creds.androidKeystorePrefix() | ||
| withCredentials([ | ||
| file( | ||
| credentialsId: "${keystore}-file", | ||
| variable: 'KEYSTORE_PATH' | ||
| ), | ||
| string( | ||
| credentialsId: "${keystore}-pass", | ||
| variable: 'KEYSTORE_PASSWORD' | ||
| ), | ||
| usernamePassword( | ||
| credentialsId: "${keystore}-key-pass", | ||
| usernameVariable: 'KEYSTORE_ALIAS', | ||
| passwordVariable: 'KEYSTORE_KEY_PASSWORD' | ||
| ), |
There was a problem hiding this comment.
Try not to provide credentials in Jenkinsfiles. Use our jenkins lib for that.
There was a problem hiding this comment.
Also, why not use fdroid/generate-keystore.sh as we did before?
| /* apksigner is provided by the fdroid agent image (fdroid/Dockerfile). | ||
| * The F-Droid build emits a zipaligned, unsigned APK, so signing | ||
| * in place is sufficient. Passwords are passed via env: provider | ||
| * to keep them off the process command line. */ | ||
| sh ''' | ||
| set +x |
There was a problem hiding this comment.
Or we could just wrap it into a script too. What was wrong with fdroid/sign-apk.sh?
There was a problem hiding this comment.
The problem with using a single use keystore is that Fdroid will use our signed apk as part of their releases ( if we enable reproducible builds as part of the manifest ).
If we regenerate keystore each time users won't be able to update the app since it would have been signed each time with different key.
There was a problem hiding this comment.
What? Surely that's wrong. F-Droid sign releases they build themselves with their own key. It wouldn't make sense otherwise.
There was a problem hiding this comment.
Incase you enable "reproducible builds" this is the new procedure I guess.
They just verify our signed apk with the signature we provide and use that instead of signing themseleves, and it seems like they prefer that way over signing themselves.
see comment by Lliacon : https://gitlab.com/fdroid/fdroiddata/-/merge_requests/32193#note_3351802215
| GOFLAGS="-trimpath -buildvcs=false" \ | ||
| GOMODCACHE="$(BUILD_PATH)/.gomodcache" \ | ||
| CGO_CFLAGS="-ffile-prefix-map=$(HOME)=." \ | ||
| CGO_CXXFLAGS="-ffile-prefix-map=$(HOME)=." \ |
6019401 to
3d77527
Compare
3d77527 to
da198cb
Compare
da198cb to
6f54b3a
Compare
Summary
This ensures that apk generated for each commit is exactly byte identical as the previous run.
Satisfying the reproducible builds requirement for Fdroid.
This also ensures that Fdroid will use our signed apk for publishing their releases and gives them ability to auto update without us having to open an MR to fdroid repo.
Depends on :