Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

Python updates slowly breaking app-misc/anki

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
7 posts • Page 1 of 1
Author
Message
Birb
n00b
n00b
Posts: 3
Joined: Mon Jul 25, 2022 12:11 am

Python updates slowly breaking app-misc/anki

  • Quote

Post by Birb » Mon Jul 25, 2022 12:32 am

Its been a while since anki has gotten an update on Gentoo. We are still at 2.1.15-r1 while upstream has reached 2.1.54 already. Anki isn't necessarily missing anything that would "require" it to be updated ASAP, but python updates are slowly breaking it due to the nature of how python works I guess. Mainly the latest jump to python 3.10 as the default version broke quite a few things.

First I noticed a few addons giving up the ghost, but later on I noticed that the deck settings don't want to open anymore simply giving this error:

Code: Select all

Error 
An error occurred. Please use Tools > Check Database to see if that fixes the problem. 
If problems persist, please report the problem on our support site. Please copy and paste the information below into your report.
Anki 2.1.15 (442df9d6) Python 3.10.5 Qt 5.15.5 PyQt 5.15.6
Platform: Linux
Flags: frz=False ao=False sv=2

Caught exception:
  File "/usr/lib/python3.10/site-packages/aqt/deckconf.py", line 89, in onConfChange
    self.loadConf()
  File "/usr/lib/python3.10/site-packages/aqt/deckconf.py", line 175, in loadConf
    f.lrnFactor.setValue(c['initialFactor']/10.0)
<class 'TypeError'>: setValue(self, int): argument 1 has unexpected type 'float'
Caught exception:
  File "/usr/lib/python3.10/site-packages/aqt/deckbrowser.py", line 213, in <lambda>
    a.triggered.connect(lambda b, did=did: self._options(did))
  File "/usr/lib/python3.10/site-packages/aqt/deckbrowser.py", line 242, in _options
    self.mw.onDeckConf()
  File "/usr/lib/python3.10/site-packages/aqt/main.py", line 868, in onDeckConf
    aqt.deckconf.DeckConf(self, deck)
  File "/usr/lib/python3.10/site-packages/aqt/deckconf.py", line 25, in __init__
    self.setupConfs()
  File "/usr/lib/python3.10/site-packages/aqt/deckconf.py", line 49, in setupConfs
    self.loadConfs()
  File "/usr/lib/python3.10/site-packages/aqt/deckconf.py", line 66, in loadConfs
    self.onConfChange(startOn)
  File "/usr/lib/python3.10/site-packages/aqt/deckconf.py", line 89, in onConfChange
    self.loadConf()
  File "/usr/lib/python3.10/site-packages/aqt/deckconf.py", line 175, in loadConf
    f.lrnFactor.setValue(c['initialFactor']/10.0)
<class 'TypeError'>: setValue(self, int): argument 1 has unexpected type 'float'
The addons aren't really a big deal to me, but menus breaking like this is a bit worrying. The message says to report the bug to their support site, but I doubt they are willing to backport some python fixes to such old version.

One way to "fix" this that I came up with was to use the python_single_target_python3_9 useflag for Anki, but then found out that that flag would apply to way more applications than just Anki.

I'm aware that the direction of the build system of Anki is a bit questionable and complicated, but what would it require for Gentoo to bump up the Anki version?

I'm also open for any suggestions on how to get Anki running without upgrading it at all with minimal changes to the rest of the system.

Edit: Looks like the settings menu is also broken and inaccessible
Top
eccerr0r
Watchman
Watchman
Posts: 10239
Joined: Thu Jul 01, 2004 6:51 pm
Location: almost Mile High in the USA
Contact:
Contact eccerr0r
Website

  • Quote

Post by eccerr0r » Mon Jul 25, 2022 1:32 am

Might be a good time to submit a bug to bugs.gentoo.org for a version bump, or at least indicate that some of the deps versions have gone past the versions intended (do you know what versions of the deps were working?) -- but theoretically if the versions of the deps were built with python3_9 along with anki, there's no reason why it shouldn't still work, as if anki was built with 3_9, its deps should also be 3_9 and nothing would have changed...

