-
Notifications
You must be signed in to change notification settings - Fork 71
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
Fix building LineageOS #226
base: master
Are you sure you want to change the base?
Conversation
If it builds, it should be fine. Thanks a bunch! I do want it tested but I won't have time to do so until next week. |
I'm not entirely sure, but something about exit codes have changed with this PR (I think). When I ran this PR, and I ran out of memory, the first part of the build would fail, but it would still report it as successful. I might have to recheck it :) |
@@ -76,8 +76,8 @@ in | |||
config = mkIf cfg.enable { | |||
apps.prebuilt."F-Droid" = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like f-droid has been updated:
https://f-droid.org/repo/org.fdroid.fdroid_1019052.apk
nix-prefetch-url 'https://f-droid.org/repo/org.fdroid.fdroid_1019052.apk' --type sha256
path is '/nix/store/rvxz6jcz1cs21hs3k654nf6712ikqn7q-org.fdroid.fdroid_1019052.apk'
0gfyfdqxyc4ynl7vz1h99drvpbardaqzm6zil5ym6xw2s7a3wgyb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's important that we always bake in the latest f-droid. Any version that is capable of updating itself to the latest should work. Setting up automated dependency bumping with something like @dependabot would be nice though.
It looks like f-droid only keeps the last N versions of APKs. So, all such links are doomed to expire eventually. We need to copy them to a more stable mirror. Maybe the Nix/IPFS work will mature soon?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I think I found a more stable URL.
https://f-droid.org/archive/org.fdroid.fdroid_1017050.apk
Context: https://f-droid.org/archive/
However, it looks like F-Droid moves the APKs to the archive after some time. So, we will need to specify both a /repo/
and an /archive/
URL as mirrors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Nixpkgs, there is a mirror thingy for fetchers. Perhaps we could utilise that here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just specify an array of strings in a srcs
attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Building with this PR if I run out of memory I get the following
So it seems to think that
This doesn't happen on master. Might be because of the bump of nixpkgs. Is that required for the build to succeed on your end, or could it be a separate PR instead? |
I suspect that to be the case too. Considering that nixpkgs scripts are executed without
Yeah, we need to pull in NixOS/nixpkgs@2dcae7d specifically, in order to fix #224. Maybe we could try bumping it further and hope that the bug goes away (having been fixed further down the line), or add an explicit success check to that derivation... Edit: I think this should fix it on our side: #230 |
The old URL is now a 404.
I'm not sure what the exact conditions are for requiring these keys, but they seem to be at least required for a LineageOS instantnoodlep build with signing without MicroG.
@CyberShadow could you rebase? |
I tried but it doesn't build any more :( |
Currently stuck on this
|
You can safely ignore Chromium, nobody is maintaining it atm and it's broken at runtime anyways. Just disable webview for now. |
How does that work? Aren't webviews required for many parts of the OS? |
Also, it used to build with the older |
The OS itself not so much but other apps do require them. You have to install a webview after the fact or use a prebuilt. I had a WIP branch laying around that properly deprecates the from-source Chromiums but didn't have time to finish it at the time. It's not very high on my priority list to do so atm either though. Until someone takes a closer look at from-source Chromium and brings it up to date, it's effectively deprecated and I don't care about breaking it. |
Fixes e.g.: setting interpreter of /nix/store/0gyvs0njhf433bbi0c5wgf6627c8c3xz-aapt2/bin/aapt2 searching for dependencies of /nix/store/0gyvs0njhf433bbi0c5wgf6627c8c3xz-aapt2/bin/aapt2 libgcc_s.so.1 -> not found! Unfortunately, it is not enough to allow chromium to build, but it does fix that particular error.
Fixes e.g.: python3 ../../tools/grit/grit.py -i ../../chrome/app/generated_resources.grd build -o gen/chrome --depdir . --depfile gen/chrome/app/generated_resources_grit.d --write-only-new=1 --depend-on-stamp -E root_gen_dir=gen -E root_src_dir=../../ -D SHARED_INTERMEDIATE_DIR=gen -D DEVTOOLS_GRD_PATH=gen/third_party/devtools-frontend/src/front_end/devtools_resources -D _chromium -E CHROMIUM_BUILD=chromium -E ANDROID_JAVA_TAGGED_ONLY=true -t android -D enable_arcore=false -D enable_background_mode=false -D enable_background_contents=false -D enable_extensions=false -D enable_hangout_services_extension=false -D enable_plugins=false -D enable_print_preview=false -D enable_printing=true -D enable_service_discovery=false -D enable_side_search=false -D enable_supervised_users=true -D enable_vr=false -D enable_webui_tab_strip=false -D safe_browsing_mode=2 -D optimize_webui=true -D enable_feed_v2=true -D use_nss_certs=false -f gen/tools/gritsettings/default_resource_ids --assert-file-list obj/chrome/app/generated_resources_expected_outputs.txt --allowlist-support --js-minifier ../../tools/grit/minify_with_uglify.py --css-minifier ../../tools/grit/minimize_css.py Traceback (most recent call last): File "/build/chromium-100.0.4896.127-src/src/out/Release/../../tools/grit/grit.py", line 29, in <module> sys.exit(grit.grit_runner.Main(sys.argv[1:])) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build/chromium-100.0.4896.127-src/src/tools/grit/grit/grit_runner.py", line 314, in Main return toolobject.Run(options, args[1:]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build/chromium-100.0.4896.127-src/src/tools/grit/grit/tool/build.py", line 255, in Run self.res = grd_reader.Parse(opts.input, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build/chromium-100.0.4896.127-src/src/tools/grit/grit/grd_reader.py", line 231, in Parse handler.root.AssignFirstIds(filename_or_stream, defines) File "/build/chromium-100.0.4896.127-src/src/tools/grit/grit/node/misc.py", line 611, in AssignFirstIds src_root_dir, first_ids = _ReadFirstIdsFromFile(first_ids_filename, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build/chromium-100.0.4896.127-src/src/tools/grit/grit/node/misc.py", line 67, in _ReadFirstIdsFromFile first_ids_dict = eval(util.ReadFile(filename, 'utf-8')) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/build/chromium-100.0.4896.127-src/src/tools/grit/grit/util.py", line 214, in ReadFile with io.open(filename, mode, encoding=encoding) as f: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid mode: 'rU' Unfortunately, it is not enough to allow chromium to build, but it does fix that particular error.
33d5ef1
to
9413cf3
Compare
OK, I got it to build with: apps.chromium.enable = false;
webview.prebuilt.enable = false;
webview.chromium.availableByDefault = false;
webview.chromium.enable = false;
webview.chromium.isFallback = false; Still no idea if it actually works. |
Oops, it actually failed:
|
I'm not sure how correct these are, but they do allow building a LineageOS image with signing.
I have not tried flashing it, though. :)