-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Proposal: add zig_version
field to build.zig.zon
#23985
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
Comments
while this could provide some great dx in the meantime i think its worth pointing out that it will not be necessary post-1.0 and minimum_zig_version would go back to the one providing much more value. are you envisioning a warning printed during are you envisioning it treating master vs tagged releases any different? |
Once the language hits 1.0, Zig may still bump its version to reflect changes beyond just the language itself, like updates to the stdlib or tooling. If not, then we might eventually want a new field like Regarding warnings: I can imagine cases where this version info could help Zig guide users when something isn't working as expected, but I'd need to explore the implementation to say for sure. That said, the biggest DX improvements I had in mind come from making this new field required, which are:
An alternative solution to get the same benefits would be to make I haven't been able to come up with a use case that shows why we'd need to treat dev/release versions differently, so let me know if you think of any. |
if |
i interpreted |
Uh oh!
There was an error while loading. Please reload this page.
This issue proposes the field
zig_version
be added to build.zig.zon.zig_version
would specify the latest zig version that the project has been tested to work on. If a project goes to the effort of supporting multiple zig versions, it can indicate backward compatibility with the existingminimum_zig_version
field. This provides a mechanism for projects to report compatibility with multiple versions of zig, which is useful for both users and future tooling.In practice, I expect most projects to only use
zig_version
.minimum_zig_version
would be most useful for projects that have many other projects depending on them, where the effort to support multiple versions might be justified. For this reason I additionally propose thatzig_version
be a REQUIRED field for all projects moving forward andminimum_zig_version
be kept as OPTIONAL.P.S. the
zig_version
would not exclude compatibility with future zig versions, but, would serve as an indicator that you're in "uncharted waters" for that packageThe text was updated successfully, but these errors were encountered: