ros-infrastructure / ros_buildfarm

ROS buildfarm based on Docker
Apache License 2.0
82 stars 96 forks source link

empy not correctly installed in a python2 environment #349

Closed rhaschke closed 8 years ago

rhaschke commented 8 years ago

As reported here: https://github.com/ros-infrastructure/ros_buildfarm/issues/347#issuecomment-255145060, empy is not correctly installed with python-ros-buildfarm. Looking deeper into the issue, I think the main reason is, that I am using a python2 environment by default, but ros_buildfarm actually runs python3 scripts and thus needs a python3 version of empy. What I did is the following:

git clone https://github.com/ros-infrastructure/ros_buildfarm
cd ros_buildfarm
sudo python setup.py install

...
Installed /usr/local/lib/python2.7/dist-packages/ros_buildfarm-1.2.1_master-py2.7.egg
Processing dependencies for ros-buildfarm===1.2.1-master
Searching for rosdistro==0.4.7
Best match: rosdistro 0.4.7
rosdistro 0.4.7 is already the active version in easy-install.pth

Using /usr/lib/python2.7/dist-packages
Searching for PyYAML==3.11
Best match: PyYAML 3.11
PyYAML 3.11 is already the active version in easy-install.pth

Using /usr/lib/python2.7/dist-packages
Searching for empy==3.3.2
Best match: empy 3.3.2
empy 3.3.2 is already the active version in easy-install.pth

Using /usr/lib/python2.7/dist-packages
Searching for catkin-pkg==0.2.10
Best match: catkin-pkg 0.2.10
catkin-pkg 0.2.10 is already the active version in easy-install.pth

Using /usr/lib/python2.7/dist-packages
Searching for rospkg==1.0.41
Best match: rospkg 1.0.41
rospkg 1.0.41 is already the active version in easy-install.pth

Using /usr/lib/python2.7/dist-packages
Finished processing dependencies for ros-buildfarm===1.2.1-master

One can see that empy (python2 version) was indeed to be installed.

mkdir /tmp/prerelease
cd /tmp/prerelease
generate_prerelease_script.py https://raw.githubusercontent.com/ros-infrastructure/ros_buildfarm_config/production/index.yaml kinetic default ubuntu xenial amd64 geometric_shapes  --level 0   --output-dir ./
./prerelease.sh

...
Build step 6
+ rm -fr /tmp/prerelease/docker_generating_dockers
+ mkdir -p /tmp/prerelease/docker_generating_dockers
+ sleep 1
+ python3 -u /tmp/prerelease/ros_buildfarm/scripts/subprocess_reaper.py 7061 --cid-file /tmp/prerelease/docker_generating_dockers/docker.cidempy
+ echo # BEGIN SECTION: Generate Dockerfile - devel tasks
# BEGIN SECTION: Generate Dockerfile - devel tasks
+ export TZ=CEST-00
+ export PYTHONPATH=/tmp/prerelease/ros_buildfarm:
+ python3 -u /tmp/prerelease/ros_buildfarm/scripts/devel/run_devel_job.py --rosdistro-index-url https://raw.githubusercontent.com/ros/rosdistro/master/index.yaml kinetic default prerelease ubuntu xenial amd64 --distribution-repository-urls http://repositories.ros.org/ubuntu/testing --distribution-repository-key-files /tmp/prerelease/keys/0.key --dockerfile-dir /tmp/prerelease/docker_generating_dockers
Traceback (most recent call last):
  File "/tmp/prerelease/ros_buildfarm/scripts/devel/run_devel_job.py", line 35, in <module>
    from ros_buildfarm.templates import create_dockerfile
  File "/tmp/prerelease/ros_buildfarm/ros_buildfarm/templates/__init__.py", line 17, in <module>
    from em import Interpreter
ImportError: No module named 'em'

However, finally the script is run with python3, requiring python3 version of empy. Installing python3-empy, everything works like a charm. Looking into the dependencies of the debian package python-ros-buildfarm, we also see the wrong python2 dependency:

apt-cache depends python-ros-buildfarm 
python-ros-buildfarm
  Depends: python
  Depends: python
  Depends: python-catkin-pkg
  Depends: python-empy
  Depends: python-yaml
  Depends: python-rosdistro
  Depends: <python-argparse>
    libpython2.7-stdlib
  Conflicts: python3-ros-buildfarm
dirk-thomas commented 8 years ago

Thank you for the detailed report. I have addressed the problem in 8a94ce53dea2dffc217a8f575f26c89075cabff6.

dirk-thomas commented 8 years ago

Fix released as version 1.2.1. Debian will be available shortly.