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

lib/time: move zoneinfo.zip to src/time/tzdata #46759

Open
FiloSottile opened this issue Jun 15, 2021 · 6 comments
Open

lib/time: move zoneinfo.zip to src/time/tzdata #46759

FiloSottile opened this issue Jun 15, 2021 · 6 comments

Comments

@FiloSottile
Copy link
Contributor

@FiloSottile FiloSottile commented Jun 15, 2021

I remember as a newcomer to be pretty confused by the top-level lib/ folder that didn't contain any library code. In the many years since, nothing but lib/time has been added to lib/.

As far as I understand, zoneinfo.zip exists so that if the GOROOT is available when the binary actually runs, time.LoadLocation will load it as the final fallback after checking system paths. (Relying on GOROOT at execution time is questionable, but not the point of this issue.)

When I mailed https://golang.org/cl/198062 there wasn't a clear place to move zoneinfo.zip, but after #38017 I think src/time/tzdata/ would be a natural place for it: if time/tzdata is imported, it gets embedded, and otherwise it will be searched under GOROOT as a fallback.

@FiloSottile FiloSottile added this to the Go1.18 milestone Jun 15, 2021
@gopherbot
Copy link

@gopherbot gopherbot commented Jun 15, 2021

Change https://golang.org/cl/198062 mentions this issue: lib/time: move to src/time/tzdata

@dmitshur
Copy link
Contributor

@dmitshur dmitshur commented Jun 15, 2021

Also see #43350.

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jun 15, 2021

I would not be surprised if moving these files breaks some people who trim their GOROOT. Of course, we may want to do it anyhow.

@FiloSottile
Copy link
Contributor Author

@FiloSottile FiloSottile commented Jun 16, 2021

Should Go 1.18 look in both $GOROOT/src/time/tzdata and $GOROOT/lib/time, or only the former? Do we want to support newer Go binaries running with an older GOROOT?

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Jun 17, 2021

My concern isn't that we should support an older GOROOT, it's that some people will install Go and then delete parts of GOROOT that they don't need. I don't know how likely this is.

@dmitshur
Copy link
Contributor

@dmitshur dmitshur commented Jul 15, 2021

Added early-in-cycle so this issue gets a reminder when the tree reopens. If we're going to do this, doing it earlier gives the greatest opportunity to find out what needs updating (outside of the Go project) and reverse course if we find out disruption is too significant. Based on information available in this issue so far, to me this change seems worth trying.

To reduce the risk of this contributing to a delay in the release schedule (CC @golang/release), it's possible to create and maintain (throughout the 1.18 cycle) a revert CL, to make it faster and safer to undo at any point before the final release, if case significant new findings come in very late in cycle.

CC @rsc as owner of package time, since this file is an internal component related to it.

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

Successfully merging a pull request may close this issue.

None yet
4 participants