mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-05 12:54:02 +00:00
refactor!: remove go-git backend (#39487)
Removes the go-git backend so every build uses the git CLI backend. Its Windows performance advantage is gone, it lacks SHA-256 support, and it breaks repositories on Windows. The performance changes moved to https://github.com/go-gitea/gitea/pull/39526. Fixes https://github.com/go-gitea/gitea/issues/38359 Fixes https://github.com/go-gitea/gitea/issues/34694 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
+2
-24
@@ -13,12 +13,9 @@ RELEASE_PLATFORMS_DEFAULT=(
|
||||
freebsd/amd64
|
||||
)
|
||||
|
||||
RELEASE_PLATFORMS_GOGIT=(windows/amd64 windows/arm64)
|
||||
|
||||
build() {
|
||||
echo "building ${*} ..."
|
||||
local target="${1:?}"
|
||||
local variant="${2:-}"
|
||||
|
||||
local goos="${target%%/*}"
|
||||
local goarch="${target##*/}"
|
||||
@@ -28,21 +25,12 @@ build() {
|
||||
goarch="arm"
|
||||
fi
|
||||
|
||||
local tags="${RELEASE_TAGS}"
|
||||
local suffix
|
||||
if [[ "$variant" == "gogit" ]]; then
|
||||
tags="gogit${tags:+ ${tags}}"
|
||||
suffix="-gogit-${target//\//-}"
|
||||
else
|
||||
suffix="-${target//\//-}"
|
||||
fi
|
||||
|
||||
local output="${RELEASE_PATH_PREFIX}${suffix}"
|
||||
local output="${RELEASE_PATH_PREFIX}-${target//\//-}"
|
||||
local args=()
|
||||
if [[ "$goos" == "windows" ]]; then
|
||||
output="${output}.exe"
|
||||
fi
|
||||
args+=(-tags "$tags")
|
||||
args+=(-tags "$RELEASE_TAGS")
|
||||
args+=(-ldflags "$RELEASE_LDFLAGS")
|
||||
echo " args: ${args[*]}"
|
||||
echo " output: ${output}"
|
||||
@@ -61,16 +49,6 @@ main() {
|
||||
build "$target"
|
||||
fi
|
||||
done
|
||||
|
||||
# Only build with gogit for main-nightly, disable gogit for stable releases since there seems no real requirement for them.
|
||||
# If no real requirement (no user feedbacks), we can completely remove gogit support in the future.
|
||||
if [ "$VERSION" = "main-nightly" ]; then
|
||||
for target in "${RELEASE_PLATFORMS_GOGIT[@]}"; do
|
||||
if [[ -z "$platform" || "$target" == "$platform/"* ]]; then
|
||||
build "$target" "gogit"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -122,7 +122,7 @@ func main() {
|
||||
if os.Getenv("CI") != "" {
|
||||
// only lint for other platforms when in CI, to keep local lint fast
|
||||
_, _ = fmt.Fprintln(os.Stdout, "lint for windows ...")
|
||||
succeed = runCmd([]string{"GOOS=windows", "TAGS=gogit"}, "golangci-lint", append([]string{"run", "--build-tags=windows,gogit"}, os.Args[1:]...)) && succeed
|
||||
succeed = runCmd([]string{"GOOS=windows"}, "golangci-lint", append([]string{"run", "--build-tags=windows"}, os.Args[1:]...)) && succeed
|
||||
}
|
||||
|
||||
if !succeed {
|
||||
|
||||
Reference in New Issue
Block a user