tristanisham / zvm

zvm (Zig Version Manager) lets you easily install/upgrade between different versions of Zig.

Home Page:https://www.zvm.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running zvm upgrade fails on Windows

Skarsh opened this issue · comments

When trying to use the upgrade command it gives the following error:

image

Not sure where I can find more detailed information to provide here.

Thanks @Skarsh! Is this a new issue you're experiencing? Or is this just the first time you've tried zvm upgrade on Windows?

This is the first time I've tried zvm upgrade, I just started using zvm a couple of weeks back.
I am currently on v0.2.4
image

This is the first time I've seen this issue. Admittedly, I predominantly develop and test on Linux. I've already made some progress on fixing this issue, and I should hopefully have it updated by the end of the week. In the meantime, you might just have to manually extract and replace zvm.exe in %USERPROFILE%\.zvm\self, sorry!

I suspect this is because the Windows release archives are .zip instead of .tar (as shown on the release page), so no wonder it does not have a valid tar header.

I also experience this issue, it's not possible at all to upgrade on Windows.
I've never used Golang so probably I'm not the best person to submit a PR, but it's seems to me that the issue is on this line:

if err := untar(tempDownload.Name(), newTemp); err != nil {

It always tries to untar without accounting for the fact that on windows the archive is actually a zip.

Noted. I'll look into that more later today. I swear that was accounted for 😅. Thanks for finding that!

I've started to make some updates on attempt-to-fix-windows-upgrade. It seems the issue is somewhere in the os.MakeTempDir call? It never gets created on Windows for some reason.

Okay, so I figured out the issue. It wasn't the temp dir. I stopped clearing it and I realized my path was off.

So now I just need to figure out a way to update the application while it's running on Windows. Which requires running some secondary script.

Somewhat fixed. At least for tonight.

Guys. I just fixed it. https://github.com/tristanisham/zvm/releases/tag/v0.6.4 😂 Took me long enough.