From 98135ce14f3f23e69754beca69bfd915b2a62a1f Mon Sep 17 00:00:00 2001 From: emilylange Date: Fri, 17 Oct 2025 02:21:43 +0200 Subject: [PATCH] forgejo: fix `checkPhase` regression This fixes a regression introduced in 5de92a8b79f3e0c3fcf75de3c7b6e5e38890732f. Forgejo v13 made the GO_TEST_PACKAGES variable lazy in [1], which causes our custom show-backend-tests make target to return an empty string, which in turn causes our checkPhase to not run a single go test. To fix this, we need to slightly modify our custom make target to reference the newly introduced compute-go-test-packages target as a dependency. [1]: https://codeberg.org/forgejo/forgejo/pulls/9208 --- pkgs/by-name/fo/forgejo/generic.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/fo/forgejo/generic.nix b/pkgs/by-name/fo/forgejo/generic.nix index f2c0c7f8ddbd..1db5124e8fd5 100644 --- a/pkgs/by-name/fo/forgejo/generic.nix +++ b/pkgs/by-name/fo/forgejo/generic.nix @@ -105,11 +105,12 @@ buildGoModule rec { export ldflags+=" -X main.ForgejoVersion=$(GITEA_VERSION=${version} make show-version-api)" ''; + # expose and use the GO_TEST_PACKAGES var from the Makefile + # instead of manually copying over the entire list: + # https://codeberg.org/forgejo/forgejo/src/tag/v11.0.6/Makefile#L128 + # https://codeberg.org/forgejo/forgejo/src/tag/v13.0.0/Makefile#L290 preCheck = '' - # expose and use the GO_TEST_PACKAGES var from the Makefile - # instead of manually copying over the entire list: - # https://codeberg.org/forgejo/forgejo/src/tag/v7.0.4/Makefile#L124 - echo -e 'show-backend-tests:\n\t@echo ''${GO_TEST_PACKAGES}' >> Makefile + echo -e 'show-backend-tests:${lib.optionalString (lib.versionAtLeast version "13") " | compute-go-test-packages"}\n\t@echo ''${GO_TEST_PACKAGES}' >> Makefile getGoDirs() { make show-backend-tests }