zigup icon indicating copy to clipboard operation
zigup copied to clipboard

Offer curl-based, pre-compiled, zig-less installation

Open mcandre opened this issue 4 years ago • 17 comments

Yay, a Zig version manager!

Could we get some shell install commands, to help first-time users who may not already have a Zig compiler installed? Similar to how rustup works.

Specifically, the user should not be required to have zig installed at the time zigup is installed. Rather, zigup could obtain a precompiled zig binary and put it in a zigup-friendly place on behalf of the user, so that the user only needs to know how to run a curl command, and zigup does 100% of the rest of the work of preparing zig's. Most version managers work this way.

mcandre avatar Dec 08 '20 19:12 mcandre

Yeah I think some equivalent to rustup would be great.

I'm a bit confused by your wording here though. Zigup doesn't require Zig to be installed to work. If you have a zigup binary, you should be able to use it whether or not zig is installed. That being said, in order to compile zigup you need a Zig compiler, is that what you meant?

marler8997 avatar Dec 09 '20 20:12 marler8997

Yes, I think he means that having a binary to download directly from here would be very helpful for new users as they wouldn't even have a zig compiler installed yet.

New users could just download a precompiled zigup binary and go

Nomy1 avatar Jan 08 '21 15:01 Nomy1

Ok, I think the tentative plan then is to write a script/tool to compile zigup for the same set of platforms that Zig supports, then creates a set of archives that can be uploaded into a zigup release on github. These versions of zigup should be compiled statically (like the zig executable) for portability. These archives could be downloaded manually, however, we can also host a shell script that can be piped to curl that will select and download the appropriate zigup archive and extract it for the user.

Note that to support a static version of zigup, we'll need to either compile openssl statically, or use a complete zig implementation for HTTPS. I discovered this project the other day, we may be able to use it: https://github.com/alexnask/iguanaTLS

marler8997 avatar Jan 08 '21 18:01 marler8997

I have written a library that does just this. It is truemedian/zfetch.

It only requires:

So we're fairly close to this goal.

truemedian avatar Jan 11 '21 23:01 truemedian

Ok, I think the tentative plan then is to write a script/tool to compile zigup for the same set of platforms that Zig supports, then creates a set of archives that can be uploaded into a zigup release on github.

Would setting up CI to build and upload artifacts for the short term be a possibility?

devins2518 avatar Jun 17 '21 00:06 devins2518

Would setting up CI to build and upload artifacts for the short term be a possibility?

Yes

marler8997 avatar Jun 17 '21 01:06 marler8997

Working on it rn :+1:

devins2518 avatar Jun 17 '21 01:06 devins2518