Skip to content

bug: ASDF "latest:[...]" not working as it should #2073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Venefic opened this issue Apr 30, 2025 · 4 comments
Open

bug: ASDF "latest:[...]" not working as it should #2073

Venefic opened this issue Apr 30, 2025 · 4 comments
Labels

Comments

@Venefic
Copy link

Venefic commented Apr 30, 2025

Describe the Bug

Since ASDF version 0.16.5 every install command that is installing 'latest' version in certain conditions is not working. I've pinpointed the exact commit and thing that is doing so. Pull request fix: latest version returns latest version #1996 containing commit 46d3f42 does add an additional filtering by "numericStartFilterRegex"that is created in line 27 and used in line 264. This causes every software distribution not starting with a number to fail during 'latest' installation eg. java latest:temurin-8 or python latest:pypy3.9 but when you try 'python latest:3.13' it will work.
Below will be tests and results so a lot of pasting:
Testing installation when using version 0.16.7 with added prints before filters, after numeric filter and after latest filter:
root@665ce900120d:/new/asdf/cmd/asdf# asdf install java latest:temurin-8 All versions: [temurin-8.0.302+8 temurin-8.0.312+7 temurin-8.0.322+6 temurin-8.0.332+9 temurin-8.0.342+7 temurin-8.0.345+1 temurin-8.0.352+8 temurin-8.0.362+9 temurin-8.0.372+7 temurin-8.0.382+5 temurin-8.0.392+8 temurin-8.0.402+6 temurin-8.0.412+8 temurin-8.0.422+5 temurin-8.0.432+6 temurin-8.0.442+6 temurin-8.0.452+9] Filter after numeric: [] Filter after latest: [] error installing version: no latest version found

And then after changing line 262 in versions.go file to:
versions = filterOutByRegex(allVersions, latestFilterRegex, false)
I've got:
root@665ce900120d:/new/asdf/cmd/asdf# asdf install java latest:temurin-8 All versions: [temurin-8.0.302+8 temurin-8.0.312+7 temurin-8.0.322+6 temurin-8.0.332+9 temurin-8.0.342+7 temurin-8.0.345+1 temurin-8.0.352+8 temurin-8.0.362+9 temurin-8.0.372+7 temurin-8.0.382+5 temurin-8.0.392+8 temurin-8.0.402+6 temurin-8.0.412+8 temurin-8.0.422+5 temurin-8.0.432+6 temurin-8.0.442+6 temurin-8.0.452+9] Filter after numeric: [] Filter after latest: [temurin-8.0.302+8 temurin-8.0.312+7 temurin-8.0.322+6 temurin-8.0.332+9 temurin-8.0.342+7 temurin-8.0.345+1 temurin-8.0.352+8 temurin-8.0.362+9 temurin-8.0.372+7 temurin-8.0.382+5 temurin-8.0.392+8 temurin-8.0.402+6 temurin-8.0.412+8 temurin-8.0.422+5 temurin-8.0.432+6 temurin-8.0.442+6 temurin-8.0.452+9]
And it started to install correct version (temurin-8.0.452+9)

I would propose to remove the filtering that removes everything not starting with a number as this should be filtered on the side of plugin, and since this was merged not sure how many different plugins are affected.

Steps to Reproduce

  1. Install ASDF version 0.16.5 or higher
  2. Add plugin java or python
  3. Try installing any version that does not start with a number eg. latest:temurin-8

Expected Behaviour

ASDF grabs latest temurin-8 version (temurin-8.0.452+9), downloads and installs it.

Actual Behaviour

You will get an error like:
root@17b4adcee23c:~# asdf install java latest:temurin-8 error installing version: no latest version found

Environment

OS:
Linux 17b4adcee23c 6.10.14-linuxkit #1 SMP Thu Mar 20 16:32:56 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

SHELL:
GNU bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

BASH VERSION:
5.2.21(1)-release

ASDF VERSION:
v0.16.5

ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/root/.asdf
ASDF_CONFIG_FILE=/root/.asdfrc

ASDF INSTALLED PLUGINS:
dotnet     https://github.com/hensou/asdf-dotnet                04bab449f3a29e4faaa7a2dd4be08eab59abc68b
helm       https://github.com/Antiarchitect/asdf-helm.git       085651c91e61936289ed79976fe3ba53bf6787ae
java       https://github.com/halcyon/asdf-java.git             cecb96773181cd0990deee3ab258260aa1189135
kubectl    https://github.com/asdf-community/asdf-kubectl.git   2fb3b57090e3efe55953a751a134c271ba83b119
maven      https://github.com/halcyon/asdf-maven.git            583612baaa031ca1ef4cf73185c51bb0fcc52daf
opentofu   https://github.com/virtualroot/asdf-opentofu.git     abe1013677c56742c74adcac79f0734e6c232e09
python     https://github.com/danhper/asdf-python.git           a3a01856098d6d2b9642e382f5b38e70275726d1
shellcheck https://github.com/luizm/asdf-shellcheck.git         66200ffa221fc75d7b28103f53326db6e721d08f
terraform  https://github.com/asdf-community/asdf-hashicorp.git 22eb1c4a16adcde39aaaf89fbb5d9404a1601fce
terragrunt https://github.com/gruntwork-io/asdf-terragrunt.git  c3c4f74458defc52d5944b68179205f6b8ca9bb8

asdf plugins affected (if relevant)

python, java

@Venefic Venefic added the bug label Apr 30, 2025
@Stratus3D
Copy link
Member

@Venefic do you happen to know if this was an issue in older versions of asdf like 0.15.0?

@Venefic
Copy link
Author

Venefic commented May 14, 2025

Hi @Stratus3D afaik everything before adding "numericStartFilterRegex" works fine. I've removed this filter locally and rebuilt ASDF and it's working fine.

@elijahr
Copy link
Contributor

elijahr commented May 19, 2025

The CI for asdf-nim uses latest:X.Y, and our builds are currently broken because of this or a related issue.

Example build: https://github.com/asdf-community/asdf-nim/actions/runs/15121840813

latest:2.2 seems to resolve to the very earliest version (0.8.14), not the latest X.Y version.

Output of asdf list all nim:

0.8.14
0.9.0
0.9.2
0.9.4
0.9.6
0.10.2
0.11.0
0.11.2
0.12.0
0.13.0
0.14.0
0.14.2
0.15.0
0.15.2
0.16.0
0.17.0
0.17.2
0.18.0
0.19.0
0.19.2
0.19.4
0.19.6
0.20.0
0.20.2
1.0.0
1.0.2
1.0.4
1.0.6
1.0.8
1.0.10
1.2.0
1.2.2
1.2.4
1.2.6
1.2.8
1.2.10
1.2.12
1.2.14
1.2.16
1.2.18
1.4.0
1.4.2
1.4.4
1.4.6
1.4.8
1.6.0
1.6.2
1.6.4
1.6.6
1.6.8
1.6.10
1.6.12
1.6.14
1.6.16
1.6.18
1.6.20
2.0.0
2.0.2
2.0.4
2.0.6
2.0.8
2.0.10
2.0.12
2.0.14
2.0.16
2.2.0
2.2.2
2.2.4

@gdotdesign
Copy link

gdotdesign commented May 20, 2025

I'm having a similar issue as @elijahr after upgrading the actions (dependabot suggestion) the latest selected is not the latest of Mint:
https://github.com/mint-lang/asdf-mint/actions/runs/15136069634/job/42548031375

The latest version is 0.24.1 and the resolved version seems to be 0.8.0.

Never mind, it's the actions that is broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants