DIP11: Automatic downloading of libraries
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Wed Jun 15 06:59:30 PDT 2011
On 6/14/11 8:44 PM, Nick Sabalausky wrote:
> "Adam D. Ruppe"<destructionator at gmail.com> wrote in message
> news:it91b0$aa0$1 at digitalmars.com...
>> Nick Sabalausky wrote:
>>> Just one extra deps-gathering invokation each time a
>>> deps-gathering invokation finds unsatisfied depenencies, and *only*
>>> the first time you build.
>>
>> It could probably cache the last successful command...
>
> Nothing would need to be cached. After the initial "gather everything and
> build" build, all it would ever have to do is exactly what RDMD already does
> right now: Run DMD once to find the deps, check them to see if anything
> needs rebuilt, and if so, run DMD the second time to build. There'd never be
> any need for more than those two invokations (and the first one tends to be
> much faster anyway) until a new library dependency is introduced.
I think this works, but I personally find it clumsy. Particularly
because when dmd fails, you don't know exactly why - may have been an
import, may have been something else. So the utility needs to
essentially remember the last import attempted (won't work when the
compiler will use multiple threads) and scrape dmd's stderr output and
parse it for something that looks like a specific "module not found"
error message (see http://arsdnet.net/dcode/build.d). It's quite a shaky
design that relies on a bunch of stars aligning.
Andrei
More information about the Digitalmars-d
mailing list