Git, the D package manager
Nick Sabalausky via Digitalmars-d
digitalmars-d at puremagic.com
Mon Feb 2 14:15:40 PST 2015
On 02/02/2015 03:09 AM, Vladimir Panteleev wrote:
> 1a. rdmd and D's module system:
>[...]
> In contrast, Dub's default modus operandi is to blindly send to the
> compiler all *.d files found in the "src" folder, whether they're
> actually used or not. Not only can this be slower if not all modules are
> always used, but it also won't work if the source code contains multiple
> entry points, forcing you to write complicated configuration files (i.e.
> do the computer's work for it).
>
This is one of my biggest beefs with dub, too, and constantly causes me
trouble. (I love that dub exists as a package manager, but I REALLY
dislike that it tries to be build system too. Especially since I don't
like the way its build functionality works.)
In theory, dub does have the --rdmd switch to make it select source
files in a sane manner (by deferring to rdmd), but unfortunately it
doesn't get well-tested and frequently breaks:
https://github.com/D-Programming-Language/dub/issues/492
> 1b. rdmd and D's search path
>
> rdmd does not have any additional parameters to set up for where it
> needs to look for source files, because it relies on the compiler's
> search mechanism. Thus, if you can build your program with rdmd, "dmd
> -o- program" will succeed, and usually vice versa.
>
> In contrast, Dub builds its own search path using its JSON configuration
> files, and has no equivalent of "dmd -o-".
>
> There is no simple way to syntax-check just one file in a project when
> using Dub. I rely on this a lot in my workflow - I configured a
> syntax-check key in my editor, which I use almost as often as I save. A
> syntax check (dmd -o-) is much faster than a full build, as it skips
> parsing other parts of the project, code generation, and linking.
>
My #1 beef with Dub: It desperately needs a way to *just* obtain the
-o/-version/etc args to be passed directly into dmd/rdmd/ldmd/gdmd/etc.
Without that, dub is useless as a MERE package manager. It's either
packaging AND building, or nothing. (Ever try to use a recent version of
vibe.d in a project that *doesn't* use dub as its build system? PITA. It
isn't even recommended to do so.)
I tried to add that feature one time, but I had trouble grokking the
relevant section of dub's source :(
There's also one other big thing I don't like about it: It needlessly
reinvents and renames dmd's entire set of command switches. That isn't
even needed for ldc/gdc anyway since, last I heard, the ldmd and gdmd
wrappers exist. I pushed to get the *actual* compiler switched accepted
by dub, and the feature made it in, but trying to use it generates a big
giant warning for all your library's users complaining that the feature
*shouldn't* be used. Thus completely defeating the point. Argh.
Again, I love that Dub (and especially it's package repository) exists.
But dub just tries to hard to impose it's own way.
More information about the Digitalmars-d
mailing list