How can I use other python package in releasing environment
I want to run a script that uses already release python package (genrb) from cmake. Though in normal catkin environment it has no problem, when releasing as debian package it fails.
I write below in CMakeLists and this works fine in normal catkin environment.(this is a part of macro)
add_custom_target(rosruby_genmsg_for_${PROJECT_NAME} ALL COMMAND ${ROSRUBY_GENMSG_DIR}/rosruby_genmsg.py ${ARGN} -d ${ROSRUBY_DEVEL_LIB_DESTINATION} )
in rosruby_genmsg.py, it imports genrb package like
from genrb.generator import msg_generator
and that line fails in relese jenkins environment. the result is here.
(also local prerelease test fails)
How can we do like this?
- use python package that is already released
- in releasing environment
- from cmake macro
- the package (genrb) is in package.xml (build_depend and run_depend)
- I'm using bloom to release
This is the code that I want to release.
https://github.com/OTL/rosruby/tree/0.5.1
EDIT1:
${CATKIN_ENV} did not solve my problem. Prerelease test failed in my local environment.
CATKIN_ENV (that means catkin_generated/env_cached.sh -> setup_cached.sh) adds PYTHONPATH like below.
export PYTHONPATH="/tmp/tmp0r5SRD/obj-x86_64-linux-gnu/devel/lib/python2.7/dist-packages:$PYTHONPATH"
but python libraries installed by binary is not there. that is place for source installed libraries. We need /opt/ros/hydro/lib/python2.7/dist-packages in order to use binary(debian) installed ros python library. Is this correct?
I used below cmake script. This fails in local prerelease test.
COMMAND ${CATKIN_ENV} ${PYTHON_EXECUTABLE} ${ROSRUBY_GENMSG_DIR}/rosruby_genmsg.py ${ARGN} -d ${ROSRUBY_DEVEL_LIB_DESTINATION}
https://github.com/OTL/rosruby/blob/master/cmake/rosruby-macro.cmake#L20
EDIT2:
This does not happened in build farm prerelease test. Is it a problem of my local test?
It seems that binary install environment does not support ROS environmental variables. So if we want to use it, we have to source /opt/ros/hydro/setup.sh in shell script, then call the python script.
Before invoking CMake you have to make sure that all system stuff you want to use is in the environment. The env script will only take care of the catkin specific environment extension.
Local pre-release test failed, but build farm test seems success! It seems better to use prerelease site. (I always used local prerelease test) http://prerelease.ros.org/create_job/hydro Anyway, thank you very much for your support.
The wiki for local pre-release has just recently been edited as to recommend the one on buildfarm http://wiki.ros.org/bloom/Tutorials/PrereleaseTest#Locally (triggered by this discussion http://lists.ros.org/pipermail/ros-release/2013-October/004282.html)