Go-check target in Makefile should use GO variable #6149

Closed
opened 2025-11-02 06:46:25 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @E14 on GitHub (Oct 14, 2020).

  • Gitea version (or commit ref): 1.12.5 (issue in source also exists in master at e4a3785218)

  • Git version: 2.7.4

  • Operating system: Ubuntu / Linux hostname 4.4.0-184-generic #214-Ubuntu SMP Thu Jun 4 10:14:11 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

  • Database (use [x]):

    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
    • Not relevant
  • Can you reproduce the bug at https://try.gitea.io:

    • Yes (provide example URL)
    • No
    • Not relevant
  • Log:

    Gitea requires Go 1.12 or greater to build. You can get it at https://golang.org/dl/
    Makefile:177: recipe for target 'go-check' failed
    make: *** [go-check] Error 1

Description

I use the GO environment variable to set the used go executable like this:

TAGS="sqlite bindata" GO="go1.15.2" make generate build

$(GO) is used everywhere as expected in the Makefile except the go-check target, so that target fails even though everything else succeeds.

The issue is here: e4a3785218/Makefile (L189)

This resolves the issue on gitea v1.12.5 for me:

index 095252e..13ca1b0 100644
--- a/Makefile
+++ b/Makefile
@@ -174,7 +174,7 @@ help:

 .PHONY: go-check
 go-check:
-       $(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell go version | grep -Eo '[0-9]+\.[0-9.]+' | tr '.' ' ');))
+       $(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell $(GO) version | grep -Eo '[0-9]+\.[0-9.]+' | tr '.' ' ');))
        @if [ "$(GO_VERSION)" -lt "$(MIN_GO_VERSION)" ]; then \
                echo "Gitea requires Go 1.12 or greater to build. You can get it at https://golang.org/dl/"; \
                exit 1; \
Originally created by @E14 on GitHub (Oct 14, 2020). - Gitea version (or commit ref): 1.12.5 (issue in source also exists in master at e4a3785218a0725f45b7bbb1bcaf1478a8310c6c) - Git version: 2.7.4 - Operating system: Ubuntu / `Linux hostname 4.4.0-184-generic #214-Ubuntu SMP Thu Jun 4 10:14:11 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux` - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - [x] Not relevant - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log: > Gitea requires Go 1.12 or greater to build. You can get it at https://golang.org/dl/ > Makefile:177: recipe for target 'go-check' failed > make: *** [go-check] Error 1 ## Description I use the `GO` environment variable to set the used `go` executable like this: ``` TAGS="sqlite bindata" GO="go1.15.2" make generate build ``` `$(GO)` is used everywhere as expected in the Makefile _except_ the `go-check` target, so that target fails even though everything else succeeds. The issue is here: https://github.com/go-gitea/gitea/blob/e4a3785218a0725f45b7bbb1bcaf1478a8310c6c/Makefile#L189 This resolves the issue on gitea v1.12.5 for me: ```patch index 095252e..13ca1b0 100644 --- a/Makefile +++ b/Makefile @@ -174,7 +174,7 @@ help: .PHONY: go-check go-check: - $(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell go version | grep -Eo '[0-9]+\.[0-9.]+' | tr '.' ' ');)) + $(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell $(GO) version | grep -Eo '[0-9]+\.[0-9.]+' | tr '.' ' ');)) @if [ "$(GO_VERSION)" -lt "$(MIN_GO_VERSION)" ]; then \ echo "Gitea requires Go 1.12 or greater to build. You can get it at https://golang.org/dl/"; \ exit 1; \ ```
GiteaMirror added the topic/build label 2025-11-02 06:46:25 -06:00
Author
Owner

@techknowlogick commented on GitHub (Oct 14, 2020):

Thanks for digging through that, would you be open to making a PR using that diff?

@techknowlogick commented on GitHub (Oct 14, 2020): Thanks for digging through that, would you be open to making a PR using that diff?
Author
Owner

@lunny commented on GitHub (Oct 15, 2020):

Closed by #13147

@lunny commented on GitHub (Oct 15, 2020): Closed by #13147
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6149