Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 843215 - Remove block between sys-apps/file and dev-python/python-magic
Summary: Remove block between sys-apps/file and dev-python/python-magic
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on: 844154
Blocks:
  Show dependency tree
 
Reported: 2022-05-07 23:17 UTC by Joost Ruis
Modified: 2022-06-09 02:45 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joost Ruis 2022-05-07 23:17:06 UTC
Looking at this commit here: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f63a06672fc2d739428ceeb6764d4ac2aad6256

I wonder if the blocker is still needed on both sides. In my tests I did not see any collisions anymore. Would be great if my findings are true. That would it make it a lot more easy for users to install lutris.

Reproducible: Always
Comment 1 Mike Gilbert gentoo-dev 2022-05-08 00:04:46 UTC
sys-apps/file[python] installs a module called "magic.py" in site-packages.

dev-python/python-magic installs a directory called "magic" in site-packages.

Although they don't directly collide, you'll see very strange behavior if both are installed at the same time.
Comment 2 Joost Ruis 2022-05-08 00:26:22 UTC
Can you define "very strange behavior" here. Sounds arbitrary to me.
Can we investigate this further and resolve it?
Comment 3 Mike Gilbert gentoo-dev 2022-05-08 00:35:39 UTC
It can only be resolved if one of the packages renames it's python module.
Comment 4 Mike Gilbert gentoo-dev 2022-05-08 00:44:48 UTC
After a quick test, it looks like python loads packages before modules. In other words, "import magic" will load site-packages/magic/__init__.py, and ignore site-packages/magic.py.

This behavior is probably not obvious to your average python programmer.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-05-08 06:53:58 UTC
What Mike said.  Permitting both packages to be installed simultaneously would mean that one would be used and the other ignored.

Now imagine that some packages depends on sys-apps/file[magic].  If one installs dev-python/python-magic, it "magically" replaces it and the app suddenly stops working correctly.
Comment 6 Joost Ruis 2022-05-08 09:21:02 UTC
Thanks for explaining it. I now understand the QA issue here.
Shouldn't such a problem be reported upstream?
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-05-08 10:48:19 UTC
(In reply to Joost Ruis from comment #6)
> Thanks for explaining it. I now understand the QA issue here.
> Shouldn't such a problem be reported upstream?

https://github.com/ahupp/python-magic/issues/21

FWICS upstream pretty much assumes his package can replace the one from sys-apps/file, and the only revdeps of sys-apps/file[python] can use either package.

Perhaps the simplest solution would be to remove USE=python from sys-apps/file, or rename it so it is less likely to be enabled accidentally.  @base-system, WDYT?
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-09 02:45:07 UTC
(In reply to Michał Górny from comment #7)
> (In reply to Joost Ruis from comment #6)
> > Thanks for explaining it. I now understand the QA issue here.
> > Shouldn't such a problem be reported upstream?
> 
> https://github.com/ahupp/python-magic/issues/21
> 
> FWICS upstream pretty much assumes his package can replace the one from
> sys-apps/file, and the only revdeps of sys-apps/file[python] can use either
> package.
> 
> Perhaps the simplest solution would be to remove USE=python from
> sys-apps/file, or rename it so it is less likely to be enabled accidentally.
> @base-system, WDYT?

I guess I'd prefer it masked (and then, less preferably, renamed) in case we want to test it out at some point.

Keywording done.