asdf-vm/asdf-erlang

Fails to install after uninstall

n-epifanov opened this issue · 1 comments

Once asdf uninstall erlang <version> is done it becomes impossible to install it again:

$ asdf install erlang 25.3
asdf_25.3 is not a kerl-managed Erlang/OTP installation
The asdf_25.3 build has been deleted
Extracting source code
Building Erlang/OTP 25.3 (asdf_25.3), please wait...
WARNING: You appear to have BOTH rpm and dpkg. This is very strange. No package checks done.
APPLICATIONS DISABLED (See: /home/nick/.asdf/plugins/erlang/kerl-home/builds/asdf_25.3/otp_build_25.3.log)
 * odbc           : ODBC library - link check failed

APPLICATIONS INFORMATION (See: /home/nick/.asdf/plugins/erlang/kerl-home/builds/asdf_25.3/otp_build_25.3.log)
 * wx             : wxWidgets was not compiled with --enable-webview or wxWebView developer package is not installed, wxWebView will NOT be available

Building docs...
Erlang/OTP 25.3 (asdf_25.3) has been successfully built
ERROR: Installation (asdf_25.3) already registered for this location (/home/nick/.asdf/installs/erlang/25.3)

$ asdf uninstall erlang 25.3
No such version

That's because entry to otp_installations is added but not removed, then there's a check on that entry and installation fails:

~/.asdf/plugins/erlang/kerl-home$ cat otp_installations 
asdf_23.0.3 /home/nick/.asdf/installs/erlang/23.0.3
asdf_18.3 /home/nick/.asdf/installs/erlang/18.3
asdf_20.3 /home/nick/.asdf/installs/erlang/20.3
asdf_22.2.3 /home/nick/.asdf/installs/erlang/22.2.3
asdf_23.1.2 /home/nick/.asdf/installs/erlang/23.1.2
asdf_23.1.3 /home/nick/.asdf/installs/erlang/23.1.3
asdf_22.3.4.1 /home/nick/.asdf/installs/erlang/22.3.4.1
asdf_23.2.7 /home/nick/.asdf/installs/erlang/23.2.7
asdf_23.3.1 /home/nick/.asdf/installs/erlang/23.3.1
asdf_22.3.4.10 /home/nick/.asdf/installs/erlang/22.3.4.10
asdf_23.1.1 /home/nick/.asdf/installs/erlang/23.1.1
asdf_25.3 /home/nick/.asdf/installs/erlang/25.3
$ ll ~/.asdf/installs/erlang/
total 0

I had the same problem and what fixed it for me was actually uninstalling the plugin and installing it again. We need a permanent solution though.