asdf-vm / asdf-vm/asdf

install order should follow the order in .tool-versions

Open
#929 17 comments 13 reactions 0 assignees View on GitHub
bug priority
Dominant language
Go
Stars
25.6k
Forks
941
Avg merge
9h 24m
Merged PRs (30d)
3

Description

**Describe the bug**

Some plugins depend on others to be installed first. Despite being expressed that way in the .tool-versions file, asdf alphabetizes the install regardless.

This feels like it should be the default behavior, but at the very least there should be a flag for it.

**To Reproduce**

```shell
# .tool-versions
python 3.9.4
awscli 2.2.0
```
`asdf install`

**Expected behavior**

The .tool-versions file is installed top to bottom.

**Actual behavior**

The installation happens in alphabetical order.

> asdf install
> * Downloading awscli release 2.2.0...
> ~/.asdf/installs/awscli/2.2.0 ~
> .asdf/plugins/awscli/bin/../lib/utils.bash: line 86: python: command not found
> .asdf/plugins/awscli/bin/../lib/utils.bash: line 87: ./venv/bin/activate: No such file or directory
> .asdf/plugins/awscli/bin/../lib/utils.bash: line 88: pip: command not found
> .asdf/plugins/awscli/bin/../lib/utils.bash: line 89: pip: command not found
> .asdf/plugins/awscli/bin/../lib/utils.bash: line 90: pip: command not found
> .asdf/plugins/awscli/bin/../lib/utils.bash: line 91: deactivate: command not found
> ~
> awscli 2.2.0 installation was successful!
> Downloading python-build...

### Environment

```shell
OS:
Darwin C02WQ018HTDD 20.4.0 Darwin Kernel Version 20.4.0: Fri Mar 5 01:14:14 PST 2021; root:xnu-7195.101.1~3/RELEASE_X86_64 x86_64

SHELL:
zsh 5.8 (x86_64-apple-darwin20.0)

ASDF VERSION:
v0.8.0
```

Contributor guide

Open the contributing guide

Research direction

Start with the `asdf install` entry point and trace how it reads `.tool-versions` and chooses installation order. Reproduce the Python and awscli example, then verify that installations run top to bottom and that the dependency is available before the dependent plugin runs.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, shell
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.