DUB - call to arms

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Apr 15 23:17:46 UTC 2019


On Mon, Apr 15, 2019 at 06:56:24PM -0400, Nick Sabalausky (Abscissa) via Digitalmars-d wrote:
[...]
> To clarify, I'm mainly referring to the "package manager" aspect of
> DUB here. I'm less concerned with the "buildsystem" part simply
> because with a proper package manager, individual projects and even
> libraries will be free to use whatever buildsystem they want, even if
> that happens to be "dub build" (which *is* an entirely reasonable
> choice for many simpler projects...in large part because that's
> specifically the use-case it was primarily designed for.).

Y'know, the idea just occurred to me: why even bind the package manager
to the build system at all?  Why not make the build system one of the
dependencies of the project?  So you could have library A that is
written to be built using dub build, and library B that depends on
'make', say (where 'make' is some dub-ified description of make as a
build system), and A depends on B.  So to build A, dub would fetch the
necessary sources to build 'make', then use 'make' to build B, and then
build A, and so forth.

This way, you can have multiple build systems coexisting peacefully with
each other, without requiring the package manager to roll its own build
system.  You could have library C depend on 'scons' and library D depend
on 'gradle' or whatever, as long as there's a suitably dub-ified
description of these build systems, dub could fetch and build them as
dependencies and then use them to build whatever targets are needed.
'dub' itself (or maybe we should call it 'dub-build' or something) would
be its own, standalone build module that projects could depend on by
default.  So if you don't like dub's built-in build system, just
override it to depend on 'make' or whatever your choice of build poison
is.

For backward compatibility, 'dub-build' would be assumed if no build
system is specified.

If we were to pull this off, I might even consider using dub in a
non-toy way. (Right now the only way I can get it to work sanely with my
vibe.d project is to use the hack of an empty dub project whose sole
purpose is to declare dub dependencies. It's ugly, and annoying.)


T

-- 
Без труда не выловишь и рыбку из пруда. 


More information about the Digitalmars-d mailing list