bazel-contrib / bazel-contrib/rules_go
zoneinfo.zip not found building go code on Debian sid
- Dominant language
- Go
- Stars
- 1.5k
- Forks
- 760
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 12
Description
Copied from https://github.com/bazelbuild/bazel/issues/25172, I was asked to file this bug report here.
### Description of the bug:
When trying to build an application that uses go code using bazel 8 on a Debian sid (and bookworm) system I get the following error:
```console
ERROR: Traceback (most recent call last):
File "/home/brian/.cache/bazel/_bazel_brian/d79bf7373ff1581a7e2123fde6aa1a40/external/rules_go++go_sdk+sfp-next__host_0/BUILD.bazel", line 116, column 9, in
glob([
Error in glob: glob pattern 'lib/time/zoneinfo.zip' didn't match anything, but allow_empty is set to False (the default value of allow_empty can be set with --incompatible_disallow_empty_glob).
```
This comes from:
https://github.com/bazel-contrib/rules_go/blob/master/go/private/BUILD.sdk.bazel#L115-L121
If I try to search for packages in Debian that provide the `zoneinfo.zip` file I get nothing:
https://packages.debian.org/search?searchon=contents&keywords=zoneinfo.zip&mode=path&suite=unstable&arch=any
This is using the go package from Debian sid:
```console
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-==============================================
ii golang-1.22 1.22.11-1 all Go programming language compiler - metapackage
```
This seems to be a Debian specific issue. I have had reports that other distributions supply the `zoneinfo.zip` file and as such are fine. But Debian doesn't appear to supply this file with the go compiler.
Debian does not supply Bazel 8 (as far as I can tell anyway), so filing the report here.
### Which category does this issue belong to?
Rules API
### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Still trying to find a simple Bazel 8 go example to reproduce the issue, but so far without luck.
Basically just build any project that requires Bazel 8 and go on a Debian system should do it, I think.
### Which operating system are you running Bazel on?
Debian Sid
### What is the output of `bazel info release`?
release 8.0.1
### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.
_No response_
### What's the output of `git remote get-url origin; git rev-parse HEAD` ?
```text
```
### If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.
_No response_
### Have you found anything relevant by searching the web?
https://github.com/golang/go/issues/20969
https://github.com/golang/go/issues/34188
Same error but different because these don't involve bazel, it looks like bazel needs `zoneinfo.zip` and won't fallback to the system timezone database.
### Any other information, logs, or outputs that you want to share?
_No response_
Contributor guide
Research direction
Start with go/private/BUILD.sdk.bazel around lines 115-121 and reproduce the failure using Bazel 8.0.1 with Debian Sid's golang-1.22 package. Compare the expected zoneinfo.zip location with the Debian package contents and the referenced Go issues; done means a representative Go build no longer fails on the missing file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100