[Buildbot-devel] Escaping the slave virtualenv

Kay Hayen kay.hayen at gmail.com
Wed Oct 29 17:51:32 UTC 2014


Hello there,

I am running Python tests which are supposed to run outside
of the slave virtualenv. But I have reasons to believe that even
if using /usr/bin/python, the PYTHONPATH is apparently still
set, is it? I am not seeing it in the build log:

/usr/bin/python tests/mercurial/run_all.py search
 in dir /opt/buildbot/slave/mercurial-Py27/build (timeout 3600 secs)
 watching logfiles {}
 argv: ['/usr/bin/python', 'tests/mercurial/run_all.py', 'search']
 environment:
  COLUMNS=240
  CONSOLE=/dev/console
  HOME=/
  INIT_VERSION=sysvinit-2.88
  LINES=67
  OLDPWD=/

PATH=/opt/buildbot/sandbox/bin:/usr/lib/ccache:/sbin:/usr/sbin:/bin:/usr/bin
  PREVLEVEL=N
  PS1=(sandbox)#
  PWD=/opt/buildbot/slave/mercurial-Py27/build
  PYTHON=/usr/bin/python2.7
  RUNLEVEL=2
  SHELL=/bin/sh
  TERM=linux
  VIRTUAL_ENV=/opt/buildbot/sandbox
  previous=N
  runlevel=2

The PYTHON variable is from my "env". The VIRTUAL_ENV is definitely the
sandbox that runs Buildbot. I am not seeing PYTHONPATH, I am not sure
if VIRTUAL_ENV has an impact on it.

As a matter of fact, the job has an issue there:

Nuitka:WARNING:/usr/bin/hg:29: Cannot find 'mercurial' as relative or
absolute import.

which means "mercurial" is not in the PYTHONPATH. It is however, in the
default
system path of /usr/bin/python, and /usr/bin/hg finds it. Check this:

Python 2.7.8 (default, Oct  7 2014, 22:02:06)
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mercurial
>>> mercurial.__path__
['/usr/lib/python2.7/dist-packages/mercurial']

Any help is welcome here. What I really want is to have shell commands run
that
escape the virtualenv, without solving that in the commands. That is
because I
also run tests (or at least intend to) inside virtualenv, to test that is
working fine
with Nuitka.

Yours,
Kay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20141029/f9831572/attachment.html>


More information about the devel mailing list