Gitea: RFC: Replace Makefile with go-task

Created on 25 Jan 2019  路  7Comments  路  Source: go-gitea/gitea

This is a brainstorming-stage proposal.
I was thinking about improving some aspects of developer UX like testing/benchmarking selectively a particular integration test. But to make it happen, I'd have to inevitably resort to some advanced GNU Make usage, which would complicate the Makefile and making it harder to maintain.

It seems that go-task would be an interesting candidate.
I am not sure if it would be significantly better than the status quo to warrant the migration though.

The pros I can think of right now:

  1. No more obscured Makefile magic.
  2. Probably better cross-platform dev UX.
  3. It's written in Go, so it can even be vendored.
  4. No GNU make required. One can start from anywhere Go toolchain is available,
  5. It supports something like task --list showing the descriptions of the "make targets." (make help can do it if there is one)

Cons:

  1. It needs effort to port.
  2. Current developers need to learn an unfamiliar tool.
  3. The maturity of go-task is uncertain.
  4. Not sure if the current usage required by Gitea is all met.
  5. It's not widely adopted currently like make.
kinproposal

Most helpful comment

Task author here.

Let me know if you have any questions or need any help.

All 7 comments

Please keep the Makefile around shall you decide to use another
tool. make is a familar interface, even if it'll end up wrapping
something different.

We could certainly make more use of make automatic variables https://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html to reduce the amount of duplication in the makefile and reduce it to a thinner wrapper around go test etc.

I think we could add go-task with the second build tool and keep Makefile.

I would like to also mention Mage as a candidate.
The "magefile" is fully written in Go and Mage has a zero install option, so it can be vendored and ran via go run..

Since it is just a .go file, anyone working on the project should be able to interpret and modify the "magefile" as needed.

Task author here.

Let me know if you have any questions or need any help.

I think we could have both makefile and go-task for a while.

@andreynering I used go-task on most my projects because windows users could also use it. Some annoying things are we need some simple cross-platform commands i.e. copy files/move .

@lunny Yeah, I remember that you opened an issue about it here: https://github.com/go-task/task/issues/197.

My advice to Gitea (while is isn't being implemented) is to advice contributors to use a Unix-like shell on Windows. Git Bash is the easiest one: it comes with Git on Windows, so most developers should already have it installed. Inside Git Bash you have basic Unix tools like rm, cp, mv, touch, grep and many others available, so you don't depend on Task implementing it itself.

Maybe it's not the ideal scenario, but it's already a win, since Make often doesn't work nicely on Windows.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mirhec picture mirhec  路  3Comments

flozz picture flozz  路  3Comments

kolargol picture kolargol  路  3Comments

jorise7 picture jorise7  路  3Comments

ghost picture ghost  路  3Comments