Bug#915078: scikit-learn: build must not try to write outside build directory

Stuart Prescott stuart at debian.org
Fri Nov 30 06:37:55 GMT 2018


Source: scikit-learn
Version: 0.20.1+dfsg-1
Severity: important

Dear Maintainer,

Debian Policy (states|will state) that the build must not attempt to write
outside the build directory and that, in particular, the build should not
attempt to write into HOME. See #845715 for more details and the exact
wording that will appear in the next upload of Policy.

The build for scikit-learn attempts to write to HOME on numerous occasions.
If it can't do so, it is non-fatal; hence, fixing this bug is as simple as
ensuring within debian/rules that HOME is set to something that does not
exist. The Debian buildds already exports HOME in this way; the package
should also ensure that it doesn't scribble in HOME when being locally
compiled.

Example:

WARNING: /build/scikit-learn-S9l0Nb/scikit-learn-0.20.1+dfsg/examples/preprocessing/plot_all_scaling.py failed to execute correctly: Traceback (most recent call last):
  File "/build/scikit-learn-S9l0Nb/scikit-learn-0.20.1+dfsg/examples/preprocessing/plot_all_scaling.py", line 71, in <module>
    dataset = fetch_california_housing()
  File "/build/scikit-learn-S9l0Nb/scikit-learn-0.20.1+dfsg/.pybuild/cpython3_3.7/build/sklearn/datasets/california_housing.py", line 104, in fetch_california_housing
    data_home = get_data_home(data_home=data_home)
  File "/build/scikit-learn-S9l0Nb/scikit-learn-0.20.1+dfsg/.pybuild/cpython3_3.7/build/sklearn/datasets/base.py", line 56, in get_data_home
    makedirs(data_home)
  File "/usr/lib/python3.7/os.py", line 211, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/usr/lib/python3.7/os.py", line 221, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/home/stuart'

(The HOME environment setting has leaked into this chroot while I was
debugging the build but /home/stuart doesn't actually exist inside the
chroot, hence the very visible error; however, it should not even be trying
to write to HOME.)

regards
Stuart



More information about the debian-science-maintainers mailing list