-
-
Notifications
You must be signed in to change notification settings - Fork 17.8k
anki: 25.02.5 -> 25.07.5 #425219
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
anki: 25.02.5 -> 25.07.5 #425219
Conversation
|
|
Quick drive-by comment: in case you were not aware of it, 'uv export' can export to a legacy requirements.txt format that you may find easier to integrate with older tooling. |
|
The uv offline cache thing looks like something we should support in Nixpkgs if there are enough similar packages. |
Still doesn't build. |
|
Sorry for the radio silence here! It looks like At this point, I think what seems most viable is:
I've actually sorta got that working, though I did quickly find out that I'm hoping I'll have something here pretty soon though, this approach seems promising! |
|
Apologies for the delay getting back to this; I wanted to get it updated before I took some vacation, but it ended up having to wait for me to get back. Anyway! I've got the approach I was talking about in the previous comment, converting This PR builds a working anki for me, and since I don't have any FODs anymore, I don't think it should break over time like the last attempt. I've marked the PR as ready for review since I'm optimistic this one's reasonable, though it's quite plausible there's some extra unneeded steps in there now. I think the remaining unknowns for me are macOS and arm64. |
|
|
I already have a fix for
Don't know if this is still the case, but Anki is marked broken for Darwin. That could be why |
Are you on wayland on X11? |
c96c124 to
4e4245e
Compare
Wayland. Hyprland-0.50.1 from flake. |
|
eljamm
left a comment
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.
aarch64-linux❌ 1 package failed to build:
* anki-sync-server
Don't have an aarch64-linux machine, but I was able to cross compile this successfully:
$ nix-build -A pkgsCross.aarch64-multiplatform.anki-sync-server
/nix/store/8qrva8ncq7gar20aq0nw2hkrhjjnyz6y-anki-sync-server-aarch64-unknown-linux-gnu-25.07.5It still passes in nixpkgs-review-gha for me as well.
The Anki update should be good, so I suggest that we merge this PR first and address other issues separately (darwin, qt platform, ...).
|
@GaetanLepage curious if you managed to figure out what's going on there! I'm not having any issues with it on wayland. A couple things that might be worth trying are:
From my perspective, I'd also like this to be merged and to iterate on remaining issues as followups. I don't know of any blocking issues right now (unless the issue @GaetanLepage was seeing is more widespread that I'm hoping it is) |
ArchWiki and Hyprland Wiki have a suggestion: |
|
I cannot build |
|
Ah, yup, I believe that compilation error is from rebasing on a newer nixpkgs, which pulled in rust 1.89 where that fails to compile. I've got an upstream PR to fix that, and I can easily enough backport that patch as well ankitects/anki#4287 I'll backport that shortly and verify it fixes compilation. |
This includes needing to migrate to a 'uv' based packaging system, since that's what upstream did. Unfortunately, `uv sync` as a FoD doesn't work since it's not a stable output format. I handled it by writing a hacky "uv.lock to nix" converter (in the form of the 'update.sh' script), and then using fetchurl to download every file referenced in the uv.lock. Using that, combined with the "UV_FIND_LINKS" environment variable lets uv operate offline, so it seems like that's a good enough solution there, phew! The next hurdle was that anki wants us to populate 'pyenv' for an offline build, and I wasn't sure the exact right 'uv' commands for that. I ended up with a mix of 'uv export' to make requirements.txt files, and 'uv pip install' to install em. That seems to work okay for most things. The final problem was that using anki's suggested version of PyQt hits linker errors. To me, the easiest solution seemed like just using the already-packaged pyqt packages from nixpkgs, so I did that. Overall, this feels pragmatic and like it works. I think the most compelling alternative would be to generate "requirements.txt" using uv export, relax all the version requirements, and use nixpkgs-packaged dependencies only. I ended up not taking that route because not all of anki's dependencies are present in nixpkgs, and so doing it like done in this PR seemed more expedient. That's the notes I have, hopefully this approach seems overall reasonable!
|
I've updated it with the aforementioned patch, and it compiles again and works for me! |
eljamm
left a comment
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.
nixpkgs-review result
Generated using nixpkgs-review-gha
Command: nixpkgs-review pr 425219
Logs: https://github.com/eljamm/nixpkgs-review-gha/actions/runs/17245584124
x86_64-linux
✅ 8 packages built:
- anki
- anki-sync-server
- anki.doc
- anki.man
- ki
- ki.dist
- mnemosyne
- mnemosyne.dist
aarch64-linux
✅ 8 packages built:
- anki
- anki-sync-server
- anki.doc
- anki.man
- ki
- ki.dist
- mnemosyne
- mnemosyne.dist
x86_64-darwin (sandbox = true)
❌ 1 package failed to build:
- anki-sync-server
Error logs: `x86_64-darwin`
anki-sync-server
sync::collection::tests::invalid_uploads_should_be_handled
sync::collection::tests::meta
sync::collection::tests::meta_redirect_is_handled
sync::collection::tests::new_syncs_cancel_old_ones
sync::collection::tests::sanity_check_should_roll_back_and_force_full_sync
sync::collection::tests::string_grave_ids_are_handled
sync::collection::tests::sync_errors_should_prompt_db_check
sync::collection::tests::sync_roundtrip
sync::http_client::io_monitor::test::delay_before_reply_fails
sync::http_client::io_monitor::test::http_success
sync::media::tests::begin_supports_get
sync::media::tests::begin_supports_version_in_form
sync::media::tests::legacy_session_key_works
sync::media::tests::media_roundtrip
sync::media::tests::parallel_requests
sync::media::tests::sanity_check
test result: FAILED. 286 passed; 18 failed; 0 ignored; 0 measured; 1 filtered out; finished in 4.54s
error: test failed, to rerun pass -p anki --lib
aarch64-darwin (sandbox = true)
❌ 1 package failed to build:
- anki-sync-server
Error logs: `aarch64-darwin`
anki-sync-server
sync::collection::tests::invalid_uploads_should_be_handled
sync::collection::tests::meta
sync::collection::tests::meta_redirect_is_handled
sync::collection::tests::new_syncs_cancel_old_ones
sync::collection::tests::sanity_check_should_roll_back_and_force_full_sync
sync::collection::tests::string_grave_ids_are_handled
sync::collection::tests::sync_errors_should_prompt_db_check
sync::collection::tests::sync_roundtrip
sync::http_client::io_monitor::test::delay_before_reply_fails
sync::http_client::io_monitor::test::http_success
sync::media::tests::begin_supports_get
sync::media::tests::begin_supports_version_in_form
sync::media::tests::legacy_session_key_works
sync::media::tests::media_roundtrip
sync::media::tests::parallel_requests
sync::media::tests::sanity_check
test result: FAILED. 286 passed; 18 failed; 0 ignored; 0 measured; 1 filtered out; finished in 2.40s
error: test failed, to rerun pass -p anki --lib
Opened #437574 to fix the build on darwin. |
Getting this on unstable, x86_64 Linux |
|
@repparw You're building This PR should fix the error you're seeing once it gets to nixpkgs unstable. As an aside, for long blocks of text like that, you can use a And it will show up like: A lot of text |
Fixes NixOS#438598 Anki's packaging got reworked in NixOS#425219, and one of the changes was to effectively 'pip install' the anki wheel into $out directly. This resulted in an output structure of '$out/bin' and '$out/lib', with python files in 'lib'. Per NixOS#438598, this can cause conflicts. Let's split anki into `anki.out` and `anki.lib`, requiring a user to specifically include `anki.lib` in their environment in order to hit the python conflicts described there. This seems like the easiest solution, though I'm of course open to any better alternatives.
Fixes NixOS#438598 Anki's packaging got reworked in NixOS#425219, and one of the changes was to effectively 'pip install' the anki wheel into $out directly. This resulted in an output structure of '$out/bin' and '$out/lib', with python files in 'lib'. Per NixOS#438598, this can cause conflicts. Let's split anki into `anki.out` and `anki.lib`, requiring a user to specifically include `anki.lib` in their environment in order to hit the python conflicts described there. This seems like the easiest solution, though I'm of course open to any better alternatives.
This includes needing to migrate to a 'uv' based packaging system, since
that's what upstream did.
Unfortunately,
uv syncas a FoD doesn't work since it's not a stableoutput format.
I handled it by writing a hacky "uv.lock to nix" converter (in the form
of the 'update.sh' script), and then using fetchurl to download every
file referenced in the uv.lock.
Using that, combined with the "UV_FIND_LINKS" environment variable lets
uv operate offline, so it seems like that's a good enough solution
there, phew!
The next hurdle was that anki wants us to populate 'pyenv' for an
offline build, and I wasn't sure the exact right 'uv' commands for that.
I ended up with a mix of 'uv export' to make requirements.txt files, and
'uv pip install' to install em. That seems to work okay for most things.
The final problem was that using anki's suggested version of PyQt hits
linker errors. To me, the easiest solution seemed like just using the
already-packaged pyqt packages from nixpkgs, so I did that.
Overall, this feels pragmatic and like it works.
I think the most compelling alternative would be to generate
"requirements.txt" using uv export, relax all the version requirements,
and use nixpkgs-packaged dependencies only.
I ended up not taking that route because not all of anki's dependencies
are present in nixpkgs, and so doing it like done in this PR seemed more
expedient.
That's the notes I have, hopefully this approach seems overall
reasonable!
Fixes #422471
TODO:
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.