Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rnb3ds opened this issue Apr 16, 2024 · 10 comments · Fixed by #30529
Closed

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

rnb3ds opened this issue Apr 16, 2024 · 10 comments · Fixed by #30529
Labels
topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile

Comments

@rnb3ds
Copy link

rnb3ds commented 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

@rnb3ds
Copy link
Author

rnb3ds commented Apr 16, 2024

Makefile is not modified, project new clone downloaded.

@lunny lunny added topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile and removed type/bug labels Apr 16, 2024
@lunny
Copy link
Member

lunny commented 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.

@rnb3ds
Copy link
Author

rnb3ds commented 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!

@silverwind
Copy link
Member

silverwind commented 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
Copy link
Member

silverwind commented 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.

@jolheiser
Copy link
Member

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

@silverwind
Copy link
Member

#30529 should fix it. @rnb3ds can you try it?

@silverwind
Copy link
Member

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.

@lunny
Copy link
Member

lunny commented 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.

@silverwind
Copy link
Member

silverwind commented 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

lunny pushed a commit that referenced this issue Apr 17, 2024
Fixes: #30512

I think this does mean those tools would run on a potential `vendor`
directory, but I'm not sure we really support vendoring of dependencies
anymore.

`release` has a `vendor` prerequisite so likely the source tarballs
contain vendor files?
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Apr 17, 2024
Fixes: go-gitea#30512

I think this does mean those tools would run on a potential `vendor`
directory, but I'm not sure we really support vendoring of dependencies
anymore.

`release` has a `vendor` prerequisite so likely the source tarballs
contain vendor files?
silverwind added a commit that referenced this issue Apr 17, 2024
Backport #30529 by @silverwind

Fixes: #30512

I think this does mean those tools would run on a potential `vendor`
directory, but I'm not sure we really support vendoring of dependencies
anymore.

`release` has a `vendor` prerequisite so likely the source tarballs
contain vendor files?

Co-authored-by: silverwind <me@silverwind.io>
DennisRasey pushed a commit to DennisRasey/forgejo that referenced this issue Apr 22, 2024
Fixes: go-gitea/gitea#30512

I think this does mean those tools would run on a potential `vendor`
directory, but I'm not sure we really support vendoring of dependencies
anymore.

`release` has a `vendor` prerequisite so likely the source tarballs
contain vendor files?

(cherry picked from commit 8e12ef911a1d10dedb03e3127c42ca76f9850aca)

Conflicts:
	- Makefile
	  Manually adjusted the changes.
(cherry picked from commit 3918db1)
DennisRasey pushed a commit to DennisRasey/forgejo that referenced this issue Apr 22, 2024
Fixes: go-gitea/gitea#30512

I think this does mean those tools would run on a potential `vendor`
directory, but I'm not sure we really support vendoring of dependencies
anymore.

`release` has a `vendor` prerequisite so likely the source tarballs
contain vendor files?

(cherry picked from commit 8e12ef911a1d10dedb03e3127c42ca76f9850aca)

Conflicts:
	- Makefile
	  Manually adjusted the changes.
uli-heller pushed a commit to uli-heller/forgejo that referenced this issue Apr 24, 2024
Fixes: go-gitea/gitea#30512

I think this does mean those tools would run on a potential `vendor`
directory, but I'm not sure we really support vendoring of dependencies
anymore.

`release` has a `vendor` prerequisite so likely the source tarballs
contain vendor files?

(cherry picked from commit 8e12ef911a1d10dedb03e3127c42ca76f9850aca)

Conflicts:
	- Makefile
	  Manually adjusted the changes.
(cherry picked from commit 3918db1)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jul 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants