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

Download and register any supported Zig release for all supported platforms #72

Closed
Tracked by #1
aherrmann opened this issue Jun 4, 2023 · 4 comments
Closed
Tracked by #1

Comments

@aherrmann
Copy link
Owner

aherrmann commented Jun 4, 2023

Based on the Zig toolchain download index.

@aherrmann aherrmann mentioned this issue Jun 4, 2023
63 tasks
@Titousensei
Copy link
Contributor

How much work do you think is needed for that? Can you elaborate on what the implementation could be? rules_zig currently uses 0.10.1, while the latest stable is 0.11.0 and 0.12-dev fixes important bugs and adds interesting features. It would be nice to be able to stay up-to-date with the compiler.

@aherrmann
Copy link
Owner Author

Hi @Titousensei,

I think this could be done in a couple phases. Not all the features I have in mind would be needed for simply using a different release.

The rules zig_repositories and toolchains_repo need to be adapted: They could take in a toolchain index file next to the requested version number. They could then read and parse the JSON file, check if the requested version is in there, and then read the supported exec platforms, URLs, SHAs from that data. That requires a couple changes to both those rules. toolchains_repo is currently mostly in its original form taken from the rules-template, and that assumes that all toolchain versions support the same platforms. That is not the case across all Zig versions. However, it may be a good enough assumption for the versions you care about. In that case this concern can be ignored for a first version of this feature.

A default value for the toolchain index could be downloaded and checked into the rules_zig repository. In that case the master part should be stripped as it is too volatile to check in. To keep this file up-to-date some GH actions automation would be nice, but can be done later.

The question of -dev releases is out of scope for this issue and instead covered by #76. That said, for a specific use-site it could be handled with the above approach with a custom toolchain index file that includes the desired -dev release and is checked in or downloaded at the use-site.

@aherrmann aherrmann changed the title Download and register any Zig release for all supported platforms Download and register any supported Zig release for all supported platforms Feb 18, 2024
@aherrmann
Copy link
Owner Author

I'm changing the scope of this ticket to only cover every supported Zig release. The Zig CLI changes drastically between Zig releases, so that it is pointless to offer arbitrary Zig versions for download, since the rules would not be able to handle unsupported versions anyway.
The facilities to support multiple Zig versions to choose from exist already. It's just that the list of supported versions is currently limited to 0.11.0.

@aherrmann
Copy link
Owner Author

@Titousensei #290 adds support to fetch and register arbitrary Zig releases, including nightly builds. See PR description for further details.

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

2 participants