Menu

#183 RuntimeError('Please define environment variable $HOME',)

I['Jan16', '']
active
None
bug
2016-01-19
2015-07-28
No

Hello here the code use to build taurus

override_dh_auto_build:
dh_auto_build -- --no-doc --with-extra-widgets
xvfb-run -a python setup.py build_doc

the xvfb-run is used to simulate a working X11 during the build.
This way the icones can be generated with the QPixmap.

I attach the .build log which shows the problem.

It seems that during the build process of the documentation taurus try to find the tangorc file.

It would be great if this could be avoid or at least taken into account during the build process.

Cheers

Frederic

1 Attachments

Discussion

  • Carlos Pascual

    Carlos Pascual - 2016-01-19
    • status: waiting --> active
    • assigned_to: Carlos Pascual
    • Milestone: unassigned --> Jan16
     
  • Carlos Pascual

    Carlos Pascual - 2016-01-19

    Hi,

    I tried to reproduce this warning by running the build_doc in a machine without $HOME and could not reproduce with the current develop branch.

    It seems that during the build process of the documentation
    taurus try to find the tangorc file.

    I cannot see any mention to the tangorc in the log you provided.

    Instead, the log seems to imply that trying to import taurus.qt.qtgui.editor fails if $HOME is not set (which may be the case in your build environment).
    but I just tried the following and it works for me:

    pascual@pc218:~$ python 
    Python 2.7.11 (default, Dec  9 2015, 00:29:25) 
    [GCC 5.3.1 20151205] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import taurus.qt.qtgui.editor
    MainThread     INFO     2016-01-19 08:28:27,007 TaurusRootLogger: Using "PyQt4" for Qt
    >>> 
    cpascual@pc218:~$ unset HOME
    cpascual@pc218:/home/cpascual$ python 
    Python 2.7.11 (default, Dec  9 2015, 00:29:25) 
    [GCC 5.3.1 20151205] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import taurus.qt.qtgui.editor
    MainThread     INFO     2016-01-19 08:28:55,862 TaurusRootLogger: Using "PyQt4" for Qt
    >>> 
    

    However, I have seen a similar issue in my Travis continuous integration builds when the USER env var is not set (it can be reproduced as follows):

    cpascual@pc218:/home/cpascual$ unset USER
    cpascual@pc218:/home/cpascual$ python 
    Python 2.7.11 (default, Dec  9 2015, 00:29:25) 
    [GCC 5.3.1 20151205] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import taurus.qt.qtgui.editor
    MainThread     INFO     2016-01-19 08:51:46,754 TaurusRootLogger: Using "PyQt4" for Qt
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/cpascual/src/taurus/lib/taurus/qt/qtgui/editor/__init__.py", line 30, in <module>
        from .tauruseditor import *
      File "/home/cpascual/src/taurus/lib/taurus/qt/qtgui/editor/tauruseditor.py", line 46, in <module>
        from spyderlib.utils.qthelpers import create_toolbutton
      File "/usr/lib/python2.7/dist-packages/spyderlib/utils/qthelpers.py", line 23, in <module>
        from spyderlib.baseconfig import get_image_path, running_in_mac_app
      File "/usr/lib/python2.7/dist-packages/spyderlib/baseconfig.py", line 188, in <module>
        from spyderlib.otherplugins import PLUGIN_PATH
      File "/usr/lib/python2.7/dist-packages/spyderlib/otherplugins.py", line 17, in <module>
        from spyderlib.utils import programs
      File "/usr/lib/python2.7/dist-packages/spyderlib/utils/programs.py", line 29, in <module>
        username = encoding.to_unicode_from_fs(os.environ.get('USER'))
      File "/usr/lib/python2.7/dist-packages/spyderlib/utils/encoding.py", line 62, in to_unicode_from_fs
        string = to_text_string(string.toUtf8(), 'utf-8')
    AttributeError: 'NoneType' object has no attribute 'toUtf8'
    >>> 
    KeyboardInterrupt
    >>> 
    

    In this last case, the problem is in the spyder module (which relies on env vars, which AFAIK is not allowed in debian). As a workaround, I just set the USER env var in my continuous integration node.

    Can you please try again and confirm if this bug is still present in develop (e.g. with commit [4044b5])

     

    Related

    Commit: [4044b5]

  • Carlos Pascual

    Carlos Pascual - 2016-01-19
    • Category: Jan16 --> Jan16,