gazebosim/gz-tools

Create debian package

osrf-migration opened this issue · 7 comments

Original report (archived issue) by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


It would be nice to create a debian package for this so that debs of ignition-transport can support this tool. I think it currently only works on Ubuntu if you install from source.

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


cc @_jrivero_

I'm not sure how difficult this will be.

Original comment by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).


I was trying out the latest ign-tools debian packages together with a source install of ign-transport4 and the out-of-the-box experience is not very nice, because we need to set IGN_CONFIG_PATH. A source install of ign-tools doesn't have the same requirement.

Here's a way to test this:

docker run -ti ubuntu:xenial /bin/bash

Then:

echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable xenial main" > /etc/apt/sources.list.d/gazebo-stable.list
echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-prerelease xenial main" > /etc/apt/sources.list.d/gazebo-prerelease.list
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys D2486D2DD83DB69272AFE98867170598AF249743
apt update
apt install -y cmake pkg-config mercurial build-essential libprotobuf-dev protobuf-compiler libprotoc-dev libzmq3-dev uuid-dev libignition-msgs-dev ruby-dev ignition-tools libignition-tools-dev
hg clone https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-transport -b ign-transport4
cd  ign-transport/
mkdir build
cd build/
cmake .. -DBUILD_TESTING=false
make -j8 install

Now try running a command, it will fail, but with a source install it would just work.

root@83a5ecab2cde:/ign-transport/build# ign
I cannot find any available 'ign' command:
	* Did you install any ignition library?
	* Did you set the IGN_CONFIG_PATH environment variable?
	    E.g.: export IGN_CONFIG_PATH=$HOME/local/share/ignition

This does work though:

IGN_CONFIG_PATH=/usr/local/share/ignition/ ign topic -e -t /foo & IGN_CONFIG_PATH=/usr/local/share/ignition/ ign topic -t /foo -m   ignition.msgs.StringMsg -p 'data:"Custom data"'

I don't know in which path tools is looking for the configuration files by default, but it seems to be different for a source and deb install. I think what's happening is that tools is looking for the config file in the same place where it was installed, so I suspect that once we have debs built with ign-tools support, those would work out-of-the-box.

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


Maybe it's because you've installed to /usr/local but the debs install to /usr? What if you use -DCMAKE_INSTALL_PREFIX=/usr in your cmake call?

Original comment by Jose Luis Rivero (Bitbucket: Jose Luis Rivero, GitHub: j-rivero).


we could add the ability to scan both /usr and /usr/local if that improves usability a little bit. /usr/local usually does not have too many things so it should not turn into an scalability problem.

Original comment by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).


Yup, installing in /usr solves the problem.

Looking at the logic here I think only one path is supported at a time. I'll see if I can make it support multiple paths.

Original comment by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).


Broadly speaking, we're missing more flexible ways of finding yaml files.

Another use case is when using colcon to build a workspace. Since it isolates the libraries, the files end up installed in different directories, i.e. ~/ws/install/<lib>/share/ignition/<lib>.yaml.

Because the IGN_CONFIG_PATH env var currently expects a single path, we can't even point to all of these. One hacky way to do it is using symlinks:

mkdir ~/.ignition/tools/configs -p
cd ~/.ignition/tools/configs/
ln -s ~/ws/install/ignition-transport6/share/ignition/transport6.yaml .
ln -s ~/ws/install/ignition-gui1/share/ignition/gui1.yaml .
...
export IGN_CONFIG_PATH=$HOME/.ignition/tools/configs

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


  • changed state from "new" to "resolved"

I believe we have a debian package of this repository.