-
Notifications
You must be signed in to change notification settings - Fork 990
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
Research process of publishing to F-Droid #8512
Comments
There's already a Nix package for
|
Looks like the basic step is just running this in
Which in turn generates a License: Unknown
SourceCode: https://github.com/status-im/status-react
IssueTracker: https://github.com/status-im/status-react/issues
RepoType: git
Repo: https://github.com/status-im/status-react
Builds:
- versionName: Unknown
versionCode: 0
disable: Generated by import.py - check/set version fields and commit id
commit: '?'
subdir: android/app
gradle:
- yes
buildjni:
- yes
AutoUpdateMode: None
UpdateCheckMode: Tags Which doesn't look very impressive. But it's a start. |
We can see an example of this file for an existing similar project here: |
Christ, since the usually used repo for Java 8 has been discontinued:
Seems to be working fine with |
There is a command to attempt to build you app through
|
The
Trace:
|
Looks like I got that wrong. You are supposed to run this in the clone of ~/soft/fdroidclient master ⇣
lilim > fdroid import --url=https://github.com/status-im/status-react --subdir=android/app --categories=Money --license=MPL-2.0 --verbose
WARNING: No 'config.py' found, using defaults.
INFO: Getting source from git repo at https://github.com/status-im/status-react
DEBUG: > git -c core.askpass=/bin/true -c core.sshCommand=/bin/false -c url.https://.insteadOf=ssh:// -c url.https://u:[email protected]/[email protected]: -c url.https://u:[email protected]=git://bitbucket.org -c url.https://u:[email protected]=https://bitbucket.org -c url.https://u:[email protected]/[email protected]: -c url.https://u:[email protected]=git://github.com -c url.https://u:[email protected]=https://github.com -c url.https://u:[email protected]/[email protected]: -c url.https://u:[email protected]=git://gitlab.com -c url.https://u:[email protected]=https://gitlab.com clone -- https://github.com/status-im/status-react tmp/importer
Cloning into 'tmp/importer'...
DEBUG: Directory: tmp/importer
DEBUG: > git rev-parse --show-toplevel
DEBUG: Directory: tmp/importer
DEBUG: > git checkout -f origin/HEAD
DEBUG: Directory: tmp/importer
DEBUG: > git clean -dffx
DEBUG: Parsing manifest at 'tmp/importer/android/app/src/main/AndroidManifest.xml'
DEBUG: ..got package=im.status.ethereum, version=None, vercode=None
DEBUG: Parsing manifest at 'tmp/importer/android/app/build.gradle'
DEBUG: ..got package=im.status.ethereum, version=None, vercode=None
WARNING: Couldn't find latest version code
INFO: Wrote metadata/im.status.ethereum.yml |
The next step is to define the build steps necessary to build our App on the F-Droid build farms: |
So the build steps are defined in the YAML meta file that is initially generated by There's something called
And for
This seems to indicate that you can only build using Ant, Maven, or Gradle. |
There is
Which seems to indicate not Gradle There is also:
|
Not sure what this one affects in Gradle but it might be build type:
EDIT: Correction, it looks like |
I'm trying to build it, but I'm getting python errors now:
|
It doesn't matter if I install According to the instructions the APT way is the way to go: |
I tried running the build with: prebuild: 'curl https://nixos.org/nix/install | sh' And it did run, but then fails with:
Which makes no fucking sense, because the nix installation succeeded just fine. But when I re-run it it works fine... |
Looks like something like this works: Builds:
- versionName: '0.13'
versionCode: 2019070916
commit: '0.13.0-mobile'
#subdir: android/app
gradle:
- yes
buildjni: no
init: |
curl https://nixos.org/nix/install | sh
prebuild: |
. ~/.nix-profile/etc/profile.d/nix.sh && \
nix-build --no-out-link '<nixpkgs>' -A glibcLocales && \
nix-shell --run 'bundle install --gemfile=fastlane/Gemfile --quiet' But it fails with the python errors when it gets to the build step. |
For readability...
|
Oh nice, I didn't know this was also a valid format, the manual stated that:
Thanks @licaon-kter! |
So the list syntax does work, but I'm getting some Nix target errors which makes no sense to me: Builds:
- versionName: 'develop'
versionCode: 9999
commit: 'develop'
#subdir: android/app
buildjni: no
gradle:
- yes
init:
# Install Nix
- curl https://nixos.org/nix/install | sh
# Source Nix environment
- . ~/.nix-profile/etc/profile.d/nix.sh
prebuild:
# Install required Gems
- nix-shell -A targets.mobile.fastlane.shell --run 'bundle install --gemfile=fastlane/Gemfile --quiet' ./default.nix And I'm running: fdroid build im.status.ethereum:9999 -v -l But I'm getting something weird:
Which appears to be this: # From a minimum of `system` or `config` (actually a target triple, *not*
# nixpkgs configuration), infer the other one and platform as needed.
localSystem = lib.systems.elaborate (
# Allow setting the platform in the config file. This take precedence over
# the inferred platform, but not over an explicitly passed-in one.
builtins.intersectAttrs { platform = null; } config
// args.localSystem); Not sure what to make of this yet. |
This seems to be related: NixOS/nixpkgs#51858 Full trace:
It's almost as if |
The apparent fix is to default config ? {} But we already set it to a map by default if not set in all Nix files. |
Yeah, that was the reason I started using a default value for config recently. |
This part of the instructions terrifies me:
https://f-droid.org/en/docs/Submitting_to_F-Droid_Quick_Start_Guide/
|
I might have to setup a dedicated server for building with |
before setting up a whole server, maybe something like this can help? https://gitlab.com/fdroid/docker-executable-fdroidserver (though I am not up to date whether this is compatible with reproducible builds and similar stuff) |
Eh, a Docker container? That does sound nice, but I thought that wouldn't work since it wants to use Vagrant. How does it use Vagrant within the container? But yeah, I do like how isolated a Docker env would be, thanks for the suggestion @step21. |
Btw, that error about |
I'm still not entirely sure on how the server part ties into F-Droid. My current understanding is that I don't need the server to submit the app, the server is for F-Droid organization to build apps others submit. But I might be wrong. Also, I'm still not entirely sure what |
I just briefly checked the makebuildserver stuff and the docker link. I think you are right, you do not need the buildserver, and anyway it just sets up everything up in vagrant, so it is not necessarily better than a docker image. (though I did not verify if they are roughly the same, as I do not want to install vagrant again...) And the docker link I posted does not run makebuildserver and all that vagrant stuff but just installs froidserver afaict |
I've thought of a way to make the build definition less verbose - which I should have done earlier - in #11791. This would make the definition for next version much slimmer: Builds:
- versionName: 1.12.0
versionCode: 2021022512
commit: 123qwe123qwe123qwe123qwe123qwe123qwe
sudo: make fdroid-nix-dir
init: nix/scripts/setup.sh
output: result/app-release-unsigned.apk
scanignore:
- android/build.gradle
scandelete:
- ios
build: make release-fdroid BUILD_NUMBER=$$VERCODE$$ I'm wondering if F-Droid has a policy of not changing previously released versions. If not I guess it's fine as it is. |
We have, we don't modify already built :) |
Okay, I can see a deploy has taken place: And the app page is now available: But I don't see it anywhere in search results when searching for I search indexing done separately? Or is it perhaps clashing with the other app named "Status"? |
Yeah, search is work in progress both website and in client, things are moving for the better "status" works but not "Status" :) |
BTW, when will the website be updated with the F-Droid badge too? |
That's already being done as part of #11791. |
I meant on https://status.im :D |
That requires CSS magic, and I don't touch that. |
@jinhojang6 could you take a look at adding an F-Droid download option to our website? This might be a good opportunity to also refactor out the download badges as a separate partial/template: |
The new I've built the new release locally and it looks correct:
So I've created a PR for It's marked as Once this second release goes out successfully we can close this issue. |
This is interesting. When I run
But the PR build job is complaining about my formatting: |
My guess would be that the |
Try Anyway, run |
I tried both and got thing. |
Oh, it looks like the
Because it can't find our |
I guess I could just: sudo:
- cd build/im.status.ethereum
- make fdroid-nix-dir But that's not that much less verbose than: sudo:
- mkdir -m 0755 /nix
- chown vagrant /nix |
Looke like this is still necessary because of sudo:
- sysctl fs.inotify.max_user_watches=524288 |
Yeah, a simple search for "node.js ENOSPC" popups a lot of results 🤷 |
I think it might make sense to do: sudo:
- cd build/im.status.ethereum
- make fdroid-build-env With targets I've added in #11845. Unless you have some reservations @licaon-kter. |
The And I've merged the last update to F-Droid docs in #11845 and I consider this done. I have opened a separate issue for possible F-Droid auto-updates: #11896 |
Hope I didn't merge too early :) |
It's fine. We're coming out with |
|
@QGB what is this about? |
Due to amazing work by @pombeirp on the
feature/nix-gradle-and-mobile-node2nix
branch we now have a working deterministic build of the Android app.In order to finally close #1125 I will need to research the exact process of submitting the app.
The text was updated successfully, but these errors were encountered: