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

Please provide an 'uninstall' target #753

Closed
tim-janik opened this Issue Sep 3, 2016 · 8 comments

Comments

Projects
None yet
6 participants
@tim-janik

tim-janik commented Sep 3, 2016

Lacking an 'uninstall' target can be a real show stopper for projects to even consider moving from autotools to meson. New users (potential contributors) are trying out software projects all the time and need ways to undo installation (just google for 'make uninstall' to get a glimpse).
Furthermore software development/debugging and packaging, working on package versioning, fixing installation locations, testing libraries, testing translations, etc can all involve needing 'uninstall' almost as often as installation.

So please make uninstall as easy as installation for software built with meson.

@jpakkane

This comment has been minimized.

Show comment
Hide comment
@jpakkane

jpakkane Sep 3, 2016

Member

We do plan on having some sort of uninstallation support but it is trickier to do reliably. However Meson writes a list of all files it installs inside meson-logs dir. It is not complete because custom install scripts can do arbitrary file operations. But if it is enough for you, then writing a script that loads the file and deletes all files listed in it is simple.

Member

jpakkane commented Sep 3, 2016

We do plan on having some sort of uninstallation support but it is trickier to do reliably. However Meson writes a list of all files it installs inside meson-logs dir. It is not complete because custom install scripts can do arbitrary file operations. But if it is enough for you, then writing a script that loads the file and deletes all files listed in it is simple.

@nirbheek

This comment has been minimized.

Show comment
Hide comment
@nirbheek

nirbheek Sep 4, 2016

Member

What exactly is the criteria for 'reliably'? I think it should be really simple and 'dumb'. Store DESTDIR (but allow it to be overriden via the env) + a list of files and just remove them on uninstall.

I don't think it makes sense to try to be smart and check file sizes or checksums to ensure that we installed the file before removing it. For one, it breaks uninstall of files that have been modified by the program after installation (system-specific configuration, for instance).

Member

nirbheek commented Sep 4, 2016

What exactly is the criteria for 'reliably'? I think it should be really simple and 'dumb'. Store DESTDIR (but allow it to be overriden via the env) + a list of files and just remove them on uninstall.

I don't think it makes sense to try to be smart and check file sizes or checksums to ensure that we installed the file before removing it. For one, it breaks uninstall of files that have been modified by the program after installation (system-specific configuration, for instance).

@russel

This comment has been minimized.

Show comment
Hide comment
@russel

russel Dec 4, 2016

SCons tracks all install files in the build DAG and so can uninstall no problem. CMake has no uninstall by default, it just writes a list of installation locations. There is a plugin providing an uninstall command for those (like me) who do not want to have to manually remove files or use an off-the-cuff shell script. To be honest: "no uninstall capability, no use of build framework".

russel commented Dec 4, 2016

SCons tracks all install files in the build DAG and so can uninstall no problem. CMake has no uninstall by default, it just writes a list of installation locations. There is a plugin providing an uninstall command for those (like me) who do not want to have to manually remove files or use an off-the-cuff shell script. To be honest: "no uninstall capability, no use of build framework".

jpakkane added a commit that referenced this issue Dec 28, 2016

jpakkane added a commit that referenced this issue Dec 28, 2016

jpakkane added a commit that referenced this issue Dec 29, 2016

jpakkane added a commit that referenced this issue Dec 31, 2016

@jpakkane jpakkane closed this in 0a14ad6 Dec 31, 2016

@anordal

This comment has been minimized.

Show comment
Hide comment
@anordal

anordal Aug 16, 2017

While this is great progress, it's no fun if all your meson projects already had that custom uninstall target (because you had to provide that before):

Target name 'uninstall' is reserved for Meson's internal use. Please rename.

Lacking an 'uninstall' target can be a real showstopper

That was actually no problem:

setprefix = 'MESON_INSTALL_PREFIX=' + prefix
run_target('uninstall', command: ['make', '-f', 'install.mk', setprefix, 'uninstall'])

What now, if you need a custom uninstall script? I see there is an add_install_script(), but no add_uninstall_script().

anordal commented Aug 16, 2017

While this is great progress, it's no fun if all your meson projects already had that custom uninstall target (because you had to provide that before):

Target name 'uninstall' is reserved for Meson's internal use. Please rename.

Lacking an 'uninstall' target can be a real showstopper

That was actually no problem:

setprefix = 'MESON_INSTALL_PREFIX=' + prefix
run_target('uninstall', command: ['make', '-f', 'install.mk', setprefix, 'uninstall'])

What now, if you need a custom uninstall script? I see there is an add_install_script(), but no add_uninstall_script().

@TingPing

This comment has been minimized.

Show comment
Hide comment
@TingPing

TingPing Aug 16, 2017

Contributor

Just name it foo-uninstall.

Contributor

TingPing commented Aug 16, 2017

Just name it foo-uninstall.

@anordal

This comment has been minimized.

Show comment
Hide comment
@anordal

anordal Aug 16, 2017

Lol, asking the user to type ninja foo-uninstall, while ninja uninstall exists as a trap that does nothing … not the most intuitive interface ever.

I'm asking for a way to hook into or override the uninstall target. Such as making the builtin uninstall depend on that custom foo-uninstall.

anordal commented Aug 16, 2017

Lol, asking the user to type ninja foo-uninstall, while ninja uninstall exists as a trap that does nothing … not the most intuitive interface ever.

I'm asking for a way to hook into or override the uninstall target. Such as making the builtin uninstall depend on that custom foo-uninstall.

@TingPing

This comment has been minimized.

Show comment
Hide comment
@TingPing

TingPing Aug 16, 2017

Contributor

Should open a new issue requesting that feature.

Contributor

TingPing commented Aug 16, 2017

Should open a new issue requesting that feature.

@anordal

This comment has been minimized.

Show comment
Hide comment
@anordal

anordal commented Aug 17, 2017

Yes: #1974

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment