Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 685768

Summary: dev-python/lxml-4.3.3 should optionally depend on dev-python/cython
Product: Gentoo Linux Reporter: Garry Filakhtov <filakhtov>
Component: Current packagesAssignee: Python Gentoo Team <python>
Status: CONFIRMED ---    
Severity: normal CC: sam, vdupras
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---

Description Garry Filakhtov 2019-05-12 23:12:12 UTC
Hello everyone!

I have noticed that upgrading from dev-python/lxml-4.2.5 to 4.3.3 now requires cython to be installed and there is no flag to avoid it.

According to the lxml website:
The lxml.etree and lxml.objectify modules are written in Cython. Since we distribute the Cython-generated .c files with lxml releases, however, you do not need Cython to build lxml from the normal release sources. We even encourage you to not install Cython for a normal release build, as the generated C code can vary quite heavily between Cython versions, which may or may not generate correct code for lxml. The pre-generated release sources were tested and therefore are known to work.

I think there should at least be a flag to not use Cython. Or is there any good reason to ignore upstream guidance?
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2019-05-13 06:52:53 UTC
Looks like it's a build dependency. You should be able to uninstall it with --depclean.
Comment 2 Garry Filakhtov 2019-05-13 09:40:07 UTC
It is true that it is an optional build dependency (as per upstream), and primarily used for when there is a need to build from the source tree, instead of the release archive. Therefore I would be very curious to hear if there is a reason not to follow upstream recommendations and use prebuilt modules.

Also, Portage refuses to remove Cython.
Comment 3 Virgil Dupras (RETIRED) gentoo-dev 2019-05-13 11:54:05 UTC
I added this. It looked to me like a missing dependency but I didn't look well enough. I agree with you that it's better to go with upstream's recommendations in this case.

However, I'm not sure it's correct to remove the cython is the correct response. It's possible for a system to have a version of Cython installed that doesn't meet its minimum requirements and in this case it will miscompile.

--without-cython should also be added. If I do the next bump, I'll look into it.
Comment 4 Garry Filakhtov 2019-05-13 21:47:47 UTC
Oh, I see what you mean now. This makes sense. I expected automagic dependency to be a bit smarter and check for versions installed. Anyway I agree that automagic dependency is no good and that adding a `--without-cython` option sounds like a reasonable approach to me! Thank you for looking into this!