asdf-community/asdf-golang

Infinite recursive call in `asdf list golang`

thinca opened this issue · 13 comments

Describe the bug
asdf-vm/asdf#762
Since this change of asdf core, asdf list golang may call parse-legacy-file script internally.
parse-legacy-file script invokes asdf list golang.
The result is an infinite recursive call.

To Reproduce
Steps to reproduce the behavior:

  1. Install head version of asdf
  2. mkdir example; cd example; go mod init example.com/m
  3. asdf list golang
  4. Command hung(infinite recursive call).

Expected behavior
Show the version and exit.

Desktop (please complete the following information):

  • OS: Linux
  • asdf version: v0.10.2-624aede
  • asdf-golang cc8bc47

@kennyp
Hi! I'm sorry to bother you when you're busy.

This issue is critical for asdf users which' enable legacy_version_file.
One solution is to revert #34 . Another is listing installed versions independent from asdf list command (a little complex and redundant).

I would like to work on solving this problem, so please let me know the desired solution!

@yokonao I'm using asdf version v0.10.2-7e7a1fa and I can't reproduce. 🤔

I'm working on pulling out the recursive call back into asdf list, but it would be great to reproduce before saying I've fixed it if that makes sense.

@kennyp
This PR is merged after released v0.10.2. So, it makes sense that You are unable to reproduce when v0.10.2-7e7a1fa.
Howerver, this problem occurs if v0.10.3 is released in the future.

Please try to reproduce using latest asdf.

Ahh, I missed the note that you were using asdf head. Let me see what I can figure out.

I'll note that I did experience this. But I am no longer able to after ensuring everything was up to date.

I updated asdf and the plugin:

$ asdf update
$ asdf plugin update golang

After which, I'm no longer able to replicate.


Looking at my git reflog for both the plugin and asdf, I was able to reset my installation to a reproducible configuration!

According to my reflog, I've had version cc8bc47 of the plugin the whole time (recently deleted it and reinstalled it for other reasons).

But for asdf, this update took me from asdf-vm/asdf@cd31d57 (can reproduce) to asdf-vm/asdf@7e7a1fa (cannot reproduce).

$ cd ~/.asdf
$ git checkout cd31d57

And 💥 recursion bug. Hopefully that helps!

asdf version 0.11.0 is out and after updating my local setup I can confirm facing this bug.

Note: this bug has been the cause for bash warning shell level (1000) too high resetting to 1 message(got this when simply cd'ing into a go project) and "fork failed: Resource temporarily unavailable" issue(got this after running the gopls server for a while in neovim. I couldn't do anything on the terminal and just kept getting this error message, since my system had too many processes running asdf list golang).

+1 to @dushyantss is reporting above

I just tried the regex fix in #89 and it seems to have helped

I'm trying to resolve this on the issue I opened on asdf as I need a way to get a list of the currently installed versions to accurately conform to go.mod.

@yokonao, @dushyantss, or @jharley can y'all verify that #93 fixes the issue for you?

Tested #93, works for me 🥳. Tried both, cd'ing into a go project and opening it in neovim with gopls.

Thanks @kennyp for the prompt fix.

Awesome! I'll merge it.

#93 fixed things for me as well!

Thanks for the quick resolution, @kennyp!