tristanisham / zvm

zvm (Zig Version Manager) lets you easily install/upgrade between different versions of Zig.
https://www.zvm.app
MIT License
471 stars 32 forks source link

[BUG] Fail to show list remote Zig versions available for download #104

Closed pkropachev closed 2 days ago

pkropachev commented 2 days ago

Describe the bug Fail to show list remote Zig versions available for download.

To Reproduce Steps to reproduce the behavior:

  1. Run zvm ls --all

Expected behavior List of available versions is shown.

Desktop (please complete the following information):

I've tried with and without VMU.

With VMU

~#@❯ zvm --version
ZVM version v0.7.9 linux/amd64
 ~#@❯ cat ~/.zvm/settings.json
{
    "versionMapUrl": "https://ziglang.org/download/index.json",
    "zlsVersionMapUrl": "https://releases.zigtools.org/",
    "useColor": true,
    "alwaysForceInstall": false
}%
~#@❯ zvm ls --all

   Help   

Encountered an issue while trying to install ZLS for Zig 'master'.

Problem: ZVM v0.7.7 and v0.7.8 may have saved an invalid 'zlsVersionMapUrl' to your settings, 
which causes this error. The latest version, v0.7.9, can fix this issue by using the correct URL.

To resolve this:
1. Open your ZVM settings file: '~/.zvm/settings.json'
2. Remove the 'zlsVersionMapUrl' key & value from the file (if present).
What happens next: ZVM will automatically use the correct version map the next time you run it
If the issue persists, please double-check your settings and try again, or create a GitHub Issue.

  Error   

2024/10/29 14:32:56 ERRO invalid version map format: invalid character '<' looking for beginning of value

If you're experiencing a bug, run zvm upgrade. If there's a new version of ZVM, we may have already fixed your bug in a new release :)
Otherwise, please report this error as a GitHub issue.
https://github.com/tristanisham/zvm/issues/

Without VMU

 ~#@❯ zvm --version
ZVM version v0.7.9 linux/amd64
 ~#@❯ cat ~/.zvm/settings.json
{
    "useColor": true,
    "alwaysForceInstall": false
}
 ~#@❯ zvm ls --all

   Help   

Encountered an issue while trying to install ZLS for Zig 'master'.

Problem: ZVM v0.7.7 and v0.7.8 may have saved an invalid 'zlsVersionMapUrl' to your settings, 
which causes this error. The latest version, v0.7.9, can fix this issue by using the correct URL.

To resolve this:
1. Open your ZVM settings file: '~/.zvm/settings.json'
2. Remove the 'zlsVersionMapUrl' key & value from the file (if present).
What happens next: ZVM will automatically use the correct version map the next time you run it
If the issue persists, please double-check your settings and try again, or create a GitHub Issue.

  Error   

2024/10/29 14:36:48 ERRO invalid version map format: invalid character '<' looking for beginning of value

If you're experiencing a bug, run zvm upgrade. If there's a new version of ZVM, we may have already fixed your bug in a new release :)
Otherwise, please report this error as a GitHub issue.
https://github.com/tristanisham/zvm/issues/
pkropachev commented 2 days ago

Sorry, it looks like the problem in my enviroment. All is ok in case setting proxy explicitly.

 ~#@❯ HTTPS_PROXY=corp.proxy.com:8080 ZVM_DEBUG=1 zvm ls --all
2024/10/29 15:10:33 DEBU Automatic Upgrade Checker disabled=false
2024/10/29 15:10:33 DEBU Version Map url="" cmd=list/ls
2024/10/29 15:10:33 DEBU initial VMU url=""
2024/10/29 15:10:33 DEBU setting's VMU url=""
2024/10/29 15:10:33 DEBU initial ZRW func=fetchZlsTaggedVersionMap url=""
2024/10/29 15:10:33 DEBU setting's ZRW url=""
2024/10/29 15:10:33 DEBU Version Map Url (95) func=fetchZlsTaggedVersionMap url=https://releases.zigtools.org/v1/zls/index.json
0.13.0  (tagged zls)
0.12.1
0.12.0  (tagged zls)
0.11.0  (tagged zls)
0.10.1
0.10.0  (tagged zls)
0.9.1
0.9.0   (tagged zls)
0.8.1
0.8.0
0.7.1
0.7.0
0.6.0
0.5.0
0.4.0
0.3.0
0.2.0
0.1.1
master
tristanisham commented 2 days ago

@pkropachev Thanks for taking a time to create an issue and working on self-diagnosing it in your environment. I had a bit of a heart attack seeing your post! I thought I'd have to release a third hot fix. Glad to see it resolved itself.