gitlab-runner: Use `substituteInPlace` for patching and stop referencing `src` attributes (#402379)

authored by Gaétan Lepage and committed by GitHub d5880a65 647d34c0

+10 -6
+10 -6
pkgs/by-name/gi/gitlab-runner/package.nix
··· 34 # Remove some tests that can't work during a nix build 35 36 # Needs the build directory to be a git repo 37 - sed -i "s/func TestCacheArchiverAddingUntrackedFiles/func OFF_TestCacheArchiverAddingUntrackedFiles/" commands/helpers/file_archiver_test.go 38 - sed -i "s/func TestCacheArchiverAddingUntrackedUnicodeFiles/func OFF_TestCacheArchiverAddingUntrackedUnicodeFiles/" commands/helpers/file_archiver_test.go 39 rm shells/abstract_test.go 40 41 # No writable developer environment ··· 56 '' 57 + lib.optionalString stdenv.buildPlatform.isDarwin '' 58 # Invalid bind arguments break Unix socket tests 59 - sed -i "s/func TestRunnerWrapperCommand_createListener/func OFF_TestRunnerWrapperCommand_createListener/" commands/wrapper_test.go 60 61 # No keychain access during build breaks X.509 certificate tests 62 - sed -i "s/func TestCertificate/func OFF_TestCertificate/" helpers/certificate/x509_test.go 63 - sed -i "s/func TestClientInvalidSSL/func OFF_TestClientInvalidSSL/" network/client_test.go 64 ''; 65 66 excludedPackages = [ ··· 79 [ 80 "-X ${ldflagsPackageVariablePrefix}.NAME=gitlab-runner" 81 "-X ${ldflagsPackageVariablePrefix}.VERSION=${finalAttrs.version}" 82 - "-X ${ldflagsPackageVariablePrefix}.REVISION=${finalAttrs.src.tag}" 83 ]; 84 85 preCheck = ''
··· 34 # Remove some tests that can't work during a nix build 35 36 # Needs the build directory to be a git repo 37 + substituteInPlace commands/helpers/file_archiver_test.go \ 38 + --replace-fail "func TestCacheArchiverAddingUntrackedFiles" "func OFF_TestCacheArchiverAddingUntrackedFiles" \ 39 + --replace-fail "func TestCacheArchiverAddingUntrackedUnicodeFiles" "func OFF_TestCacheArchiverAddingUntrackedUnicodeFiles" 40 rm shells/abstract_test.go 41 42 # No writable developer environment ··· 57 '' 58 + lib.optionalString stdenv.buildPlatform.isDarwin '' 59 # Invalid bind arguments break Unix socket tests 60 + substituteInPlace commands/wrapper_test.go \ 61 + --replace-fail "func TestRunnerWrapperCommand_createListener" "func OFF_TestRunnerWrapperCommand_createListener" 62 63 # No keychain access during build breaks X.509 certificate tests 64 + substituteInPlace helpers/certificate/x509_test.go \ 65 + --replace-fail "func TestCertificate" "func OFF_TestCertificate" 66 + substituteInPlace network/client_test.go \ 67 + --replace-fail "func TestClientInvalidSSL" "func OFF_TestClientInvalidSSL" 68 ''; 69 70 excludedPackages = [ ··· 83 [ 84 "-X ${ldflagsPackageVariablePrefix}.NAME=gitlab-runner" 85 "-X ${ldflagsPackageVariablePrefix}.VERSION=${finalAttrs.version}" 86 + "-X ${ldflagsPackageVariablePrefix}.REVISION=v${finalAttrs.version}" 87 ]; 88 89 preCheck = ''