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

Remove explicit 'generate' calls, fix release task #9288

Merged
merged 4 commits into from Dec 8, 2019

Conversation

silverwind
Copy link
Member

@silverwind silverwind commented Dec 7, 2019

generate is now implicit during build since #9114, it is no longer necessary or desired to specify it explicitely.

@silverwind
Copy link
Member Author

Not 100% certain about the release tasks. It forks out to xgo while never explicitly calling build. I guess xgo does that?

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 7, 2019
`generate` is now implicit during `build` since go-gitea#9114, it is no longer
necessary or desired to specify it explicitely.
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Dec 7, 2019
@codecov-io
Copy link

codecov-io commented Dec 7, 2019

Codecov Report

Merging #9288 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9288      +/-   ##
==========================================
- Coverage   41.25%   41.24%   -0.01%     
==========================================
  Files         558      558              
  Lines       73058    73058              
==========================================
- Hits        30137    30135       -2     
- Misses      39150    39154       +4     
+ Partials     3771     3769       -2
Impacted Files Coverage Δ
modules/indexer/indexer.go 44.73% <0%> (-10.53%) ⬇️
modules/log/event.go 65.64% <0%> (+1.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 95a5739...2447382. Read the comment docs.

@axifive
Copy link
Member

axifive commented Dec 7, 2019

@techknowlogick I can't find make css js call for the release in makefile. Does it build static files?

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Dec 7, 2019
@lafriks lafriks added the topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile label Dec 7, 2019
Copy link
Member

@lunny lunny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should remove the warning about the generate on build from source.

@techknowlogick
Copy link
Member

@axifive It doesn't.

@silverwind I've just checked the most recent binaries for master branch and they don't include the generated CSS/JS, perhaps a Drone step could be added before the xgo one to generate the CSS/JS for releases.

@techknowlogick techknowlogick added this to the 1.11.0 milestone Dec 8, 2019
@silverwind
Copy link
Member Author

@techknowlogick what does xgo exactly call? Just make? Are the releases meant to be built with bindata?

@techknowlogick
Copy link
Member

@silverwind xgo is just a nice wrapper around go build (you can see an example of how go build is called here: https://github.com/techknowlogick/xgo/blob/master/docker/base/build.sh#L192, note there are other ways go build is called based on which cross-compiled architecture you'd like). It is how we can generate all of our binaries for different platforms (eg, arm, powerpc, windows, etc..). The way xgo does this is if calling xgo not in a docker container, it actually mounts the go code into the container that has all of the dependencies for the other platform you need and runs go build, if called inside the xgo container (like we do with drone), then it knows that and runs the same go build.

It uses the command line flags that passes the TAGS to the go build, that way it knows to use bindata tag. Now that pregenerated css/js aren't included in repo they will have to be generated before xgo is called, as xgo doesn't have node dependancies in its docker image, a different drone step (before xgo is called) would be best place to put it (if you'd like me to do this step I can, and then push it to your branch).

@silverwind
Copy link
Member Author

Okay. Does it have to be a drone step? I was thinking of just adding js css as a dependency in the release make task.

@silverwind
Copy link
Member Author

Also, I see it passes $(TAGS) but that variable should be empty at this point. Where does bindata come in?

@silverwind
Copy link
Member Author

silverwind commented Dec 8, 2019

@techknowlogick I added the dependencies, can you check if that fixes the issue?

I prefer it that way instead of in drone because one can release outside of drone too and less calls to make it always faster.

@silverwind
Copy link
Member Author

@lunny not sure what you mean. can you point me to that warning?

@silverwind silverwind changed the title Remove more explicit 'generate' calls Remove explicit 'generate' calls, fix release task Dec 8, 2019
@lunny
Copy link
Member

lunny commented Dec 8, 2019

see https://github.com/go-gitea/gitea/blob/master/docs/content/doc/installation/from-source.en-us.md

and find WARNING: generate method is deprecated and using it may cause build to miss some static files..

@lafriks lafriks merged commit 3f42934 into go-gitea:master Dec 8, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants