-
Notifications
You must be signed in to change notification settings - Fork 72
-
Notifications
You must be signed in to change notification settings - Fork 72
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
Keeping F-Droid builds up-to-date #640
Comments
Thanks, I'm following the thread you mention. |
I updated the Fdroid After investigating the cause, I realized that fdroidserver is expecting the versionCode and versionName in a certain format: it uses regex to parse the lines literally. Unfortunately, the Metrodroid build.gradle lines are dynamically formed: Lines 529 to 530 in 7a6b5de
Since, the fdroidserver code is parsing them literally, it doesn't execute the git commands -- instead the entire line is evaluated as-is and thus rejected as improperly formed. |
Since versionCode is just a git rev-list count from HEAD, it can be reimplemented as a pre-commit git hook. Just put the following bash script in #!/bin/sh
versionCode=$(($(git rev-list --count HEAD) + 1))
sed -i 's/\(\s*\)versionCode.*/\1versionCode = '$versionCode'/' build.gradle
exit 0 This will use the local system's I'm not sure yet the best way to address the versionName line; a pre-commit hook wouldn't work since it occurs before a |
After giving it some more thought, I think the best setup is to hardcode both the versionCode and versionName lines, updating with each tagged release. My rationale is that the current approach is susceptible to collisions and errors. For example, the current source code release on Github fails to produce a sensible versionCode and versionName since the tarball is not a git repository -- the git commands simply return an error when executed in the project directory. However, even if someone clones the Metrodroid git repository, the git commands to determine versionCode and versionName are not particularly robust. For example, a shallow clone ( Similar issues arise if executed from a branch, where versionCode can collide with a versionCode in the master branch. The pre-commit git hook wouldn't help in the case of pull requests either since multiple pull requests may share the same versionCode update. |
Metrodroid references a Maven repo that is untrusted by Fdroid: Line 7 in 3868662
metrodroid/jvmcli/build.gradle Line 7 in 3868662
Line 5 in 3868662
Is it possible to change the Maven repo to one of the ones allowed by Fdroid? |
Thanks for following up on this. Let me address each of the issues here:
I disagree with this -- the reason that I've got this automation in place is to make it so that I only need to update one thing; the git tag info. :) This feels entirely like an F-Droid build system issue -- Gradle is a DSL and effectively you can put in arbitrary anything (so parsing with The way to solve this properly is a Gradle plugin that can export metadata from the
These are more error-prone, and you have the trouble of needing to tag a version and capture the version "atomically". This way I can make several "tagged releases" and easily change that tag before I push it out publicly in case there is some major problem with it.
This is not the only problem with GitHub's tarballs, they also fail to enumerate submodules correctly (see #32). So hard coding to "also" fix that doesn't solve all of the problems with those tarballs. Ultimately, I consider them totally broken and explicitly advise against using them.
I think we may be blocked on some iOS specific issues that are keeping us from using a newer version of kotlinx.serialization (that is available on jcenter and/or Maven Central) -- @phcoder would have more context on this. This also impacts kotlinio -- the release we're using is missing in Maven Central |
That's a fair point. I think you're right, this should probably be something fixed upstream on the fdroidserver side. Luckily this isn't much of a show-stopper since we can manually bump versions easily until they add support.
Is this kotlinx git repo on Github the same one you need: https://github.com/Kotlin/kotlinx-io I don't know much about maven repos, but if so it may be possible to use JitPack to build and host the release you need. Finally, the |
That looks neat – that may be able to help us remove other submodule requirements too. :) Do you happen to know how this interacts with F-Droid's checks?
Unfortunately, we need to a copy of the Objective-C sources for Protobuf library for the Protobuf runtime. For Android and JRE builds we already depend on the |
JitPack is one of the whitelisted repos for FDroid, so if the libraries you need are available on Github (and JitPack builds them successfully), you can use the JitPack maven repo in your build.gradle to pull in those libraries:
No need to change anything for FDroid in that case, so it should be an easy switch to make.
So for FDroid the That's good, that means the only thing we need to get the FDroid build working is to find an alternative for that kotlinx maven repo -- possibly via JitPack, or something else. |
This post is an effort to facilitate the process of keeping F-Droid builds up-to-date as described.
Refer to https://gitlab.com/fdroid/fdroiddata/issues/1248#note_223417909 to make a cooperation possible.
The text was updated successfully, but these errors were encountered: