From 159bd4a55c6d39b70f5b720ed60f950cb6f0927b Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Thu, 30 May 2024 23:01:34 -0500 Subject: user/gitlab-runner: Update to 14.0.0 Still broken. --- user/gitlab-runner/APKBUILD | 18 ++- user/gitlab-runner/disable-crap.patch | 7 +- user/gitlab-runner/fix-multiple-redef-seek.patch | 18 --- user/gitlab-runner/gccgo.patch | 55 +++++---- user/gitlab-runner/posix-shell-escape.patch | 139 ----------------------- user/gitlab-runner/posix-shell.patch | 25 ++-- user/gitlab-runner/tests.patch | 28 +---- 7 files changed, 56 insertions(+), 234 deletions(-) delete mode 100644 user/gitlab-runner/posix-shell-escape.patch (limited to 'user') diff --git a/user/gitlab-runner/APKBUILD b/user/gitlab-runner/APKBUILD index be866b6fb..828791646 100644 --- a/user/gitlab-runner/APKBUILD +++ b/user/gitlab-runner/APKBUILD @@ -1,7 +1,7 @@ # Contributor: Max Rees # Maintainer: Zach van Rijn pkgname=gitlab-runner -pkgver=13.0.0 +pkgver=14.0.0 pkgrel=0 _testver=91956efe _branch="${pkgver%.*}" @@ -25,7 +25,6 @@ source="https://gitlab.com/gitlab-org/gitlab-runner/-/archive/v$pkgver/gitlab-ru disable-crap.patch gccgo.patch posix-shell.patch - posix-shell-escape.patch tests.patch fix-multiple-redef-seek.patch " @@ -42,7 +41,7 @@ _make() { } build() { - _make build_simple + _make runner-bin } check() { @@ -77,13 +76,12 @@ package() { "$pkgdir"/etc/init.d/$pkgname } -sha512sums="0705dc0a5af83e0f1b6da8b95512afa7727c65f71630b7d2410c7c34feacfaf6b0e7958751fbf7f651400cb0d2efdbc208d9f3f44dd69209266038ea67c15e65 gitlab-runner-v13.0.0.tar.gz +sha512sums="c31cdfa2e090f8b1c262b8ce9e813cf8f6fd3f32aee997909b7ba2d892f484be50554ca01908d99d973ee0cdbeea4fd270b25b77a9739f4d4f002fc9e8b8c3ac gitlab-runner-v14.0.0.tar.gz 7bccab81aa1cb88c6a0f83a6d3dfc509e6f9ecb4d0168a5b30cc4e8fdd823294b95fe3633e09757905466f83bb3bf73b1d28fac475dff2dc3164604db4b5b995 gitlab-test-91956efe.tar.gz f8a0c7e77cd563d7e5b4fb2319181ceab8de44c555cefa4803e985ad3ac6a9fea7bca469d80b28974edcfb65f2095d019bfdf0abd8a3221464276a8d89debc0d gitlab-runner.confd 7f785a65b46919f6a6695e25fdc414ee3204eb9aa1a3735e7884575434af94b20a48f2fe7a1fb787473de23a7bd2d56bc1e9c1fc6b522c6f0c05c47b3d37ab1c gitlab-runner.initd -a32b7a6fa28c7f5bcb505308e615f17de179c15ce8c2ef73078143204195e36d99b18489114ce694c3d821378c1e9ccb26a999a50372b97df163e2512080f07e disable-crap.patch -081c5a33332aecc9bb138f8dd56a7c7d4e0a8d78e0ee30dfadee5c58c4033e1a42cedf81813adc0070b60a1ae1cb927605d690710d0def914904fd5ce664f2ae gccgo.patch -fecb4534c2dfa9502cc852177187fc57742dbdf33a6152d98eb95f372ef931559edf3e00a339b583d40a8c65b2ea778b052ca753383418de98b28e03a5c833c9 posix-shell.patch -05d12046448c79a12bf92974089ff97781304083f7bf35abb0b0c0f990c536bd6ff51652e16035a38e4ba5620dcad6e051ecdf4a80eb62039a15371073e525b5 posix-shell-escape.patch -0e3062e3840b325de7a4be7f16aa28a6d0c75b1358342d7bff8cde027c02a869ce96bb510396af78a41c8b2231deb9820ed49e3db2768aa365b9773b6afef8dd tests.patch -693d3abd94a85be70337bdfcbc3c643d65b95991689e085c573a793e4568f71966e398be960fd6bd985481613a1b85c459af814f83396d23e773afeee956b9f3 fix-multiple-redef-seek.patch" +92206937f62d79a0dadcc7d666af7f2bd08c53b60db9a12a1a6625af5cd6196a026f68b7bfe90f57b71ce4b6121a3ed5507ec2016290eaf3599a86d2fa545055 disable-crap.patch +f01dc1f28d003181380d9a0786d156f75572c954e37b527456865db6facffaf2d28a14a984aeef2589a359577cb9a1dffbf9a885ed2cd446dd0bd98e32ed2454 gccgo.patch +05c12698a7929ed9596e1bb9297588362e5e04e7ad18b64fdab3f3bf2ba39281d658394e1b03dcdd3c1bc5c4c803e608b7c6c92dc6320bd057915a0a7543af4d posix-shell.patch +baafaa0b66d8e5deff1b8c02e9cc6ce8f1f938be49caecb2aabcd1ea4fc8c967ac3b66af784d1508574cbffa3721f17644d560cb5caafd6873b9b966532c52bd tests.patch +f2738a531f3db99787ae9e9ec84d5d8d790065e6a56c4170828be06137615829a8908c841103291008a76adc3c1faa1d0f7b6cfb71c68b23b58cf182a0de9c5b fix-multiple-redef-seek.patch" diff --git a/user/gitlab-runner/disable-crap.patch b/user/gitlab-runner/disable-crap.patch index b375934fc..716697b94 100644 --- a/user/gitlab-runner/disable-crap.patch +++ b/user/gitlab-runner/disable-crap.patch @@ -1,9 +1,10 @@ --- gitlab-runner-v12.1.0/main.go 2019-07-19 12:13:32.000000000 +0000 +++ gitlab-runner-v12.1.0/main.go 2020-03-04 22:28:31.741878923 +0000 -@@ -11,18 +11,11 @@ import ( - "gitlab.com/gitlab-org/gitlab-runner/helpers/cli" +@@ -11,19 +11,11 @@ import ( + cli_helpers "gitlab.com/gitlab-org/gitlab-runner/helpers/cli" "gitlab.com/gitlab-org/gitlab-runner/log" +- _ "gitlab.com/gitlab-org/gitlab-runner/cache/azure" - _ "gitlab.com/gitlab-org/gitlab-runner/cache/gcs" - _ "gitlab.com/gitlab-org/gitlab-runner/cache/s3" _ "gitlab.com/gitlab-org/gitlab-runner/commands" @@ -16,6 +17,6 @@ _ "gitlab.com/gitlab-org/gitlab-runner/executors/shell" _ "gitlab.com/gitlab-org/gitlab-runner/executors/ssh" - _ "gitlab.com/gitlab-org/gitlab-runner/executors/virtualbox" + _ "gitlab.com/gitlab-org/gitlab-runner/helpers/secrets/resolvers/vault" _ "gitlab.com/gitlab-org/gitlab-runner/shells" ) - diff --git a/user/gitlab-runner/fix-multiple-redef-seek.patch b/user/gitlab-runner/fix-multiple-redef-seek.patch index 5a9d1ef10..e417f84c7 100644 --- a/user/gitlab-runner/fix-multiple-redef-seek.patch +++ b/user/gitlab-runner/fix-multiple-redef-seek.patch @@ -1,21 +1,3 @@ -diff -ur a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go ---- a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go 2023-01-04 02:17:18.689781320 +0000 -+++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go 2023-01-04 02:19:46.688219811 +0000 -@@ -45,7 +45,13 @@ - - // Underlying system call writes to newoffset via pointer. - // Implemented in assembly to avoid allocation. --func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) -+func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { -+ var newoffset int64 -+ offsetLow := uint32(offset & 0xffffffff) -+ offsetHigh := uint32((offset >> 32) & 0xffffffff) -+ _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) -+ return newoffset, err -+} - - func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { - newoffset, errno := seek(fd, offset, whence) diff -ur a/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go --- a/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go 2023-01-04 02:17:18.689781320 +0000 +++ b/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go 2023-01-04 02:20:04.283558738 +0000 diff --git a/user/gitlab-runner/gccgo.patch b/user/gitlab-runner/gccgo.patch index 106a36a42..bd0b7a3d5 100644 --- a/user/gitlab-runner/gccgo.patch +++ b/user/gitlab-runner/gccgo.patch @@ -12,48 +12,45 @@ BUILT := $(shell date -u +%Y-%m-%dT%H:%M:%S%z) -export TESTFLAGS ?= -cover - LATEST_STABLE_TAG := $(shell git -c versionsort.prereleaseSuffix="-rc" -c versionsort.prereleaseSuffix="-RC" tag -l "v*.*.*" --sort=-v:refname | awk '!/rc/' | head -n 1) + LATEST_STABLE_TAG := $(shell git -c versionsort.prereleaseSuffix="-rc" -c versionsort.prereleaseSuffix="-RC" tag -l "v*.*.*" | sort -rV | awk '!/rc/' | head -n 1) export IS_LATEST := -@@ -36,14 +35,11 @@ export PATH := $(GOPATH_BIN):$(PATH) +@@ -35,14 +34,11 @@ export PATH := $(GOPATH_BIN):$(PATH) + BUILD_DIR := $(CURDIR) + TARGET_DIR := $(BUILD_DIR)/out - # Packages in vendor/ are included in ./... - # https://github.com/golang/go/issues/11659 --export OUR_PACKAGES ?= $(subst _$(BUILD_DIR),$(PKG),$(shell go list ./... | grep -v '/vendor/')) -+export OUR_PACKAGES ?= $(subst _$(BUILD_DIR),$(PKG),$(shell go list ./... | grep -ve '/vendor/' -e '/cache/gcs' -e '/cache/s3' -e '/docker' -e '/kubernetes' -e '/parallels' -e '/virtualbox')) + export MAIN_PACKAGE ?= gitlab.com/gitlab-org/gitlab-runner -GO_LDFLAGS ?= -X $(COMMON_PACKAGE_NAMESPACE).NAME=$(PACKAGE_NAME) -X $(COMMON_PACKAGE_NAMESPACE).VERSION=$(VERSION) \ - -X $(COMMON_PACKAGE_NAMESPACE).REVISION=$(REVISION) -X $(COMMON_PACKAGE_NAMESPACE).BUILT=$(BUILT) \ - -X $(COMMON_PACKAGE_NAMESPACE).BRANCH=$(BRANCH) \ -- -s -w -+GO_LDFLAGS ?= -s -w +- -w ++GO_LDFLAGS ?= -w GO_FILES ?= $(shell find . -name '*.go') -export CGO_ENABLED ?= 0 +export CGO_ENABLED ?= 1 # Development Tools -@@ -112,7 +108,7 @@ build_current: helper-docker build_simpl - check_race_conditions: - @./scripts/check_race_conditions $(OUR_PACKAGES) - --test: helper-docker development_setup simple-test -+test: simple-test - +@@ -136,7 +132,7 @@ build_current: helper-docker build_simpl + simple-test: TEST_PKG ?= $(shell go list ./...) simple-test: - go test $(OUR_PACKAGES) $(TESTFLAGS) + # use env -i to clear parent environment variables for go test +- ./scripts/go_test_no_env $(TEST_PKG) $(TESTFLAGS) -ldflags "$(GO_LDFLAGS)" ++ ./scripts/go_test_no_env $(TEST_PKG) $(TESTFLAGS) -gccgoflags "$(GO_LDFLAGS)" + + git1.8-test: export TEST_PKG = gitlab.com/gitlab-org/gitlab-runner/executors/shell gitlab.com/gitlab-org/gitlab-runner/shells + git1.8-test: --- gitlab-runner-v13.0.0/Makefile.build.mk.old 2020-05-20 03:10:39.000000000 -0500 +++ gitlab-runner-v13.0.0/Makefile.build.mk 2024-05-30 22:18:11.590776424 -0500 -@@ -9,8 +9,8 @@ - - build_simple: - # Building $(NAME) in version $(VERSION) for current platform -- go build \ -- -ldflags "$(GO_LDFLAGS)" \ +@@ -1,6 +1,5 @@ + runner-bin: $(GOX) + # Building $(NAME) in version $(VERSION) for $(BUILD_PLATFORMS) +- $(GOX) $(BUILD_PLATFORMS) \ +- -ldflags "$(GO_LDFLAGS)" \ +- -output="out/binaries/$(NAME)-{{.OS}}-{{.Arch}}" \ + go build -v \ -+ -gccgoflags "$(GO_LDFLAGS)" \ - -o "$(RUNNER_BINARY)" \ - $(PKG) - ++ -gccgoflags "$(GO_LDFLAGS)" \ + $(PKG) --- gitlab-runner-v12.1.0/common/version.go 2019-07-19 12:13:32.000000000 +0000 +++ gitlab-runner-v12.1.0/common/version.go 2020-04-27 00:57:04.923408027 +0000 @@ -9,9 +9,9 @@ import ( @@ -63,9 +60,9 @@ -var VERSION = "development version" -var REVISION = "HEAD" -var BRANCH = "HEAD" -+var VERSION = "13.0.0" -+var REVISION = "v13.0.0" -+var BRANCH = "13-0-stable" ++var VERSION = "14.0.0" ++var REVISION = "v14.0.0" ++var BRANCH = "14-0-stable" var BUILT = "unknown" var AppVersion AppVersionInfo diff --git a/user/gitlab-runner/posix-shell-escape.patch b/user/gitlab-runner/posix-shell-escape.patch deleted file mode 100644 index b454141ed..000000000 --- a/user/gitlab-runner/posix-shell-escape.patch +++ /dev/null @@ -1,139 +0,0 @@ ---- gitlab-runner-v12.1.0/helpers/shell_escape.go 2019-07-19 12:13:32.000000000 +0000 -+++ gitlab-runner-v12.1.0/helpers/shell_escape.go 2020-04-26 23:12:59.813309281 +0000 -@@ -4,7 +4,6 @@ package helpers - - import ( - "bytes" -- "encoding/hex" - "strings" - ) - -@@ -13,35 +12,10 @@ import ( - */ - - const ( -- ACK = 6 -- TAB = 9 -- LF = 10 -- CR = 13 -- US = 31 -- SPACE = 32 -- AMPERSTAND = 38 - SINGLE_QUOTE = 39 -- PLUS = 43 -- NINE = 57 -- QUESTION = 63 -- LOWERCASE_Z = 90 -- OPEN_BRACKET = 91 - BACKSLASH = 92 -- UNDERSCORE = 95 -- CLOSE_BRACKET = 93 -- BACKTICK = 96 -- TILDA = 126 -- DEL = 127 - ) - --// ShellEscape is taken from https://github.com/solidsnack/shell-escape/blob/master/Text/ShellEscape/Bash.hs --/* --A Bash escaped string. The strings are wrapped in @$\'...\'@ if any --bytes within them must be escaped; otherwise, they are left as is. --Newlines and other control characters are represented as ANSI escape --sequences. High bytes are represented as hex codes. Thus Bash escaped --strings will always fit on one line and never contain non-ASCII bytes. --*/ - func ShellEscape(str string) string { - if str == "" { - return "''" -@@ -50,85 +24,20 @@ func ShellEscape(str string) string { - out := bytes.NewBuffer(make([]byte, 0, len(str)*2)) - i := 0 - l := len(in) -- escape := false -- -- hex := func(char byte) { -- escape = true -- -- data := []byte{BACKSLASH, 'x', 0, 0} -- hex.Encode(data[2:], []byte{char}) -- out.Write(data) -- } -- -- backslash := func(char byte) { -- escape = true -- out.Write([]byte{BACKSLASH, char}) -- } -- -- escaped := func(str string) { -- escape = true -- out.WriteString(str) -- } -- -- quoted := func(char byte) { -- escape = true -- out.WriteByte(char) -- } -- -- literal := func(char byte) { -- out.WriteByte(char) -- } - -+ out.WriteByte(SINGLE_QUOTE) - for i < l { - char := in[i] -- switch { -- case char == TAB: -- escaped(`\t`) -- case char == LF: -- escaped(`\n`) -- case char == CR: -- escaped(`\r`) -- case char <= US: -- hex(char) -- case char <= AMPERSTAND: -- quoted(char) -- case char == SINGLE_QUOTE: -- backslash(char) -- case char <= PLUS: -- quoted(char) -- case char <= NINE: -- literal(char) -- case char <= QUESTION: -- quoted(char) -- case char <= LOWERCASE_Z: -- literal(char) -- case char == OPEN_BRACKET: -- quoted(char) -- case char == BACKSLASH: -- backslash(char) -- case char <= CLOSE_BRACKET: -- quoted(char) -- case char == UNDERSCORE: -- literal(char) -- case char <= BACKTICK: -- quoted(char) -- case char <= TILDA: -- quoted(char) -- case char == DEL: -- hex(char) -- default: -- hex(char) -+ if (char == SINGLE_QUOTE) { -+ out.Write([]byte{SINGLE_QUOTE, BACKSLASH, SINGLE_QUOTE, SINGLE_QUOTE}) -+ } else { -+ out.WriteByte(char) - } - i++ - } -+ out.WriteByte(SINGLE_QUOTE) - -- outStr := out.String() -- -- if escape { -- outStr = "$'" + outStr + "'" -- } -- -- return outStr -+ return out.String() - } - - func ToBackslash(path string) string { diff --git a/user/gitlab-runner/posix-shell.patch b/user/gitlab-runner/posix-shell.patch index 06f1732e6..60eab1464 100644 --- a/user/gitlab-runner/posix-shell.patch +++ b/user/gitlab-runner/posix-shell.patch @@ -1,30 +1,35 @@ --- gitlab-runner-v12.1.0/shells/bash.go 2019-07-19 12:13:32.000000000 +0000 +++ gitlab-runner-v12.1.0/shells/bash.go 2020-04-26 23:07:57.303304498 +0000 -@@ -102,12 +102,12 @@ func (b *BashWriter) Variable(variable c +@@ -116,12 +116,12 @@ func (b *BashWriter) Variable(variable c } func (b *BashWriter) IfDirectory(path string) { -- b.Line(fmt.Sprintf("if [[ -d %q ]]; then", path)) -+ b.Line(fmt.Sprintf("if [ -d %q ]; then", path)) +- b.Linef("if [[ -d %q ]]; then", path) ++ b.Linef("if [ -d %q ]; then", path) b.Indent() } func (b *BashWriter) IfFile(path string) { -- b.Line(fmt.Sprintf("if [[ -e %q ]]; then", path)) -+ b.Line(fmt.Sprintf("if [ -e %q ]; then", path)) +- b.Linef("if [[ -e %q ]]; then", path) ++ b.Linef("if [ -e %q ]; then", path) b.Indent() } -@@ -213,9 +213,10 @@ +@@ -233,15 +233,15 @@ + func (b *BashWriter) writeEval(w io.Writer) { +- command := ": | eval " + helpers.ShellEscape(b.String()) + "\n" ++ command := "(\nexec /dev/null 2>/dev/null; then`+"\n", writer.String()) + assert.Equal(t, `if 'foo' "x&(y)" >/dev/null 2>/dev/null; then`+"\n", writer.String()) } ---- gitlab-runner-v12.1.0/executors/shell/shell_integration_test.go 2019-07-19 12:13:32.000000000 +0000 -+++ gitlab-runner-v12.1.0/executors/shell/shell_integration_test.go 2020-04-27 00:01:12.813355024 +0000 -@@ -166,7 +166,7 @@ func TestBuildAbort(t *testing.T) { - defer abortTimer.Stop() - - err = buildtest.RunBuild(t, build) -- assert.EqualError(t, err, "aborted: interrupt") -+ assert.EqualError(t, err, "aborted: Interrupt") - }) - } - ---- gitlab-runner-v12.1.0/executors/custom/integration_test.go 2019-07-19 12:13:32.000000000 +0000 -+++ gitlab-runner-v12.1.0/executors/custom/integration_test.go 2020-04-27 00:00:42.493354545 +0000 -@@ -237,7 +237,7 @@ func TestBuildAbort(t *testing.T) { - defer abortTimer.Stop() - - err = buildtest.RunBuild(t, build) -- assert.EqualError(t, err, "aborted: interrupt") -+ assert.EqualError(t, err, "aborted: Interrupt") - }) - } - --- gitlab-runner-v12.1.0/helpers/shell_escape_test.go 2019-07-19 12:13:32.000000000 +0000 +++ gitlab-runner-v12.1.0/helpers/shell_escape_test.go 2020-04-27 00:02:36.213356343 +0000 -@@ -24,8 +24,8 @@ func TestShellEscape(t *testing.T) { +@@ -26,8 +26,8 @@ func TestShellEscape(t *testing.T) { in string out string }{ @@ -52,7 +30,7 @@ --- gitlab-runner-v12.1.0/common/build_test.go 2019-07-19 12:13:32.000000000 +0000 +++ gitlab-runner-v12.1.0/common/build_test.go 2020-04-27 00:23:35.173376249 +0000 -@@ -1190,7 +1190,7 @@ func TestWaitForTerminal(t *testing.T) { +@@ -1224,7 +1224,7 @@ func TestWaitForTerminal(t *testing.T) { }, jobTimeout: 3600, waitForTerminalTimeout: time.Hour, -- cgit v1.2.3-70-g09d2