forgejo: fix checkPhase regression

This fixes a regression introduced in 5de92a8b79.

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
This commit is contained in:
emilylange
2025-10-17 21:31:40 +02:00
parent c3fb98e870
commit 98135ce14f
+5 -4
View File
@@ -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
}