Asdf: Git submodule fails with asdf error

Created on 6 Apr 2020  ยท  13Comments  ยท  Source: asdf-vm/asdf

Steps to reproduce

XD: git submodule add https://github.com/jeff-hykin/beatle_interface 
/usr/local/opt/asdf/lib/utils.sh: line 208: ASDF_GETTEXT.SH_VERSION: invalid variable name
asdf: No version set for command gettext.sh
you might want to add one of the following in your .tool-versions file:

python anaconda3-5.3.1

Expected behavior

Creating a git submodule should have nothing to do with asdf

Actual behavior

There's an asdf error and I'm unable to add git submodules

Environment

OS: MacOS Sierra 10.12.6

zsh version: 5.8 (x86_64-apple-darwin16.7.0)

asdf version: v0.7.6

Notes

why is asdf affecting git?

All 13 comments

Uninstalling git with homebrew also does not solve the problem, I had to manually remove the $HOME/.asdf folder

What asdf plugins are you using?

Only python

Can you clarify what the output you posted above is?

And can you share the contents of the relevant .tool-versions file?

The code that is failing is local version_env_var="ASDF_${upcase_name}_VERSION", and upcase_name is the uppercase name of the plugin. So something on your system is fooling asdf into thinking GETTEXT.SH is a plugin name. I don't know what that would be.

Hmm that is really strange then. I don't have a .tool-versions file, there is no python in the entire file directory/repo that I'm in.

I found somewhat of a source of an issue. Reinstalling asdf with only python 3.8.2 lets the submodule work, however it begins failing again when I restore the old ~/.asdf. After some debugging, I found that renaming ~/.asdf/shims/gettext.sh to ~/.asdf/shims/gettext1.sh for some reason prevents the error.

If asdf isn't hooking into git, then would it be something from python (probably anaconda) that is?

Upon reinstall it appears /usr/local/opt/asdf/lib/utils.sh doesn't exist anymore, so the error message is this (note the restored ~/.asdf didn't contain python 3.8.2):

asdf: No preset version installed for command gettext.sh
Please install the missing version by running one of the following:

asdf install python 3.8.2

or add one of the following in your .tool-versions file:

python anaconda3-5.3.1

That looks like a more reasonable error message. If you don't have a .tool-versions file you have not specified a version (unless you used asdf shell). I think you just need to run asdf local python anaconda3-5.3.1 for your project and I think it should work. If not try asdf reshim.

Why is it activating at all though? How is the git command triggering asdf. As far as I know, git doesn't depend on python.

I don't really want a tools file with a python specification when python isn't even being used in the project, that doesn't make any sense to others who might be contributing. I'm not so much concerned about this small case as much as the implications of asdf breaking tools beyond whats in its shims.

No idea. Perhaps you have a git hook that is invoking an asdf shim? You will have to have a .tool-versions file present on your system in order to use asdf. That is a requirement unless you want to manually set versions per shell session with asdf shell.

No idea. Perhaps you have a git hook that is invoking an asdf shim?

I am certain that asdf itself is not meddling with Git. Git or another tool on your system is invoking an asdf shim.

Thanks, I'll do some research and see what I can find. I have a feeling it may have to do with git interacting with the asdf gettext shim

I ran into this issue and was able to resolve it by uninstalling anaconda3-2020.02.

Here are the packages I had installed:

โฏ asdf list python
  3.5.9
  3.7.5
  3.8.0
  3.8.1
  3.8.2
  anaconda3-2020.02

And relevant line of .tool-versions:

python 3.8.2 3.7.5 system

Same here, python anaconda3-2020.02 (not sure if other anaconda versions are affected, I've only installed that one) led to so many issues (like curl stop working as which curl led to asdf shims but there was no curl inside...)

asdf uninstall python anaconda3-2020.02 solved all of the issues I had

also:

git bisect also raises the same issue:

git bisect start
asdf: No version set for command gettext.sh
you might want to add one of the following in your .tool-versions file:

python anaconda3-2020.02
Was this page helpful?
0 / 5 - 0 ratings

Related issues

romenigld picture romenigld  ยท  4Comments

niksfirefly picture niksfirefly  ยท  3Comments

ypid picture ypid  ยท  3Comments

rhiroyuki picture rhiroyuki  ยท  3Comments

Antiarchitect picture Antiarchitect  ยท  3Comments