To clone the project locally, execute 'make build' and get the following error #12854

Closed
opened 2025-11-02 10:23:01 -06:00 by GiteaMirror · 10 comments
Owner

Originally created by @rnb3ds on GitHub (Apr 16, 2024).

Description

To clone the project locally, execute 'make build' and get the following error:

Running go generate... no required module provides package code.gitea.i; to add it: go get code.gitea.i make: *** [makefile:782: generate-go] Error 1

image

Gitea Version

master

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

My running environment:

win10、Git Bash、make 4.2、go 1.22

Database

None

Originally created by @rnb3ds on GitHub (Apr 16, 2024). ### Description To clone the project locally, execute 'make build' and get the following error: `Running go generate... no required module provides package code.gitea.i; to add it: go get code.gitea.i make: *** [makefile:782: generate-go] Error 1` ![image](https://github.com/go-gitea/gitea/assets/20226005/d9dc49f6-dace-4b52-b080-a9566616897e) ### Gitea Version master ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? My running environment: win10、Git Bash、make 4.2、go 1.22 ### Database None
GiteaMirror added the topic/build label 2025-11-02 10:23:01 -06:00
Author
Owner

@rnb3ds commented on GitHub (Apr 16, 2024):

Makefile is not modified, project new clone downloaded.

@rnb3ds commented on GitHub (Apr 16, 2024): Makefile is not modified, project new clone downloaded.
Author
Owner

@lunny commented on GitHub (Apr 16, 2024):

This is because windows command line has limitation for output. And since Gitea have more and more packages, GO_PACKAGES is too long.

@lunny commented on GitHub (Apr 16, 2024): This is because windows command line has limitation for output. And since Gitea have more and more packages, `GO_PACKAGES` is too long.
Author
Owner

@rnb3ds commented on GitHub (Apr 16, 2024):

This is because windows command line has limitation for output. And since Gitea have more and more packages, GO_PACKAGES is too long.

That's the reason. Thank you!

@rnb3ds commented on GitHub (Apr 16, 2024): > This is because windows command line has limitation for output. And since Gitea have more and more packages, `GO_PACKAGES` is too long. That's the reason. Thank you!
Author
Owner

@silverwind commented on GitHub (Apr 16, 2024):

According to https://stackoverflow.com/questions/3205027/maximum-length-of-command-line-string and https://learn.microsoft.com/en-US/troubleshoot/windows-client/shell-experience/command-line-string-limitation, command length limit is either 32k or 8k (cmd.exe) on Windows. I think we'd need to avoid passing so long command lines to really fix it.

@silverwind commented on GitHub (Apr 16, 2024): According to https://stackoverflow.com/questions/3205027/maximum-length-of-command-line-string and https://learn.microsoft.com/en-US/troubleshoot/windows-client/shell-experience/command-line-string-limitation, command length limit is either 32k or 8k (cmd.exe) on Windows. I think we'd need to avoid passing so long command lines to really fix it.
Author
Owner

@silverwind commented on GitHub (Apr 16, 2024):

So instead of passing almost all go files to go generate, I think we could pre-scan for //go:generate comments and only pass these.

Go generate scans the file for directives, which are lines of the form,

//go:generate command argument...

(note: no leading spaces and no space in "//go") where command
is the generator to be run, corresponding to an executable file
that can be run locally. It must either be in the shell path
(gofmt), a fully qualified path (/usr/you/bin/mytool), or a
command alias, described below.

@silverwind commented on GitHub (Apr 16, 2024): So instead of passing almost all go files to `go generate`, I think we could pre-scan for `//go:generate` comments and only pass these. > Go generate scans the file for directives, which are lines of the form, > > //go:generate command argument... > > (note: no leading spaces and no space in "//go") where command is the generator to be run, corresponding to an executable file that can be run locally. It must either be in the shell path (gofmt), a fully qualified path (/usr/you/bin/mytool), or a command alias, described below.
Author
Owner

@jolheiser commented on GitHub (Apr 16, 2024):

Wait why are we not already running go generate ./...?

@jolheiser commented on GitHub (Apr 16, 2024): Wait why are we not already running `go generate ./...`?
Author
Owner

@silverwind commented on GitHub (Apr 16, 2024):

https://github.com/go-gitea/gitea/pull/30529 should fix it. @rnb3ds can you try it?

@silverwind commented on GitHub (Apr 16, 2024): https://github.com/go-gitea/gitea/pull/30529 should fix it. @rnb3ds can you try it?
Author
Owner

@silverwind commented on GitHub (Apr 16, 2024):

Wait why are we not already running go generate ./...?

No idea but it seems to have some useless exclusion of certain test files, at least for vet.

@silverwind commented on GitHub (Apr 16, 2024): > Wait why are we not already running `go generate ./...`? No idea but it seems to have some useless exclusion of certain test files, at least for `vet`.
Author
Owner

@lunny commented on GitHub (Apr 17, 2024):

Wait why are we not already running go generate ./...?

No idea but it seems to have some useless exclusion of certain test files, at least for vet.

Because there are dependencies also include go generate when Gitea hasn't removed vendor directoy.

@lunny commented on GitHub (Apr 17, 2024): > > Wait why are we not already running `go generate ./...`? > > No idea but it seems to have some useless exclusion of certain test files, at least for `vet`. Because there are dependencies also include `go generate` when Gitea hasn't removed vendor directoy.
Author
Owner

@silverwind commented on GitHub (Apr 17, 2024):

We could alternative pass every known module that has go:generate statements, e.g.:

modules/charset/escape.go:4://go:generate go run invisible/generate.go -v -o ./invisible_gen.go
modules/charset/escape.go:6://go:generate go run ambiguous/generate.go -v -o ./ambiguous_gen.go ambiguous/ambiguous.json
modules/options/options_bindata.go:8://go:generate go run ../../build/generate-bindata.go ../../options options bindata.go
modules/templates/templates_bindata.go:8://go:generate go run ../../build/generate-bindata.go ../../templates templates bindata.go true
modules/migration/schemas_bindata.go:8://go:generate go run ../../build/generate-bindata.go ../../modules/migration/schemas migration bindata.go
modules/public/public_bindata.go:8://go:generate go run ../../build/generate-bindata.go ../../public public bindata.go true
@silverwind commented on GitHub (Apr 17, 2024): We could alternative pass every known module that has `go:generate` statements, e.g.: ``` modules/charset/escape.go:4://go:generate go run invisible/generate.go -v -o ./invisible_gen.go modules/charset/escape.go:6://go:generate go run ambiguous/generate.go -v -o ./ambiguous_gen.go ambiguous/ambiguous.json modules/options/options_bindata.go:8://go:generate go run ../../build/generate-bindata.go ../../options options bindata.go modules/templates/templates_bindata.go:8://go:generate go run ../../build/generate-bindata.go ../../templates templates bindata.go true modules/migration/schemas_bindata.go:8://go:generate go run ../../build/generate-bindata.go ../../modules/migration/schemas migration bindata.go modules/public/public_bindata.go:8://go:generate go run ../../build/generate-bindata.go ../../public public bindata.go true ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12854