This is an attempt at creating a build system for Go using Go code and its toolchain.
For an in-depth description of how Modmake works, check out the documentation here.
To report an issue or idea for improvement, click here
There are a few goals I'm trying to accomplish with this system that may also explain why I didn't want to use existing systems that attempt to solve this problem. If these goals aren't compatible with yours then Modmake may not be for you, and that's okay.
- Eliminate the need for Makefiles for non-trivial builds.
- Eliminate the need for OS-specific scripting.
- Make the common paths easy and discoverable.
- Informative and consistent error reporting.
- Common sense, consistent base structure that isn't too restrictive.
- Allow adding custom logic where needed.
- Avoid doing work that isn't needed.
- Easy to construct build logic that is invoked with
go run
.
Besides accomplishing the goals set out above, there are some key benefits with this approach.
- Modmake provides a DSL-like API that is simple to use and type-safe. All the power of Go code, but without the verbosity.
- Low barrier of entry with a consistent starting point.
- Go code works on many OS/architecture combinations, and Modmake inherits that ability.
- Modmake includes a lot of common-use functionality with more to come:
- Using the Go toolchain, resolved from
GOROOT
. - File system operations like creating, copying, moving, deleting files and directories with PathString.
- Compressing and packaging with zip/tar.
go install
ing and executing external tools.- Downloading files over HTTP.
- Git operations like getting the current branch and commit hash.
- Orchestrating build operations in terms of build steps and their dependencies.
- Using the Go toolchain, resolved from
I've started creating bolt-on functionality that can help fill more build gaps.
- modmake-docker provides Docker build and run support.