Button: A fast, correct, and elegantly simple build system.

Jason White via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Sat Jun 18 01:05:18 PDT 2016


On Friday, 17 June 2016 at 10:24:16 UTC, Dicebot wrote:
>> However, I question the utility of even doing this in the 
>> first place. You miss out on the convenience of using the 
>> existing command line interface. And for what? Just so 
>> everything can be in D? Writing the same thing in Lua would be 
>> much prettier. I don't understand this dependency-phobia.
>
> It comes from knowing that for most small to average size D 
> projects you don't need a build _tool_ at all. If full clean 
> build takes 2 seconds, installing extra tool to achieve the 
> same thing one line shell script does is highly annoying.
>
> Your reasoning about makefiles seems to be flavored by C++ 
> realities. But my typical D makefile would look like something 
> this:
>
> build:
>     dmd -ofbinary `find ./src`
>
> test:
>     dmd -unittest -main `find ./src`
>
> deploy: build test
>     scp ./binary server:
>
> That means that I usually care neither about correctness nor 
> about speed, only about good cross-platform way to define 
> pipelines. And for that fetching dedicated tool is simply too 
> discouraging.
>
> In my opinion that is why it is so hard to take over make place 
> for any new tool - they all put too much attention into 
> complicated projects but to get self-sustained network effect 
> one has to prioritize small and simple projects. And ease of 
> availability is most important there.

I agree that a sophisticated build tool isn't really needed for 
tiny projects, but it's still really nice to have one that can 
scale as the project grows. All too often, as a project gets 
bigger, the build system it uses buckles under the growing 
complexity, no one ever gets around to changing it because 
they're afraid of breaking something, and the problem just gets 
worse.

I realize you might be playing devil's advocate a bit and I 
appreciate it. Let me propose another idea where maybe we can 
remove the extra dependency for new codebase collaborators but 
still have access to a full-blown build system: Add a sub-command 
to Button that produces a shell script to run the build. For 
example, `button shell -o build.sh`. Then just run `./build.sh` 
to build everything. I vaguely recall either Tup or Ninja having 
something like this.

The main downside is that it'd have to be committed every time 
the build changes. This could be automated with a bot, but it's 
still annoying. The upsides are that there is no need for any 
other external libraries or tools, and the superior build system 
can still be used by anyone who wants it.


More information about the Digitalmars-d-announce mailing list