Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 691236 - dev-python/zstandard[python_targets_python3_7] doesn't create create /usr/lib/python3.7/site-packages/zstd.so
Summary: dev-python/zstandard[python_targets_python3_7] doesn't create create /usr/lib...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-01 15:44 UTC by Philipp Ammann
Modified: 2019-12-04 19:17 UTC (History)
2 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 Philipp Ammann 2019-08-01 15:44:25 UTC
When building dev-python/zstandard for Python 3.7, it doesn't create `zstd.so` in /usr/$(get_libdir)/python3.7/site-packages. Instead I get a file called `zstd.cpython-37m-x86_64-linux-gnu.so`, which certainly isn't the correct name as this is a musl based system (I get the same file name on glibc).

When building against Python 2.7 `zstd.so` is created.

This causes an issue with Mercurial. I wanted to enable Python 3 support on Mercurial 5. However, it expects zstd.so to be present. Without it, every command takes ages to start as it tries to load that file. Manually symlinking `zstd.cpython-37m-x86_64-linux-gnu.so -> zstd.so` solved this.
Comment 1 Mike Gilbert gentoo-dev 2019-08-04 15:43:26 UTC
zstd.cpython-37m-x86_64-linux-gnu.so is normal for 3.7. The behavior changed sometime after 2.7 was released.
Comment 2 Mike Gilbert gentoo-dev 2019-08-04 16:01:08 UTC
There should be a file matching this pattern on your system:

/usr/lib/python3.7/_sysconfigdata__{abi}_{platform}_{multiarch}.py

The abi, platform, and multiarch values are set when you build dev-lang/python.

If you edit this file, you should see a setting called EXT_SUFFIX that looks like this:

 'EXT_SUFFIX': '.cpython-37m-x86_64-linux-gnu.so',

What value does this have on your musl system?
Comment 3 Philipp Ammann 2019-09-22 13:37:09 UTC
(In reply to Mike Gilbert from comment #2)
> What value does this have on your musl system?

On my system it's

 'EXT_SUFFIX': '.cpython-37m-x86_64-linux-gnu.so',

Which is obviously wrong. Also the file's name is

/usr/lib/python3.7/_sysconfigdata_m_linux_x86_64-linux-gnu.py

Sorry but I don't understand whats going on here.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-10-06 09:40:28 UTC
What does the following command produce?

$ python3.7 -c 'import zstd; print(zstd.__file__)'
Comment 5 Geoff Leach 2019-12-04 04:26:45 UTC
I got same, but appears to be race condition as reported in #683818

MAKEOPTS="-j1" works in meantime
Comment 6 Mike Gilbert gentoo-dev 2019-12-04 19:17:21 UTC
(In reply to Philipp Ammann from comment #3)
> (In reply to Mike Gilbert from comment #2)
> > What value does this have on your musl system?
> 
> On my system it's
> 
>  'EXT_SUFFIX': '.cpython-37m-x86_64-linux-gnu.so',
> 
> Which is obviously wrong. Also the file's name is

That value originates from this configure check:

https://github.com/python/cpython/blob/v3.7.0/configure.ac#L747

It does not actually check libc at all: it simply checks to see if __linux__ and __x86_64__ are defined by the compiler, and outputs a value of "x86_64-linux-gnu" if those conditions are met. The "-gnu" is rather meaningless in this context.

I don't have a musl system to test on, so you'll need to provide better information about the actual behavior of python on your system for us to do anything with this bug. If you can answer Michał's question, that would be a good starting point.