Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 351210 - dev-python/sphinx-1.0.6: Sandbox access violation by sphinx-build attempting to write Grammar2.7.pickle
Summary: dev-python/sphinx-1.0.6: Sandbox access violation by sphinx-build attempting ...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard: python-overlay
Keywords: InOverlay, InVCS
Depends on:
Blocks:
 
Reported: 2011-01-09 15:20 UTC by Martin von Gagern
Modified: 2018-04-20 21:23 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 Martin von Gagern 2011-01-09 15:20:31 UTC
Up front: I solved this issue for myself, the solution is down there. This report is for others encountering the same, and for devs to avoid such issues in the future.

Several python packages fail to emerge for me with USE=doc due to a sandbox violation caused by /usr/bin/sphinx-build trying to open the file
/usr/lib64/python2.7/site-packages/sphinx/pycode/Grammar2.7.pickle
for writing.

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

=== dev-python/jinja-2.5.5 ===

F: open_wr
S: deny
P: /usr/lib64/python2.7/site-packages/sphinx/pycode/Grammar2.7.pickle
A: /usr/lib64/python2.7/site-packages/sphinx/pycode/Grammar2.7.pickle
R: /usr/lib64/python2.7/site-packages/sphinx/pycode/Grammar2.7.pickle
C: /usr/bin/python2.7 /usr/bin/sphinx-build -b html -d _build/doctrees . _build/html 

=== dev-python/mpmath-0.16 ===

F: open_wr
S: deny
P: /usr/lib64/python2.7/site-packages/sphinx/pycode/Grammar2.7.pickle
A: /usr/lib64/python2.7/site-packages/sphinx/pycode/Grammar2.7.pickle
R: /usr/lib64/python2.7/site-packages/sphinx/pycode/Grammar2.7.pickle
C: /usr/bin/python2.7 /usr/bin/sphinx-build -E source build 

=== dev-python/matplotlib-1.0.1 ===

F: open_wr
S: deny
P: /usr/lib64/python2.7/site-packages/sphinx/pycode/Grammar2.7.pickle
A: /usr/lib64/python2.7/site-packages/sphinx/pycode/Grammar2.7.pickle
R: /usr/lib64/python2.7/site-packages/sphinx/pycode/Grammar2.7.pickle
C: /usr/bin/python2.7 /usr/bin/sphinx-build -D plot_formats=[('png', 80)] -P -b html -d build/doctrees . build/html 

F: open_wr
S: deny
P: /usr/lib64/python2.7/site-packages/sphinx/pycode/Grammar2.7.pickle
A: /usr/lib64/python2.7/site-packages/sphinx/pycode/Grammar2.7.pickle
R: /usr/lib64/python2.7/site-packages/sphinx/pycode/Grammar2.7.pickle
C: /usr/bin/python2.7 /usr/bin/sphinx-build -b latex -d build/doctrees . build/latex 

It seems that sphinx/pycode/pgen2/driver.py does attempt to dump the driver opportunistically:
https://bitbucket.org/birkenfeld/sphinx/src/48688502e78b/sphinx/pycode/pgen2/driver.py#cl-114

Looking at the ebuild, it takes some care to generate the pickle in the pkg_postinst function. Apparently that generation failed for me at some point, due to bug 309969 and pythons multi-ABI hackery: I had changed USE_PYTHON to now include 2.6, and while jinja was installed all right for 2.7, it wasn't available for 2.7, thus breaking the 2.6 pickle generation. At the time, I hadn't realized that this was a merge-time problem affecting my live system, as opposed to a build-time one only affecting the portage build dir.

Therefore the simple solution for the affected individual is this:
USE=-doc emerge -1 jinja && emerge -1 sphinx
and solve any reported issues, until you achieve a clean merge.

I have several suggestions to make, in order to improve the situation:
* Improve the error message, so users know their live system is now broken.
* Move the pickle generation to src_compile or src_install if possible. As I
  believe that python makes way too much use of pkg_postinst already, I'd
  prefer this solution, but see bug #301915 about python byte code.
* Solve bug #309969 working around bug #175808 by making jinja docs a separate
  package, on which jinja[doc] can pdepend. This should give proper dependency
  ordering e.g. for python-updater, and this wouldn't have happened.
* Reflect enabled ABIs in USE flags. That way, users can decide the ABIs to
  build per package, and package deps can take this into account. The portage
  would have known that jinja[python2_6], required for sphinx[python2_6],
  wasn't available, and would have errored out before the merge. I hear that
  the multilib-portage approach will be based on USE flags as well.
Comment 1 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-06-29 22:30:48 UTC
Fixed in python overlay.
Comment 2 Dirkjan Ochtman (RETIRED) gentoo-dev 2011-06-30 07:27:35 UTC
Could you please reference the specific changeset or changesets that fixed this in the overlay? That would be very helpful.
Comment 3 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2011-06-30 15:37:16 UTC
r538
I fixed this bug using python_abi_depend() function, which currently cannot be used in gentoo-x86.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-04-20 21:23:11 UTC
Feel free to open a new issue if you can still reproduce it.