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

Use a file as make evidence for fomantic instead of a directory #10032

Merged
merged 12 commits into from
Feb 1, 2020

Conversation

guillep2k
Copy link
Member

This PR follows #9999 (comment) by using a file as fomantic build evidence instead of the fomantic directory.

I've also added web_src/fomantic_site_globals/* as dependencies, because they're input files as well.

@codecov-io
Copy link

codecov-io commented Jan 28, 2020

Codecov Report

Merging #10032 into master will increase coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10032      +/-   ##
==========================================
+ Coverage   43.44%   43.45%   +0.01%     
==========================================
  Files         566      566              
  Lines       78987    78987              
==========================================
+ Hits        34317    34327      +10     
+ Misses      40430    40423       -7     
+ Partials     4240     4237       -3
Impacted Files Coverage Δ
services/pull/pull.go 33.93% <0%> (ø) ⬆️
modules/queue/manager.go 60.51% <0%> (-1.54%) ⬇️
models/repo.go 51.46% <0%> (+0.13%) ⬆️
services/pull/check.go 56.64% <0%> (+1.39%) ⬆️
modules/process/manager.go 78.31% <0%> (+3.61%) ⬆️
services/pull/patch.go 69.81% <0%> (+3.77%) ⬆️

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 884519c...8d78c5c. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 28, 2020
@guillep2k guillep2k changed the title Make evidence Use a file as make evidence for fomantic instead of a directory Jan 28, 2020
@zeripath
Copy link
Contributor

Hmm... I went for hashes in the bindata because the timestamps of the directories etc may not increase when you git checkout branch. I don't know enough about make's dependency process - does it cope with that?

Makefile Outdated Show resolved Hide resolved
@silverwind
Copy link
Member

does it cope with that?

I don't think make can do anything else but timestamp checks. Thought I guess something with content hashes could be hacked together, like https://medium.com/@mtiller/using-git-hashes-in-makefile-rules-387a099b9cb.

@guillep2k
Copy link
Member Author

Hmm... I went for hashes in the bindata because the timestamps of the directories etc may not increase when you git checkout branch. I don't know enough about make's dependency process - does it cope with that?

@zeripath Make could trigger any process you want and make a dependency out of it, as long as there's a file timestamp involved. For example:

GOFILES := $(shell find . -name "*.go" -type f ! -path "./vendor/*" ! -path "*/bindata.go")

generates a list of go files we use as dependencies; any of them change, make knows that the dependent rules need to be run.

The reason I didn't suggest you this path is because generate is used for more than creating bindata.go. If you'd like to use make timestamping for that (and you could) you'd need to take the bindata.go process out of generate and run it from outside. It's doable, but not much different from what you did.

The weak point of make is when you remove a file that was a dependency: make won't know about that. It's simply something that it's not in the list of dependencies anymore, so it won't trigger the corresponding rules (e.g. should we remove some .go file, make will not know that it needs to rebuild unless other .go files are modified).

Make is all about: "Is any of these files newer than the target? Run the recipe!"

@silverwind
Copy link
Member

Maybe just add a FOMANTIC_SOURCES ?= $(shell find web_src/fomantic -type f) and add that to prereqs? I think that might be cleaner.

.gitignore Outdated Show resolved Hide resolved
@guillep2k
Copy link
Member Author

Maybe just add a FOMANTIC_SOURCES ?= $(shell find web_src/fomantic -type f) and add that to prereqs? I think that might be cleaner.

Cleaner indeed. Done.

@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 Jan 28, 2020
@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 Jan 28, 2020
@zeripath zeripath added topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. labels Jan 28, 2020
@zeripath zeripath added this to the 1.12.0 milestone Jan 28, 2020
@zeripath
Copy link
Contributor

zeripath commented Feb 1, 2020

make lg-tm work

@zeripath zeripath merged commit 72f9cfc into go-gitea:master Feb 1, 2020
@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. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. 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.

8 participants