[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: PermissionError: [Errno 13] Permission denied: '/sbuild-nonexistent'



On Thursday, August 02 2018, PICCA Frederic-Emmanuel wrote:

> Hello,
>
> I am preparing the new silx package and I get this error message during the build
>
> WARNING: autodoc: failed to import module 'silx.opencl.codec.byte_offset'; the following exception was raised:
> Traceback (most recent call last):
>   File "/usr/lib/python3/dist-packages/sphinx/ext/autodoc/importer.py", line 152, in import_module
>     __import__(modname)
>   File "/<<BUILDDIR>>/silx-0.8.0+dfsg/.pybuild/cpython3_3.6_silx/build/silx/opencl/codec/byte_offset.py", line 58, in <module>
>     from pyopencl.algorithm import GenericScanKernel
>   File "/usr/lib/python3/dist-packages/pyopencl/algorithm.py", line 37, in <module>
>     from pyopencl.scan import ScanTemplate
>   File "/usr/lib/python3/dist-packages/pyopencl/scan.py", line 1137, in <module>
>     key_builder=_NumpyTypesKeyBuilder())
>   File "/usr/lib/python3/dist-packages/pytools/persistent_dict.py", line 566, in __init__
>     _PersistentDictBase.__init__(self, identifier, key_builder, container_dir)
>   File "/usr/lib/python3/dist-packages/pytools/persistent_dict.py", line 463, in __init__
>     self._make_container_dir()
>   File "/usr/lib/python3/dist-packages/pytools/persistent_dict.py", line 97, in wrapper
>     return f(obj, *args, **kwargs)
>   File "/usr/lib/python3/dist-packages/pytools/persistent_dict.py", line 505, in _make_container_dir
>     _make_dir_recursively(self.container_dir)
>   File "/usr/lib/python3/dist-packages/pytools/persistent_dict.py", line 72, in _make_dir_recursively
>     os.makedirs(dir)
>   File "/usr/lib/python3.6/os.py", line 210, in makedirs
>     makedirs(head, mode, exist_ok)
>   File "/usr/lib/python3.6/os.py", line 210, in makedirs
>     makedirs(head, mode, exist_ok)
>   File "/usr/lib/python3.6/os.py", line 210, in makedirs
>     makedirs(head, mode, exist_ok)
>   File "/usr/lib/python3.6/os.py", line 220, in makedirs
>     mkdir(name, mode)
> PermissionError: [Errno 13] Permission denied: '/sbuild-nonexistent'

[ Disclaimer: I haven't analyzed why the package needs access to HOME. ]

> so my question is.
>
> what is the right solutin in order to solve this ?
>
> export HOME=$CURDIR in the rules files (and voila)

Yes, explicitly setting HOME is the default solution in this case.  It
can be a directory inside $(CURDIR) as well.

> What I understant is that there is a persitent mechanism which is legitimate in nomal use.
>
> So what is the purpose of HOME pointing no-where during the build process.

HOME points to /sbuild-nonexistent because in general packages shouldn't
mess with the user's home.  But there are exceptions or special cases
(specially during the testsuite run), so sometimes you need to override
the variable by hand.

Thanks,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

Attachment: signature.asc
Description: PGP signature


Reply to: