Skip to content

Failure to execute make generate-swagger in go 1.22 #29664

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

Closed
sillyguodong opened this issue Mar 8, 2024 · 5 comments · Fixed by #29780
Closed

Failure to execute make generate-swagger in go 1.22 #29664

sillyguodong opened this issue Mar 8, 2024 · 5 comments · Fixed by #29780
Labels
topic/api Concerns mainly the API type/upstream This is an issue in one of Gitea's dependencies and should be reported there

Comments

@sillyguodong
Copy link
Contributor

sillyguodong commented Mar 8, 2024

Description

After deleting v1_json.tmpl, I tried to execute make generate-swagger to re-generate the swagger file, but it failed.
image

Question

  1. Do I need to delete this file before re-generating it?
  2. If the file is not deleted and the command line is executed directly, it only returns: make: Nothing to be done for `generate-swagger'. However, I have actually added some new APIs and comment for them

Gitea Version

9dc8a63

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

build

Database

None

@sillyguodong sillyguodong added topic/api Concerns mainly the API type/question Issue needs no code to be fixed, only a description on how to fix it yourself. labels Mar 8, 2024
@silverwind
Copy link
Member

silverwind commented Mar 8, 2024

Do I need to delete this file before re-generating it?

No, it will be overwritten

If the file is not deleted and the command line is executed directly, it only returns: make: Nothing to be done for `generate-swagger'. However, I have actually added some new APIs and comment for them

This is make dependency tracking in action and completely normal. If there is no change in any .go file, we do not need to run swagger generation. Change any go file to get it running. If it is still not working while you had changed go files, maybe there is something wrong with your filesystem because Make relies on filesystem timestamps to detect changes.

@silverwind
Copy link
Member

silverwind commented Mar 8, 2024

That said, it also crashes for me. Maybe it's related to golang, I run with 1.22.1.

@silverwind
Copy link
Member

Upstream bug: go-swagger/go-swagger#3070

@silverwind silverwind added the type/upstream This is an issue in one of Gitea's dependencies and should be reported there label Mar 8, 2024
@silverwind
Copy link
Member

silverwind commented Mar 8, 2024

Workaround is to downgrade go to 1.21 until upstream has fixed it.

@silverwind silverwind removed the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label Mar 8, 2024
@silverwind silverwind changed the title Failure to execute make generate-swagger Failure to execute make generate-swagger in go 1.22 Mar 8, 2024
@silverwind
Copy link
Member

#29780

lunny pushed a commit that referenced this issue Mar 14, 2024
Fixes: #29664. No release
available for go-swagger/go-swagger#3070 so
let's depend on latest commit hash. Output is the same as before for me.
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jun 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic/api Concerns mainly the API type/upstream This is an issue in one of Gitea's dependencies and should be reported there
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants