Skip to content
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

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

Open
mcandre opened this issue Dec 8, 2020 · 17 comments
Open

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

mcandre opened this issue Dec 8, 2020 · 17 comments

Comments

@mcandre
Copy link

mcandre commented Dec 8, 2020

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.

@marler8997
Copy link
Owner

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?

@Nomy1
Copy link

Nomy1 commented Jan 8, 2021

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

@marler8997
Copy link
Owner

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

@truemedian
Copy link
Contributor

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

It only requires:

So we're fairly close to this goal.

@devins2518
Copy link
Contributor

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?

@marler8997
Copy link
Owner

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

Yes

@devins2518
Copy link
Contributor

Working on it rn 👍

@jiacai2050
Copy link

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.

@marler8997 Hi, I create a libcurl binding for Zig, it already support static build, I wonder if you are interested at adopting it?

@marler8997
Copy link
Owner

Zigup is actually using the https client in std now, static builds have been solved.

@jiacai2050
Copy link

Thanks for clarifying.

However the http client in std only supports 1.1, and doesn't support proxy, and in my experience it is not very stable.

So I think it's worth trying?

@truemedian
Copy link
Contributor

HTTP 1.1 is by far the most supported version of HTTP, std.http does support HTTP and HTTPS proxies, and std.http.Client is relatively stable. So I'm not exactly sure what going back to depending on libcurl would add outside of a wider range of support for less common (likely primarily enterprise) environments

@jiacai2050
Copy link

jiacai2050 commented Aug 7, 2024

HTTP 1.1 is by far the most supported version of HTTP

Agreed, but zig tarball already support HTTP2 downloads.

curl -I https://ziglang.org/download/0.13.0/zig-0.13.0.tar.xz
HTTP/2 200 
content-type: application/x-xz
content-length: 17220728

std.http does support HTTP and HTTPS proxies,

Glad to know this, however I usually use socks proxy. ziglang/zig#19717

and std.http.Client is relatively stable

I maybe wrong at this point, but when I try it last year, it hangs a few times, so I start to work on libcurl bindings, and a quick search show there are 15 open issues.

@marler8997
Copy link
Owner

One of the goals of Zigup is to assist the Zig language and its standard library by being a real tool that people use that excercies Zig itself. A handful of issues and Pull Requests have resulted from this project and it continues to serve as a good test of Zig's HTTPS implementation. This is the main reason Zigup is written in Zig. Before Zig had an HTTPS client, Zigup did use other backends such as OpenSSL, however now that we have everything written in Zig, I'm comfortable limiting the scope of Zigup to only include Zig code moving forward. If we are missing functionality, it serves as motivation to contribute to Zig.

@jiacai2050
Copy link

One of the goals of Zigup is to assist the Zig language and its standard library by being a real tool that people use that excercies Zig itself.

Totally make sense, I'm sure this project will benefit the Zig ecosystem a lot.

So we can close this issue?

@marler8997
Copy link
Owner

this issue is for a curl-based pre-compiled zig-less installation, which is still ongoing

@jiacai2050
Copy link

I'm a little confused, the website has already commands to download zigup binary after select OS and arch, so what is still missing?

@marler8997
Copy link
Owner

Needs to be tested and probably need a few more options for windows/macos?

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

No branches or pull requests

6 participants