-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make installed code relocatable #490
Comments
…), update env hooks to use runtime context (ros/catkin#490)
@dirk-thomas Please correct the |
@dirk-thomas I have test the patches and they work. Nevertheless I would proposed to replace |
I am glad to hear that it works for your use case. Regarding the variable: this variable should not be overwritten - not even for cross compilation. If a package requires compiled binaries to build itself / downstream stuff it needs to reference that using a separate variable pointing to a different directory. E.g. in the case where a package uses both (a Python script as well as a compiled binary) to build downstream stuff it will not have both of the executables in the same directory anyway. Each package should consciously deal with this in its CMake extra file. catkin should not try to populate any package-specific variables. For the source/devel space catkin would not even be able to set a reasonable directory since it just does not know where the binaries in the package are. |
In that case the binaries need to use the find_binary function to get the real path of the binary. As the long time goal it would be nice if catkin and the CMake extra files always use the find_binary function to get the real path of all executed scripts and binaries. This enables the cross build environment to use all binaries and as well scripts from the native system root if it doesn't install any binaries and scripts into the cross system root. |
For packages which do not generate compiled binaries it can stay the way as it is with these patches. I don't see a reason to change that even in the long term. For compiled binaries we should indeed use the find_* CMake functions. But that should handled by the first package which actually requires that. Currently no (wet) package requires compiled binaries during the build (as far as I know) and that was an important goal of the new buildsystem. I will go ahead and merge all above mentioned patches. Releases for the separate packages will follow when ever each package has "enough" changes accumulated. |
…), update env hooks to use runtime context (ros/catkin#490)
As long as the build machine (native system root) and cross compiled machine (cross system root) use the same python version it doesn't matter which python script is used and its a design decision. @dirk-thomas thanks for your work. We will update our recipes in meta-ros after you have apply the different patches. |
make catkin packages relocatable (#490)
resolve path of message file and include dirs in installspace at runtime (ros/catkin#490)
resolve gencpp path in installspace at runtime (ros/catkin#490)
resolve genlisp path in installspace at runtime (ros/catkin#490)
resolve genpy path in installspace at runtime (ros/catkin#490)
resolve rosunit path in installspace at runtime without find_program(), update env hooks to use runtime context (ros/catkin#490)
resolve roslaunch/rostest paths in installspace at runtime without find_program() (ros/catkin#490)
resolve dynamic_reconfigure path in installspace at runtime (ros/catkin#490)
…), update env hooks to use runtime context (ros/catkin#490)
resolve roslisp path in installspace at runtime (ros/catkin#490)
All repos listed in this ticket has been updated to be relocatable - therefore closing this ticket. In case other repos use |
Changes since 0.4.20: 0.5.3 (2014-07-10) ------------------ * escape messages to avoid CMake warning (`#49 <https://github.com/ros/genmsg/issues/49>`_) 0.5.2 (2014-05-07) ------------------ * refactor to generate pkg-msg-paths.cmake via configure_file() instead of empy (`#43 <https://github.com/ros/genmsg/issues/43>`_) * fix python 3 compatibility (`#45 <https://github.com/ros/genmsg/issues/45>`_) * remove debug message introduced in 0.5.1 (`#42 <https://github.com/ros/genmsg/issues/42>`_) 0.5.1 (2014-03-04) ------------------ * add check for changed message dependencies (`#41 <https://github.com/ros/genmsg/issues/41>`_) 0.5.0 (2014-02-25) ------------------ * remove usage of debug_message() (`#40 <https://github.com/ros/genmsg/issues/40>`_) 0.4.24 (2014-01-07) ------------------- * python 3 compatibility (`#36 <https://github.com/ros/genmsg/issues/36>`_, `#37 <https://github.com/ros/genmsg/issues/37>`_) * add support for ROS_LANG_DISABLE env variable (`ros/ros#39 <https://github.com/ros/ros/issues/39>`_) * fix installation of __init__.py from devel space (`#38 <https://github.com/ros/genmsg/issues/38>`_) 0.4.23 (2013-09-17) ------------------- * fix installation of __init__.py file for packages where name differs from project name (`#34 <https://github.com/ros/genmsg/issues/34>`_) * rename variable 'config' to not collide with global variable (`#33 <https://github.com/ros/genmsg/issues/33>`_) * fix service files variable to only contain package relative paths (`#32 <https://github.com/ros/genmsg/issues/32>`_) 0.4.22 (2013-08-21) ------------------- * make genmsg relocatable (`ros/catkin#490 <https://github.com/ros/catkin/issues/490>`_) * add warning in case generate_messages() is invoked without any messages and services (`#31 <https://github.com/ros/genmsg/issues/31>`_) * check if files have been generated before trying to install them (`#31 <https://github.com/ros/genmsg/issues/31>`_) 0.4.21 (2013-07-03) ------------------- * check for CATKIN_ENABLE_TESTING to enable configure without tests
Installed code should not (or as few as possible) contain absolute path information. Currently a lot of code contains the
CMAKE_INSTALL_PREFIX
.One goal would be to compile a workspace with
DESTDIR=/tmp/destdir catkin_make_isolated --install
and be able to build another workspace on top of that.At best it should be possible to run everything from the installed workspace and run the tests of workspaces built on top.
The following things need to be updated to not use absolute paths:
sourced shell scripts can not determine their own path therefore enable the user to override the default path via an environment variable, using
CATKIN_SETUP_DIR
, 9cfba6fshould be passed in from setup.sh, 9cfba6f
require context about their workspace from the outside, setup.sh need to provide that individually for each environment hook, using the environemt variable
CATKIN_ENV_HOOK_WORKSPACE
for that 44b3234DESTDIR
, 7282a4bChanges required in other packages:
should utilize
${@(PROJECT_NAME)_DIR}/../../..
to achieve the same as@(CMAKE_INSTALL_PREFIX)
, ros/gencpp@e5acaf6, ros/genlisp@42458c1, ros/genpy@1bc78ac, ros/ros@3681bd0, ros/ros_comm@e0366e1,ros/roslisp@58657c8
Message Generation:
All patches are committed to the
relocatable
branch of the respective repos. A file to checkout the modified repos using https://github.com/dirk-thomas/vcstool can be found here: https://gist.github.com/dirk-thomas/6092081The text was updated successfully, but these errors were encountered: