pyros-dev/catkin_pip

What to do when user didnt source catkin_pip envhooks ?

Closed this issue · 2 comments

  • basic catkin triggers an error (triggered from an install from source of catkin):
CMake Error at CMakeLists.txt:59 (message):
  find_package(catkin) failed.  catkin was neither found in the workspace nor
  in the CMAKE_PREFIX_PATH.  One reason may be that no ROS setup.sh was
  sourced before.
  • basic catkin is not even callable without sourcing a setup.sh from basic indigo install

  • current catkin_pip tries to work around the problem in the cases where our env-hooks have not been triggered (see https://github.com/asmodehn/catkin_pip/blob/devel/cmake/catkin-pip-env.cmake.in#L19). This might not be a good idea... it makes the code more complex and introduce two different code path for the build configuration.

Making things simpler by failing if env-hooks have not been called is likely the best bet here. This would mean that any package using catkin_pip needs to be built after sourcing an environment where catkin_pip is setup, which means it will fail when running from source workspace where catkin_pip and pkgA are located, just after sourcing a /opt/ros/indigo/setup.sh, if that indigo environment does NOT include catkin_pip (or a somehow incompatible version). But we do need an explicit and helpful error message in that case.

TODO : checking catkin_tools behaviour...

This is also related with different version conflicting on behavior :

What should happens if user is calling catkin_pip v3 function, but has sourced envhooks v2.

It seems that failing with a meaningful error would also be the proper thing to do here...

We do need to think about a way to implement this (probably something similar to CMAKE_MINIMUM_VERSION, without getting into policies - it would be much more complex than what we probably need...)

Maybe also this is more complicated than needed.

Now in #61 the envhook are sourced using catkin_env, since we have a.sh envhook (and not a bash envhook).

Which means that this problem disappeared :-)

Closing this, lets reopen or make a new one if we see a similar problem again...