-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Rework Makefile #684
Comments
+1 for Mage @tomwilkie @gouthamve @Kuqd @steven-sheehy thoughts? this would divert us from cortex/prometheus path quite a bit which are using traditional make files. But personally I have no love for makefiles and would be happy to see a go based solution, especially one that keeps the semantics of make: i.e. Or honestly we could keep make around to install mage and have a |
I think the Makefile should be kept for now and Mage can be added as an exploratory effort at the same time without affecting the CircleCI builds. I don't think the switchover to Mage should be done until after a 1.0 release, in my opinion. |
It looks nice, but I like the docker build image too. I usually enjoy makefile but that one is definitely hard to maintain. I might be fully convinced by seeing the final results, so have some fun at it and let us know. |
I think the Makefile shoule be kept too, |
Okay, I've sketched out a very basic Magefile in #687 for everyone who wants to try it. Still in a very early stage, but it should give an idea how it is gonna work. Feedback is more than welcome! |
Is your feature request related to a problem? Please describe.
The current Makefile is based on the one cortex uses, but does not fit this project very well IMHO.
In comparison to e.g. Go, Makefiles are very hard to read and debug. The automatic discovery of binaries implemented using find, etc. makes it even worse and according to @slim-bean it may be replaced in favor of static targets.
Describe the solution you'd like
We should definitely clean-up / rewrite the Makefile or even the whole build process. Currently, I see multiple options to choose from:
The current way: Makefile
We certainly could rewrite / clean-up the current Makefile to make it more readable and understandable.
This would involve checking everything that is in it is even required, including:
.uptodate
andBUILD_IN_DOCKER
: The end user always needs to create a file to prevent the docker container from being run. This is not documented and not intuitive. And not even CircleCI seems to use the container, so does anyone need this?protobuf
files inside of vendor!? Of course cortex is in there, but this looks very ugly. Are there better solutions?docker run
workarounds for CircleCI and Cloud Builder .. we do not use docker in CircleCI and do we even use Cloud Builder?image
building: Needs to be rewritten anyways, as BuildKit and experimental CLI features wil be required by feat(docker): multi-arch Dockerfile #668.Pros:
make
is available nearly everywhereCons:
The fancy way: Magefile
There is another project around, promising to unite the best of Go and
make
, calledmage
. It essentially allows writing make targets as regular go functions and execute them without having to worry about building, etc.Pros:
.go
files, keeps it tidy (one for compiling, one for releasing, one for helm, etc.)Cons:
You need to install a tool (https://github.com/magefile/mage)https://magefile.org/zeroinstall/ gets the job done as wellThe hands-dirty way:
Write our own
build.go
file, with build-constrains which runs every required command usingcmd.Run
, uses some cli library for subcommands and get's the job done.Pros:
Cons:
To sum up, I vote for Magefiles. Thoughts on this?
The text was updated successfully, but these errors were encountered: