diff options
author | techknowlogick <techknowlogick@gitea.com> | 2025-02-04 23:17:08 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-05 04:17:08 +0000 |
commit | 7e596bd7a9378cadbbd9efaf9cc622de554e056c (patch) | |
tree | bf13ad7cdcb995751ae94b756691ffcb95b37691 | |
parent | 6999651b6d9804c5372b5abc67892b7eb74861db (diff) | |
download | gitea-7e596bd7a9378cadbbd9efaf9cc622de554e056c.tar.gz gitea-7e596bd7a9378cadbbd9efaf9cc622de554e056c.zip |
add `timetzdata` build tag to binary releases (#33463)
`timetzdata` is already used in the docker images, this includes them
for the binary release files too.
Related to #33235 (I don't have a windows machine setup to test this
though)
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
-rw-r--r-- | main_timezones.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/main_timezones.go b/main_timezones.go new file mode 100644 index 0000000000..e1233007c6 --- /dev/null +++ b/main_timezones.go @@ -0,0 +1,16 @@ +// Copyright 2025 The Gitea Authors. All rights reserved. +// SPDX-License-Identifier: MIT + +//go:build windows + +package main + +// 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) +// Even if the timezone data is missing, users could install the related packages to get it. +// But on Windows, although `zoneinfo_windows.go` tries to load the timezone data from Windows registry, +// some users still suffer from the issue that the timezone data is missing: https://github.com/go-gitea/gitea/issues/33235 +// So we import the tzdata package to make sure the timezone data is included in the binary. +// +// For non-Windows package builders, they could still use the "TAGS=timetzdata" to include the tzdata package in the binary. +// If we decided to add the tzdata for other platforms, modify the "go:build" directive above. +import _ "time/tzdata" |