asdf-community / asdf-zig

Zig plugin for the asdf version manager
https://github.com/asdf-vm/asdf
Apache License 2.0
48 stars 12 forks source link

Include nightly versions #4

Open codethief opened 1 year ago

codethief commented 1 year ago

The Bash script retrieves https://ziglang.org/download/index.json, which lists the current v11.0-dev.* nightly versions. However, when I run asdf list all zig I only see the stable versions (0.1.1 through 0.10.1).

Could this be changed to also include nightly versions?

Unfortunately, I can't really tell where in the script the filtering happens, otherwise I'd change it myself.

jhcl commented 1 year ago

When I run the same command (asdf list all zig) I see 0.2.0 through 0.10.1 and master.
asdf install zig master gives me version 0.11.0-dev.1884+2641feb9b.

neodon commented 1 year ago

I like being able to easily install the latest nightly build version with asdf install zig master, so thank you for adding that.

I think it would still be useful to have individual nightly build versions installable with asdf. For some additional context, the recommended way to use zig (aside from evaluation) is to use a nightly build.

Since nightly builds can change a lot, and some can have major problems, it makes sense to be able to pin specific nightly build versions for different projects. I'm currently doing this with vendoring, but I'd much rather use asdf and .tool-versions.

One potential issue is that adding nightly build versions to this plugin would result in a long version list after a while, since there will be one for each day. I'm not sure how much of a problem this could become, depending on when zig starts using a better release process.

Additional thoughts? Are you open to a pull request?

jhcl commented 1 year ago
neodon commented 1 year ago

Pardon my confusion in assuming you were the repo owner. Also good callout on what repo asdf is actually using for zig.

tobyhinloopen commented 1 year ago

yeah i wish master was included in list-all. Eventually I found out you can just install master. The list-all function uses only "numeric-like" versions from https://ziglang.org/download/index.json , but you can actually install any version from that JSON page.

  "master": { // << what you need to install
    "version": "0.11.0-dev.2546+cb54e9a3c", // << what you get

Source:

We have a HTTP server now 🥳

https://ziglang.org/documentation/master/std/#A;std:http.Server

chenrui333 commented 10 months ago

Any luck with this thread?