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

ability to roll zig major version without causing problems for downstream users #350

Closed
andrewrk opened this issue May 1, 2017 · 4 comments
Labels
breaking Implementing this issue could cause existing code to no longer compile or have different behavior. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone

Comments

@andrewrk
Copy link
Member

andrewrk commented May 1, 2017

Here's how this is going to work:

Applications and libraries must specify which Zig major version they are targeting. When Zig 1.0.0 comes out, there will only be 1 value possible for this, which is 1. But when 2.0.0 comes out, you can choose 1 or 2.

When Zig 2.0.0 ships, it ships with a copy of the standard library from the latest 1.x.y series, and the compiler itself knows how to parse and analyze 1.0.0 code differently than 2.0.0, and so on for the rest of the major version releases.

And that's it, that's the whole plan.

It'll be possible to have an application which needs zig version 3.x.y depend on a package which needs zig version 1.x.y which depends on a package which needs zig version 2.x.y. However, it will be better to update to the newest version, because using copies of the standard library can bloat the application size.

So you would always want the newest zig release, and you'll continue to get consistent compilation behavior because of explicitly asking for a specific version when you build.

@andrewrk andrewrk added the enhancement Solving this issue will likely involve adding new logic or components to the codebase. label May 1, 2017
@andrewrk andrewrk added this to the 1.0.0 milestone May 1, 2017
@MasonRemaley
Copy link
Contributor

MasonRemaley commented May 1, 2017

This seems like a good solution--the only potential issue I can think of is if I'm a library author and Zig v2 comes out but doesn't break my Zig v1 library. Do I start targeting Zig v2 and bloat all of my current users's projects? Or do I leave it and bloat all future users?

If this seems like a real problem you could potentially allow people to specify multiple supported versions of Zig, but there would be some subtleties there around deciding which supported version to use when compiling. I think just using the most recent version supported by the library that's installed on the current machine might work?

@andrewrk
Copy link
Member Author

andrewrk commented May 1, 2017

In this situation, I expect library authors to immediately start targeting the new Zig version. The library's previous release is tagged with the previous Zig version, so code which depends on a particular release of the library continues to work, and we all want to try to get to the latest version of everything as soon as practical.

The agreed-upon version of Zig for purposes of not bloating is always the latest version.

@andrewrk andrewrk added the breaking Implementing this issue could cause existing code to no longer compile or have different behavior. label May 2, 2017
@andrewrk
Copy link
Member Author

With the way package management is proposed in #943, a zig 2.0.0 standard library could minimize bloat by detecting the presence of older versions and utilizing the compatible components.

@andrewrk andrewrk added proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. and removed enhancement Solving this issue will likely involve adding new logic or components to the codebase. labels Apr 30, 2019
@andrewrk andrewrk modified the milestones: 1.0.0, 0.7.0 Apr 15, 2020
@andrewrk
Copy link
Member Author

andrewrk commented Oct 9, 2020

Superseded by #6466

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Implementing this issue could cause existing code to no longer compile or have different behavior. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned.
Projects
None yet
Development

No branches or pull requests

2 participants