Skip to content

Commit 7e596bd

Browse files
add timetzdata build tag to binary releases (go-gitea#33463)
`timetzdata` is already used in the docker images, this includes them for the binary release files too. Related to go-gitea#33235 (I don't have a windows machine setup to test this though) --------- Co-authored-by: wxiaoguang <[email protected]>
1 parent 6999651 commit 7e596bd

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

main_timezones.go

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2025 The Gitea Authors. All rights reserved.
2+
// SPDX-License-Identifier: MIT
3+
4+
//go:build windows
5+
6+
package main
7+
8+
// Golang has the ability to load OS's timezone data from most UNIX systems (https://github.com/golang/go/blob/master/src/time/zoneinfo_unix.go)
9+
// Even if the timezone data is missing, users could install the related packages to get it.
10+
// But on Windows, although `zoneinfo_windows.go` tries to load the timezone data from Windows registry,
11+
// some users still suffer from the issue that the timezone data is missing: https://github.com/go-gitea/gitea/issues/33235
12+
// So we import the tzdata package to make sure the timezone data is included in the binary.
13+
//
14+
// For non-Windows package builders, they could still use the "TAGS=timetzdata" to include the tzdata package in the binary.
15+
// If we decided to add the tzdata for other platforms, modify the "go:build" directive above.
16+
import _ "time/tzdata"

0 commit comments

Comments
 (0)