[rust-dev] RFC: Future of the Build System
leebraid at gmail.com
Wed Jan 15 01:30:35 PST 2014
On 15/01/14 06:34, Corey Richardson wrote:
> On Tue, Jan 14, 2014 at 6:54 PM, Lee Braiden <leebraid at gmail.com> wrote:
>> On 14/01/14 23:43, Corey Richardson wrote:
>>> This thread is deviating from its purpose. The idea isn't to hash out a
>>> generic build system for all of Rust, merely for the compiler + stdlib.
>> I think it naturally progressed, because some people wanted to discuss a
>> more generic solution.
>> But fair enough... if the only goal is to build rust, I've very little
>> preference, except to say:
> I don't mean to squash discussion. I think the build system the wider
> ecosystem uses is important. But that can happen in another thread;
> this RFC is unrelated and has a much narrow scope and wider set of
> From the thread I it seems we want a custom solution, in Rust, that
> plugs into something like Ninja. I think our dep management is simple
> enough that this can work very well. (In particular, we don't have the
> madness of header deps + each file being a compilation unit)
For the Rust toolchain's purposes, we could write a simple script to
generate template-based "buildfiles" (for want of a better word) for
one/more build tools (depending on whether you want to generate all and
have them choose, or generate the first that seems sensible for that
platform / available tools on system): make, XCode, Visual Studio...
I'm thinking of a file with a few variables, and a script that applies
those to a template, perhaps with a bit of logic to decide which
template to use, and which output filename to generate, and perhaps
adding a few variables gleaned from the system / command line, at runtime.
Probably 100 lines of python, plus templates; a bit more to make it
highly usable. Not sure what the equivalent would be in Rust code, as
I'm still fairly new to it.
I think the first step to getting a build tool written in rust though,
would be to bring back the "rust run" command.
More information about the Rust-dev