From 750cbc21e2640e1dcea11cae9485384f91fb5352 Mon Sep 17 00:00:00 2001 From: commiterate <111539270+commiterate@users.noreply.github.com> Date: Sun, 27 Apr 2025 17:40:50 -0400 Subject: [PATCH] gitlab-runner: Use substituteInPlace for patching and stop referencing src attributes --- pkgs/by-name/gi/gitlab-runner/package.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/gi/gitlab-runner/package.nix b/pkgs/by-name/gi/gitlab-runner/package.nix index 84cd6e835fbd..978f0a0a6f77 100644 --- a/pkgs/by-name/gi/gitlab-runner/package.nix +++ b/pkgs/by-name/gi/gitlab-runner/package.nix @@ -34,8 +34,9 @@ buildGoModule (finalAttrs: { # Remove some tests that can't work during a nix build # Needs the build directory to be a git repo - sed -i "s/func TestCacheArchiverAddingUntrackedFiles/func OFF_TestCacheArchiverAddingUntrackedFiles/" commands/helpers/file_archiver_test.go - sed -i "s/func TestCacheArchiverAddingUntrackedUnicodeFiles/func OFF_TestCacheArchiverAddingUntrackedUnicodeFiles/" commands/helpers/file_archiver_test.go + substituteInPlace commands/helpers/file_archiver_test.go \ + --replace-fail "func TestCacheArchiverAddingUntrackedFiles" "func OFF_TestCacheArchiverAddingUntrackedFiles" \ + --replace-fail "func TestCacheArchiverAddingUntrackedUnicodeFiles" "func OFF_TestCacheArchiverAddingUntrackedUnicodeFiles" rm shells/abstract_test.go # No writable developer environment @@ -56,11 +57,14 @@ buildGoModule (finalAttrs: { '' + lib.optionalString stdenv.buildPlatform.isDarwin '' # Invalid bind arguments break Unix socket tests - sed -i "s/func TestRunnerWrapperCommand_createListener/func OFF_TestRunnerWrapperCommand_createListener/" commands/wrapper_test.go + substituteInPlace commands/wrapper_test.go \ + --replace-fail "func TestRunnerWrapperCommand_createListener" "func OFF_TestRunnerWrapperCommand_createListener" # No keychain access during build breaks X.509 certificate tests - sed -i "s/func TestCertificate/func OFF_TestCertificate/" helpers/certificate/x509_test.go - sed -i "s/func TestClientInvalidSSL/func OFF_TestClientInvalidSSL/" network/client_test.go + substituteInPlace helpers/certificate/x509_test.go \ + --replace-fail "func TestCertificate" "func OFF_TestCertificate" + substituteInPlace network/client_test.go \ + --replace-fail "func TestClientInvalidSSL" "func OFF_TestClientInvalidSSL" ''; excludedPackages = [ @@ -79,7 +83,7 @@ buildGoModule (finalAttrs: { [ "-X ${ldflagsPackageVariablePrefix}.NAME=gitlab-runner" "-X ${ldflagsPackageVariablePrefix}.VERSION=${finalAttrs.version}" - "-X ${ldflagsPackageVariablePrefix}.REVISION=${finalAttrs.src.tag}" + "-X ${ldflagsPackageVariablePrefix}.REVISION=v${finalAttrs.version}" ]; preCheck = ''