code icon indicating copy to clipboard operation
code copied to clipboard

Add a way to uninstall Code when built from source and installed with meson

Open skaldebane opened this issue 4 years ago • 7 comments

What Happened

I installed elementary Code from source, but now I want to remove it. I'm used to use things like make uninstall which do just that for many other projects, but apparently this project is using meson (and I'm aware of problems with uninstalling that are caused by the nature of meson, and are still discussed in various issues) and it provides no way of removing it.

Expected Behavior

There should be a command like sudo ninja uninstall (or sudo ninja code-uninstall for that matter (see this issue about meson)).

Steps to Reproduce

Just install and Tada! You can't remove it reliably without missing something behind.

Platform Information

OS: Fedora 34 Workstation (x86_64) DE: GNOME 40.1 elementary Code: Built and installed from source, a week ago.

skaldebane avatar Jun 12 '21 13:06 skaldebane

At the moment it is intended that Code only build and install Flatpaks, which are relatively easy to uninstall. You are right that elementary meson projects at least do not provide an "uninstall" target at the moment, which can be a nuisance.

jeremypw avatar Jun 12 '21 15:06 jeremypw

There should be a command like sudo ninja uninstall

AFAIK, there's already a ninja uninstall target made by meson itself. But that don't remove files created by custom scripts and external commands. So, locale files and gschemas need to be removed manually.

different of the install target, this target need to be executed with sudo.

Marukesu avatar Jun 14 '21 22:06 Marukesu

Yeah that's why I mentioned the issue about ninja, in which there's a comment talking about the possibility of making something like sudo ninja uninstall-code with all the required scripts. I never worked with any of these tools and I don't know how they specifically work, but from what I've read this should still be possible, although tricky and not so straightforward to the user.

By the way, even the install target needs sudo.

skaldebane avatar Jun 17 '21 00:06 skaldebane

Reducing scope to Flatpaks only as there is no obvious way to implement it for native meson installs. If and when the facility to build and install Flatpaks with Code is implemented it would make sense to add a facility to uninstall such packages (but not before).

jeremypw avatar Dec 08 '21 18:12 jeremypw

Your wording is a little weird here, how exactly "install Flatpaks with Code"? Do you mean "install the Flatpak version of Code"?

skaldebane avatar Dec 09 '21 21:12 skaldebane

I mean "Add a way to uninstall a Flatpak package after it has been built from source using the Code app". Its a little hard to find a succinct description. I am trying to limit the scope of this issue to only address the situation that a Flatpak package has been built and installed by using the proposed future facilities of Code (#940). I do not think Code should be able to uninstall an arbitrary Flatpak - that is the job of AppCenter or other package manager. However undoing one of its own actions is valid.

jeremypw avatar Dec 10 '21 09:12 jeremypw

But that's not what I meant here. I am talking about uninstalling Code itself from the system.

I installed the latest version of Code on Fedora from source, but the default GNOME Gtk theme messed it up, so.... I tried removing it from my system. I've built apps from source before, and most of them can be uninstalled easily using a shell script (not using meson), not this one though.

Now I removed it from the system fully by manually searching for any files it might've added and removing them, but here I'm asking if there's a possibility to make this an easier one-command process. This is related to meson apparently (as I linked in the original question).

(I know, there are workarounds for the theming issue, but I'll wait until a proper version of Code lands in elementary's Flatpak repo with a built-in theme)

skaldebane avatar Dec 11 '21 17:12 skaldebane

Closing as later versions of meson/ninja automatically have an uninstall target so Code can be (mostly) uninstalled with sudo ninja uninstall.

jeremypw avatar Jul 07 '23 17:07 jeremypw

Great news! Thanks for the update.

skaldebane avatar Jul 08 '23 01:07 skaldebane