Hi,Running a tracer to capture the command lines could work, although you'll also need to capture the dependencies so Shake can rebuild the right pieces. Once you have that information you can generate a Shake Haskell file, or generate text and load it up and interpret it with Shake, or even generate a Ninja file and execute that with Shake (or Ninja, if that was easier for you).
To get a size of scale, how many lines of XML ant files do you have? It may turn out to be simpler to port directly, although that very much depends on the size.
Finally, Shake is exceptionally well suited to writing interpreters for other build systems. It ships with a complete Ninja interpreter, that as far as I can tell, is faster and might actually have fewer bugs than Ninja. It ships with a proof of concept Make interpreter that can deal with tutorial examples, but little real-world Make. The Ant format looks a lot simpler than Make, so perhaps Shake could interpret it directly and you could just type "shake" instead of "ant".
> Around 5 millions of LoC in 5.000 files, so it's too to be ported without
> help.
I mean just the size of the Ant build-description files (which is all
that needs porting for the build system), not all the source. I really
hope you don't have 5M LoC of build files! (I typically find big
projects tap out around 10K)
>> Finally, Shake is exceptionally well suited to writing interpreters for
>> other build systems. It ships with a complete Ninja interpreter, that as far
>> as I can tell, is faster and might actually have fewer bugs than Ninja. It
>> ships with a proof of concept Make interpreter that can deal with tutorial
>> examples, but little real-world Make. The Ant format looks a lot simpler
>> than Make, so perhaps Shake could interpret it directly and you could just
>> type "shake" instead of "ant".
>
> I'm afraid to not even know the whole rules :/
You don't need to know all the rules for Ant, just the ones which your
project makes use of. It also has the benefit of benefiting everyone,
and the work can be shared much better (it's a general problem, not
something specific to your company).
Thanks, Neil
Wow, that is what I was thinking of. That's a lot more than I was
expecting! I really didn't know build systems came that large...
Given that size, I suspect porting it by hand to Shake is infeasible.
If it has a fairly regular structure, then extracting the information
from it to a Shake file might work.
Are you hoping to speed up the time to do a zero build when nothing
has changed, or the time to do a complete rebuild? What is the current
zero build time?
Looking at Ant, it might be more reasonable to describe it as a DSL
for running statements, rather than as a build system. There are
dependencies, but it's not specified in a traditional "make" style
dependency with one file having some dependencies, it's more a script
that can be executed linearly and with some parallelism and sharing.
While some build systems work that way (fabricate springs to mind,
https://code.google.com/p/fabricate/), it's relatively rare. As such,
it may turn out to be quite difficult to convert into a
dependency-driven build system. I'm sure many simple Ant build systems
can be converted to a dependency-driven system, but if you have 5M
lines there's inevitably going to be plenty that can't. I'm not sure
there will be "easy" wins in converting to Shake.