Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 678370 - dev-python/cov-core-1.15.0-r1 with dev-python/pypy-7.0.0-r1 and dev-python/pypy3-7.0.0-r1 - src_install(): sandbox violation in `pypy setup.py install` at /usr/lib/pypy2.7/site-packages/init_cov_core.pth
Summary: dev-python/cov-core-1.15.0-r1 with dev-python/pypy-7.0.0-r1 and dev-python/p...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Patrick McLean
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-19 15:26 UTC by Yutao Yuan
Modified: 2021-02-04 19:57 UTC (History)
0 users

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


Attachments
build.log (cov-core-1.15.0-r1:20190219-141734.log,17.76 KB, application/octet-stream)
2019-02-19 15:26 UTC, Yutao Yuan
Details
build.log (cov-core-1.15.0-r1:20190219-141734.log,17.76 KB, text/plain)
2019-02-19 15:32 UTC, Yutao Yuan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yutao Yuan 2019-02-19 15:26:37 UTC
Created attachment 565866 [details]
build.log

sandbox log:

VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: open_wr
S: deny
P: /usr/lib/pypy2.7/site-packages/init_cov_core.pth
A: /usr/lib/pypy2.7/site-packages/init_cov_core.pth
R: /usr/lib64/pypy2.7/site-packages/init_cov_core.pth
C: pypy setup.py install --root=/tmp/portage/dev-python/cov-core-1.15.0-r1/image/_pypy 

F: open_wr
S: deny
P: /usr/lib/pypy3.5/site-packages/init_cov_core.pth
A: /usr/lib/pypy3.5/site-packages/init_cov_core.pth
R: /usr/lib64/pypy3.5/site-packages/init_cov_core.pth
C: pypy3 setup.py install --root=/tmp/portage/dev-python/cov-core-1.15.0-r1/image/_pypy3 



I see a few problems here:

1. Normally the addpredict rules in distutils-r1.eclass can prevent this kind of problems:

    # python likes to compile any module it sees, which triggers sandbox
    # failures if some packages haven't compiled their modules yet.
    addpredict "${EPREFIX}/usr/lib/${EPYTHON}"
    addpredict "${EPREFIX}/usr/$(get_libdir)/${EPYTHON}"
    addpredict /usr/lib/portage/pym
    addpredict /usr/local # bug 498232

However, pypy-7.0.0 and pypy3-7.0.0 changed the installation paths to /usr/lib/pypy2.7 and /usr/lib/pypy3.5 respectively, so /usr/lib/${EPYTHON} no longer matches the paths. Maybe it can use some special casing for pypy versions.

That said, I don't think this is the indended use of these rules, so we should probably do something to fix this package as well.

2. The init_cov_core.pth file that cov-core is trying to write seems to be important for certain features. The following message was printed after the failure to write the file:

    Failed to write pth file for subprocess measurement to <THE_PATH>

    Subprocesses WILL NOT have coverage collected.

I guess we should find a way to install the file properly. Not installing the file didn't cause any real problems before though, so maybe the file isn't really necessary.

Some other packages also install a similar file. For example, dev-python/pytest-cov installs pytest-cov.pth, but it uses the destination path properly and therefore doesn't cause problems.

#671236 is related to this bug. (BTW that bug should already be resolved by 47f35700de86b896c91a5431870dd7b798187f5f)
Comment 1 Yutao Yuan 2019-02-19 15:32:56 UTC
Created attachment 565868 [details]
build.log
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2019-02-19 16:11:31 UTC
Comment on attachment 565866 [details]
build.log

You can actually edit those attributes later.
Comment 3 Paolo Pedroni 2019-03-27 09:13:00 UTC
Same thing happens in dev-python/cov-core-1.15.0 (current stable). It needs FEATURES="-usersandbox -sandbox" to emerge correctly.