... except if the underlying deps changed their api and still maintain older python compatibility...

Note: I do not use anki. Just general python notes as far as I understand it.
Intel Core i7 2700K/Radeon Firepro W2100/24GB DDR3/800GB SSD
What am I supposed watching?
Top
sam_
Developer
Developer
User avatar
Posts: 2814
Joined: Fri Aug 14, 2020 12:33 am

  • Quote

Post by sam_ » Mon Jul 25, 2022 3:16 am

Unfortunately, Anki upstream have changed their packaging (and codebase) substantially and it's not very easy to distribute now. Last time I checked on repology, no distribution was able to ship an up to date version of Anki.

It might be possible to ship a binary instead.
Top
Birb
n00b
n00b
Posts: 3
Joined: Mon Jul 25, 2022 12:11 am

  • Quote

Post by Birb » Mon Jul 25, 2022 10:51 am

Yea I think even a binary could work. I had even some database corruption happen, so the current version isn't really safe to use. I'm not familiar with bazel at all. I remember reading some really long thread about it Anki's github issues. The main developer was quite adamant about defending it.

Seems like Gentoo isn't alone with packaging issues either. Quite a few distros are still stuck with anki-2.1.15, even the latest version of Ubuntu.
Top
asturm
Developer
Developer
Posts: 9496
Joined: Thu Apr 05, 2007 4:07 pm

  • Quote

Post by asturm » Mon Jul 25, 2022 11:06 am

Package from hell.
Top
eccerr0r
Watchman
Watchman
Posts: 10239
Joined: Thu Jul 01, 2004 6:51 pm
Location: almost Mile High in the USA
Contact:
Contact eccerr0r
Website

  • Quote

Post by eccerr0r » Mon Jul 25, 2022 1:03 pm

how did they expect it to be distributed with distributions, are the expecting people to flatpak it now?
Intel Core i7 2700K/Radeon Firepro W2100/24GB DDR3/800GB SSD
What am I supposed watching?
Top
Birb
n00b
n00b
Posts: 3
Joined: Mon Jul 25, 2022 12:11 am

  • Quote

Post by Birb » Mon Jul 25, 2022 2:48 pm

From my understanding the current system is most convinient for the developers (or at least the main dev). As for Linux, it is so small minority in the userbase that windows takes the priority in this case

The main dev said this in the long github discussion about this problem. I have omitted some parts
Bazel is not without its faults, but in terms of making Anki easier for users to build, I think it does its job pretty well. Something like 80% of Anki users are on Windows, and Bazel has made building Anki on Windows much easier than it used to be. Even on Linux, building is simpler. Yes, it downloads a bunch of stuff that you may or may not have system versions of already, but it means you don't have to go through the trouble of installing all the correct dependencies yourself, and it will build on many distros that do not have the correct dependencies available in their repos. And for people who just want to run Anki and have no interest in building it from source, there are packaged binaries and Python wheels available, that are far smaller to download and run.

Earlier in the thread, I pointed out that less than 3% of Anki users are on Linux (taken from the number of syncers, not number of downloads). While I'm sure most Linux users would prefer the convenience of a distro package if one were available, the majority of them seem to be able to make do with the packaged version that is provided, and I would hope that a reasonable person could see how suggestions like switching back to a "pure" Python codebase, undoing the last two years of hard work, is not really a reasonable proposition.

...

Ultimately, I still think that this is a problem distros need to solve, either by adjusting their policies and/or improving their tooling. In the mean time, while I don't think suggestions like rewriting the build process or app are really practical, if there are specific parts of the build process where a flag such as the existing PYTHON_SITE_PACKAGES would make switching out dependencies easier, odds are a clean PR that implemented it would be accepted.
Its been over half a year already and I don't think the ship is going to turn anymore. I have quite hard sunk cost fallacy with Anki and creating my own solution to replace it isn't really feasable. The Qt6 release on the Anki website seems to work out of the box on my system, so I might move to that if upgrading the Anki ebuild isn't doable
Top
Post Reply

7 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic