On Thu, Jul 12, 2012 at 11:53 AM, Lorenz Mösenlechner
<
moes...@in.tum.de> wrote:
> Hi,
>
> you are right that having a proper uninstall target would be nice. But
> I think it needs to work in 100 percent of all use cases. If it's only
> half-working, things could get messy much too easy.
Agreed. It needs to work reliably. Half-working is a disaster. It
should definitely work better than the alternatives, but none of them
will cover 100% of all use cases.
> It would be interesting which linux distros are used by how many
> people. I guess most people are still using Ubuntu on x86 or amd64.
> These people wouldn't need an uninstall target. People using RedHat,
> Slackware or Debian can use CheckInstall to create packages for their
> package manager. So these people won't need an uninstall target
> either. Finally, there is Arch linux and Gentoo for which it is very
> simple to create build files to integrate in the package manager.
Linux is not the only target. Don't forget OSX or embedded systems.
Your checkinstall suggestion is interesting and worth discussing. We
should give it some serious thought.
The last time I tried checkinstall was many years ago. It did not work
very well back then, and I ended up using GNU stow instead. (I was not
very pleased with that, either.) Presumably, checkinstall works better
now. I was surprised to discover there is even recent support for OSX,
but I don't know how mature that is.
Maybe checkinstall is an option. I could imagine recommending that
people building from source always use checkinstall, if it supports
their underlying platform. The main problem is testing that it
actually works on all relevant platforms. If it does not, we are left
with the same problems as a botched uninstall. Users will attempt to
rm some files, probably not do it exactly right, then ask us for help
on
answers.ros.org.
With a built-in uninstall, we can write adequate unit tests which only
depend on the build system, itself. The obvious cases of adding and
deleting installed files can certainly be tested that way. That still
seems like a cleaner and more reliable solution to me.
> To summarize, I don't object uninstall targets completely. I just
> think it's hard to get them right and an uninstall target that is not
> working correctly is worse than no uninstall target at all. Since it
> is really easy to create packages in most distros I don't think
> hacking together an uninstall target in catkin is really worth the
> effort.
I am not advocating that we hack together something that works poorly.
I believe any reasonable build system should allow users to install
files and later remove exactly the files they installed.
There are two common problems that arise:
* multiple packages installing the same file
This is typically not a problem with ROS packages. We should create a
Hudson script to verify that it never occurs during any test build.
Note that checkinstall would not handle this problem, either.
* configuration files that the user edits after installation
ROS is relatively free of user-edited config files. The install
targets are typically read-only to normal users anyway. While we will
always have Linux newbies trying to edit files under /opt/ros just
because they can, reasonable practices can be recommended for most
people.
Maybe there is something else I am forgetting at the moment, but this
is really not that difficult.
I don't want to beat this uninstall issue to death. It is not the most
crucial problem with the build system. I believe there are bigger
problems with over-dependence on the underlying package system than
simply uninstalling files.
Regards,
--
joq