Wednesday 14 October 2020

Re: Ubuntu Focal update of broken Calibre package

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEvSewel70XCra9w4EhIGKaBmvSpsFAl+HHswACgkQhIGKaBmv
SptIdw/8DYcry4G80C8OsTxYLm4UzXZYPtplvQeZ0XVZMH0lavfJnL6qEWc1Qhet
YaQvUKlNN/Ro557OBUAEH8rfAQQU9vxyIRZtqg2pf1FFItftxbTEn9X1BL+ypgBM
J92sGaoirS+L1uBdb6L2kiobo/Q0tbS5f4PoB5o+5pYXz3BduEls1vhA7mUShj8S
iK3ZtXQruQC2tqxe/NDPjfpPooZl5ADRM27GhWG56dOZkWYyvG8gd8FhQkFksUs9
0SwuVDztv1j9bDtfnSanfyDKqfNHGcYeqb0C3zxKa9tXq3R979oWTTCkG3M6an87
CgrAYJiBxplO9bPiY1WDsa7DezLUaZFpte7SLNzkdqYa9tw6kFc3IiOwaZWXZAx1
UoXnCEVCYou6uY/foUOKh5ISUvol10I3KBC0Upf7OsKaoSL9YEsuulQpEpKhemh0
Cduq6Mi4vUBSZNkLMg1Fv1mlwKTYyBcH6zGGxgvtxhi3vfHESDU4Kp6x60Qod1d0
KENWqcXmZ1v7zPwJlmeh1uEi05nWLV8buXVxZ3M46UomD7Oa5HIIY25Mduz5pMTo
IUeVxRNTAa0uqTf+UkH7Z4luXbc9z097PsWOgRaEAD/8rAK0KNNTtpC1DolahbFr
Z4Xs6SJwlKcxgsK5WyyMaLP009B93kQ1p1h3l3z0e4wrATbMp8KJAjMEAQEKAB0W
IQRgQRMEwJ02YoNA7v/OsWfvtXIr1gUCX4cezAAKCRDOsWfvtXIr1nmdD/9emSqA
tCTB0a7b7K02nJf5b2uahpbC2D6hKtxrHZD3YSSkREPEhIt9hUHY3k/m4C9/1W58
+gsEVhmVSNdaSpt/UPoGa1sw9bKcognRqnZSb9Xw0D/tF5681eUwNKYVnyaZnLzi
PHkuzDtRMrpqdmfjBHLHiyvZiXhKcflOgFb8jDWylcH2CGp8xy9bg1TUCATA2o/e
soIqUjAKtgDnsmDDqBhV+5/Q+S5Z53pzXkvLNzWOClsK5b26uREIeJCDQM5DO5SN
sTt9bSYeLKaXU7hiZ51I+/5HflQ9SRcR9hkkdvO35K7Rbl0FDHt7XUoG6xw02Txi
JA3H4pKqp3SVErJDsUhw4pkkKe9gl3fkdAQrnlvXw2acTt3JhNNOpn0SlrnGUCmq
cvelasOIEQC9I/tEx+hbfchgbn7c5ELTu8THLU3pGQurrKtE000O3sChUHfcW1Hw
fsOOvELPfwgg/C/eLm70J46AYpxUezMYDy5ZCTyWwN3QZ5V9iDgp6U00WLtbVpRa
s0TWZtMlzY1aNRvwVGJeOGvQ8kT60bCMdetFdCn7XH5M51gVP7Vftnz8e8B/XSA4
++sf/LFsaKj32mwR+8YE3YQ9MZ91Re2UzsTit4Gi72gz/PrDbpDk135stbOJAka1
R/PAhdwph+xAOsyzxgeStir/v9HlsGBzvxAMxQ==
=Zq4B
-----END PGP SIGNATURE-----
On 10/14/20 7:29 AM, Dmitry Shachnev wrote:
> Hi Norbert, Lukasz and all!
>
> Unfortunately, Calibre 5.x requires SIP 5 and PyQt5 that is built
> against SIP 5. Moving PyQt5 to the new SIP is a major transition,
> that happened in Debian recently (two weeks ago) and did not happen
> in Ubuntu yet because of freeze.
>
> This requires changes in many packages simultaneously: at least
> pyqt5, pyqt5charts, pyqt5webengine, qscintilla2, calibre,
> python-poppler-qt5, veusz, krita and qgis.
>
> I am planning to land this change early in Groovy+1 cycle.

Just for the record, this is untrue.

Arch Linux has built python3 PyQt5 using Sip 5 via /usr/bin/sip-build,
since Dec 13 18:01:34 2019 while continuing to build python2 PyQt5 using
Sip 4 via python2 configure.py

This worked well enough that even though on Nov 24 20:33:38 2019 I began
shipping multiple repository packages for calibre -- one "calibre"
package built with python2 and one "calibre-python3" package built with
python3 -- both using Sip 4, they worked fine. The calibre-python3
package was, as expected, buggy due to being beta quality, but it never
failed due to pyqt5/sip itself.

There are still various packages in our distro archives building with
Sip 4 but successfully using the pyqt5 bindings built using Sip 5.

Old versions of some of those packages (at least krita, qgis) did need
patches to change the location of the sip dir.
qscintilla2 did need to be rebuilt with no changes, then a week later
the 2.11.4 update moved to sip-build.

It's plainly possible to mix them at least a little. From memory, we did
not even need to rebuild (most of) the packages.

YMMV, but it should definitely be feasible to update pyqt5/sip5, test
everything that build-depends on them, and leave many of them alone if
they're not ready to move.

>> Is the above (update to 5.2.0) possible in Ubuntu Focal, and if
>> yes, what kind if steps are necessary?
>
> So for Focal and Groovy we need a version of Calibre that still uses
> SIP 4. Last such version in Debian was 4.99.12+dfsg+really4.23.0-1,
> Groovy already has that. If you know some specific fixes, maybe they
> can be applied on top of what Focal or Groovy has.

Even if you could solve the immediate, critical crashes, calibre +
python3 is a combination that is only beta quality until 5.0.0, as many
issues were found during the final stages of the beta.

I strongly advise Ubuntu Focal to NOT ship beta-quality code that
upstream never released and refuses to sign off on, for the next 5 years
as an LTS. It is a recipe for heartbreak and bad relationships with
upstream.
It was never intended to be present in a stable, frozen distro release
anywhere.

In recent times, the Debian package for calibre has gained a lot of
polish, and gotten rid of legacy baggage from the "bad old days" where
upstream simply told all users that Debian was the main reason users
should never use distro packages. I'm kind of hoping that Ubuntu doesn't
become a new reason for upstream to begrudge distros.

...

Possible options going forward:

very much not ideal:

- reinstate a stable legacy python2 build for Ubuntu (needs various
python2 deps re-added)
- dropping calibre from the archives
- doing nothing: keep a broken package that crashes on startup and
drives upstream nuts
- cherry-picking some specific fix: keep a partially broken beta package
that crashes at odd, unpredictable times, and drives upstream
occasionally nuts

ideal:

- getting a Sip 5 collection in place which still supports some packages
stuck on Sip 4, and package calibre 5.2.0

not great, but workable:

- Revert code in calibre to make it build with Sip 4 again, and package
calibre 5.2.0:

https://github.com/kovidgoyal/calibre/commit/7a4b3f61ff24f8c39c8d5cf86c54da9de9267025


...

I suspect that last option would be the easiest resolution. It should work.

--
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User