Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 763984 - dev-vcs/mercurial broken with dev-python/zstandard
Summary: dev-vcs/mercurial broken with dev-python/zstandard
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Cédric Krier
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-05 22:35 UTC by Conrad Kostecki
Modified: 2021-01-06 12:17 UTC (History)
1 user (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 Conrad Kostecki gentoo-dev 2021-01-05 22:35:21 UTC
It seems, that every version in tree is incompatible with dev-python/zstandard. If you try to clone a repo, it will fail. "https://hg.prosody.im/prosody-modules/" is an example public repo.

$ hg clone https://hg.prosody.im/prosody-modules/
Target directory: prosody-modules
abort: compression engine zstd could not be loaded

Thanks to slashbeast, the problem is 'hg' itself. If you look into 'utils/compression.py', search for line 'from .. import zstd  # pytype: disable=import-error'

This seems to be incompatible with dev-python/zstandard. If replaced with 'import zstandard as zstd', everything works normal.

BUT: This code is even present on the lastest upstream master, so it should be checked, what to do.
-> https://www.mercurial-scm.org/repo/hg/file/tip/mercurial/utils/compression.py
Comment 1 Conrad Kostecki gentoo-dev 2021-01-05 22:48:22 UTC
Upstream says:
<> https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-vcs/mercurial/mercurial-5.6.1.ebuild#n153
<> that's wrong.
<> Correct options are:
<> 1) use our bundled zstandard
<> 2) omit our bundled zstandard
<> other choices are incorrect and are likely to be broken (as you've observed)
Comment 2 Cédric Krier gentoo-dev 2021-01-05 22:57:50 UTC
Which version of dev-python/zstandard are you using? For me it works with 0.14.0-r1.
Comment 3 Cédric Krier gentoo-dev 2021-01-05 23:06:37 UTC
And also which Python implementation are you using? Is it PyPy?
Comment 4 Conrad Kostecki gentoo-dev 2021-01-05 23:48:42 UTC
(In reply to Cédric Krier from comment #2)
> Which version of dev-python/zstandard are you using? For me it works with
> 0.14.0-r1.

Newest, 0.15.1.

(In reply to Cédric Krier from comment #3)
> And also which Python implementation are you using? Is it PyPy?

[ebuild   R    ] dev-python/zstandard-0.15.1::gentoo  USE="-test" PYTHON_TARGETS="python3_8 python3_9 -pypy3 (-python3_6) -python3_7" 0 KiB

I am not using pypy, plain python3.
Comment 5 Piotr Karbowski (RETIRED) gentoo-dev 2021-01-05 23:52:55 UTC
The 0.15.1 seems to no longer providing zstd.cpython-*-linux-gnu.so as module that can be loaded. However the zstandard module have compatible interface.
Comment 6 Cédric Krier gentoo-dev 2021-01-06 09:15:06 UTC
(In reply to Piotr Karbowski from comment #5)
> The 0.15.1 seems to no longer providing zstd.cpython-*-linux-gnu.so as
> module that can be loaded. However the zstandard module have compatible
> interface.

Indeed they seem to have rename into "backend_c.cpython-*-linux-gnu.so" and move it under `zstandard` directory.
I will adapt the ebuild to import zstandard as zstd (which will permit also to support cffi only interpreter like PyPY).
Comment 7 Larry the Git Cow gentoo-dev 2021-01-06 09:24:46 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=05f063dc477fdbb858b81e1bdf754e04594b133d

commit 05f063dc477fdbb858b81e1bdf754e04594b133d
Author:     Cédric Krier <cedk@gentoo.org>
AuthorDate: 2021-01-06 09:24:15 +0000
Commit:     Cédric Krier <cedk@gentoo.org>
CommitDate: 2021-01-06 09:24:41 +0000

    dev-vcs/mercurial: import zstandard instead of zstd
    
    zstandard >=0.15 does not provide anymore zstd.
    
    Closes: https://bugs.gentoo.org/763984
    Package-Manager: Portage-3.0.12, Repoman-3.0.2
    Signed-off-by: Cédric Krier <cedk@gentoo.org>

 .../mercurial/{mercurial-5.6.1.ebuild => mercurial-5.6.1-r1.ebuild}   | 2 +-
 dev-vcs/mercurial/mercurial-9999.ebuild                               | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
Comment 8 Conrad Kostecki gentoo-dev 2021-01-06 12:17:59 UTC
Great, many thanks :-)