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

x/mobile: time.LoadLocation(): zoneinfo.zip: no such file or directory #13581

Closed
pierrre opened this issue Dec 11, 2015 · 6 comments
Closed

x/mobile: time.LoadLocation(): zoneinfo.zip: no such file or directory #13581

pierrre opened this issue Dec 11, 2015 · 6 comments

Comments

@pierrre
Copy link

pierrre commented Dec 11, 2015

What version of Go are you using (go version)?
1.5.2

What operating system and processor architecture are you using?
Nexus 6P

What did you do?

    loc, err := time.LoadLocation("GMT")
    if err != nil {
        panic(err)
    }
    fmt.Println(loc)

What did you expect to see?
GMT

What did you see instead?
panic: open /home/pierre/.gimme/versions/go1.5.2.src/lib/time/zoneinfo.zip: no such file or directory

@rsc
Copy link
Contributor

rsc commented Dec 28, 2015

/cc @crawshaw @hyangah

@rsc rsc added this to the Unreleased milestone Dec 28, 2015
@bfallik
Copy link

bfallik commented Jan 22, 2016

I'm hitting this panic using go 1.6.0 beta 2.

@pierrre
Copy link
Author

pierrre commented Jan 22, 2016

I also encountered the same problem with a "stratch" Docker image (not related to x/mobile).
The zoneinfo.zip file was missing. More info here: https://golang.org/pkg/time/#LoadLocation
It's easy to solve on Docker:

  • add zoneinfo.zip in the image (copy from $GOROOT/lib/time/zoneinfo.zip)
  • set the ZONEINFO env variable

But I don't know how to do that with x/mobile.
The list of scanned directories is: https://golang.org/src/time/zoneinfo_unix.go#L31
They don't exist on a mobile phone.
Can we embed zoneinfo.zip in the application package and override the ZONEINFO env variable with x/mobile?

@hyangah
Copy link
Contributor

hyangah commented Jan 22, 2016

In android zoneinfo file is located in a different location, and moreover, it's in a format that we currently don't support yet (as hinted in cl/10299). Does anyone know where to find the spec of this format?

One can embed zoneinfo.zip file as an asset, but setting ZONEINFO env var seems tricky because afaik asset cannot be accessed through file path like a regular file, and reading of ZONEINFO env var happens pretty early (see src/time/zoneinfo.go).

@bfallik
Copy link

bfallik commented Jan 22, 2016

My encounter was also inside a minimal Docker image so not related to x/mobile. Sorry for the noise but thanks for the tips on how I can address this.

@pierrre
Copy link
Author

pierrre commented Aug 23, 2016

Thank you!

@golang golang locked and limited conversation to collaborators Aug 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants