Your message dated Fri, 30 Sep 2022 10:25:27 -0600 (MDT)
with message-id <20220930162527.189db24e0...@rover.gag.com>
and subject line fixed in latest upload
has caused the Debian Bug report #1020282,
regarding openmotor: git build fail when $HOME is not writable
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
1020282: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1020282
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: openmotor
Version: 0.5.0-1
Severity: wishlist

The current git repository of openmotor fail to build when HOME points
to a nonexisting directory, like it do with pbuilder.  To reproduce it,
for example build using 'HOME=/nonexisting debuild'.  The build failure
look like this:

  [...]
  make[1]: Entering directory '/home/pere/src/debian/openmotor'
  python3 setup.py build_ui
  Matplotlib created a temporary config/cache directory at
    /tmp/matplotlib-adek6nzq because the default path
    (/nonexisting/.config/matplotlib) is not a writable directory; it is
    highly recommended to set the MPLCONFIGDIR environment variable to a
    writable directory, in particular to speed up the import of Matplotlib
    and to better support multiprocessing.
  Traceback (most recent call last):
    File "/home/pere/src/debian/openmotor/setup.py", line 2, in <module>
      from uilib.fileIO import appVersionStr
    File "/home/pere/src/debian/openmotor/uilib/fileIO.py", line 10, in <module>
      from .logger import logger
    File "/home/pere/src/debian/openmotor/uilib/logger.py", line 40, in <module>
      logger = Logger()
    File "/home/pere/src/debian/openmotor/uilib/logger.py", line 13, in __init__
      self._openLogFile()
    File "/home/pere/src/debian/openmotor/uilib/logger.py", line 21, in 
_openLogFile
      os.makedirs(path)
    File "/usr/lib/python3.10/os.py", line 215, in makedirs
      makedirs(head, exist_ok=exist_ok)
    File "/usr/lib/python3.10/os.py", line 215, in makedirs
      makedirs(head, exist_ok=exist_ok)
    File "/usr/lib/python3.10/os.py", line 215, in makedirs
      makedirs(head, exist_ok=exist_ok)
    File "/usr/lib/python3.10/os.py", line 225, in makedirs
      mkdir(name, mode)
  PermissionError: [Errno 13] Permission denied: '/nonexisting'
  [...]

The code in question try to create the directories leading up to
/nonexisting/.cache/openMotor/log to be able to log to file.  A
workaround is to make sure HOME point to a writable location during
build, for example like this:

diff --git a/debian/rules b/debian/rules
index 43f3bc2..5a151ef 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,7 +9,7 @@ export PYBUILD_DISABLE=test
        dh $@ --with python3 --buildsystem=pybuild
 
 override_dh_auto_build:
-       python3 setup.py build_ui
+       export TMPHOME="$(tempfile -d)"; HOME="$TMPHOME" python3 setup.py 
build_ui; rm -rf $TMPHOME
        touch uilib/views/__init__.py
        dh_auto_build
 
A better approach might be to convince openmotor/uilib/logger.py to not
create anything in $HOME during build.

-- 
Happy hacking
Petter Reinholdtsen

--- End Message ---
--- Begin Message ---
I neglected to mark this bug closed in the latest upload, which fixed the issue.

Bdale

--- End Message ---

Reply via email to