Gitea: Build enhancement: be able to build completely with just a `go get`

Created on 19 Oct 2017  路  11Comments  路  Source: go-gitea/gitea

Since gitea is a Golang project, it makes sense from a packaging standpoint to package it using regular go scripts. Unfortunately, gitea does not support this right now. Are there any plans to eventually support this mechanism?

Most helpful comment

From upstream:

It's important to understand that go generate is not part of go build. It contains no dependency analysis and must be run explicitly before running go build.

Furthermore:

Just keep in mind that it is for package authors, not clients, if only for the reason that the program it invokes might not be available on the target machine. Also, if the containing package is intended for import by go get, once the file is generated (and tested!) it must be checked into the source code repository to be available to clients.

Since these files are not provided to the client, the go get workflow is broken.


Source: https://blog.golang.org/generate

All 11 comments

@Vaelatern I think go build could work. Any problem have you encountered?

Speaking from the build I just ran, you need to call the Makefile first to generate the bindata artifacts.

Would it be possible to check these build artifacts into the repository?

@Vaelatern that would require additional changes otherwise when doing development or would require to regenerate bindata every time you change template that would make development very hard

Couldn't that be a pre-commit hook? Or at least a pre-release hook?

Unless of course these artifacts are architecture dependant.

I think we're already supporting builds with go get, just
they do not embed bindata. I don't think we should put generated
data in the repository. Ask upstream (to Go devs) about the
possibility to request that go get also runs go generate,
if asked

From upstream:

It's important to understand that go generate is not part of go build. It contains no dependency analysis and must be run explicitly before running go build.

Furthermore:

Just keep in mind that it is for package authors, not clients, if only for the reason that the program it invokes might not be available on the target machine. Also, if the containing package is intended for import by go get, once the file is generated (and tested!) it must be checked into the source code repository to be available to clients.

Since these files are not provided to the client, the go get workflow is broken.


Source: https://blog.golang.org/generate

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

I must ask, does this have a chance of being fixed?

Closing as this as go get and go build do work, however enhancements such as bindata do need go generate to be run first.

Was this page helpful?
0 / 5 - 0 ratings