Make dub part of the standard dmd distribution

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Mon Jun 1 11:49:44 PDT 2015


On 6/1/15 1:36 PM, Nick Sabalausky wrote:
> On 06/01/2015 11:16 AM, Steven Schveighoffer wrote:
>> On 5/31/15 7:01 PM, Andrei Alexandrescu wrote:
>>> Let's make this part of 2.068:
>>>
>>> https://issues.dlang.org/show_bug.cgi?id=14636
>>>
>>> It's preapproved. Who would want to work on it?
>>
>> Just a reminder to everyone that at one point, we wanted the compiler to
>> do kind of what 'dub' does -- fetch packages as dependencies for a
>> project. Remember this DIP? http://wiki.dlang.org/DIP11
>>
>
> That sort of did what dub does, but badly. Among other things, it
> directly encouraged developers to hardcode their exact dependencies. It
> would have been a mess. Dub's package management side already handles
> that DIP's goals WAY better. The *only* issue now is trying to opt-out
> of dub's buildsystem side without causing problems (and I absolutely
> believe that to be easily solvable, see my other posts).

I'm not defending DIP11, just that the fact that it could be done 
without requiring an extra "dependencies" file. One thing I absolutely 
LOVE about git, is that when I do git status, if it sees a 
not-just-cloned repository, it gives me all the commands I would need to 
run to do all the various things. I rarely have to go to the git manual. 
I'd love to see something like the following:

 > dmd x.d
Error: Your import of some.lib.module didn't work. Running dub 
--with-some-cool-arg some.lib.module would fetch the correct module from 
code.dlang.org
 > dub --with-some-cool-arg some.lib.module
Dub : got it, fetched.
 > dmd x.d
 > echo 'yay, it worked! Too bad this is a fantasy :('

>> The problem I have with dub is it makes you as a consumer of libraries
>> live within its realm. You have to make a dub file to use it, and that's
>> not a small burden.
>>
>
> The dub.json file is an absolutely trivial "burden". It's a really,
> REALLY simple little file. Or at least, it should be...

Sorry, I suppose it's a small burden if you use dub frequently. I don't. 
Look what happens when I initialize a dub project:

{
	"name": "testdub",
	"description": "A minimal D application.",
	"copyright": "Copyright © 2015, steves",
	"authors": ["steves"],
	"dependencies": {
	}
}

Cool, I can figure out how to massage all the existing strings, except, 
hm... dependencies. What goes in there?

Now, it's time to get out the dub manual. annoying. Where is the comment 
that says "put your dependencies in here, they should look like this: 
..."???

And dub uses versions. How does that work? Again no comment.

And where does the e.g. "name" get stuck into the executable? Oh, it 
doesn't. Why is it generated? I don't freaking know (except that it was 
the directory I was in when running dub init).

I'm sure dub is great for people who want to learn dub. For those who 
don't, it should work in a minimal way, and ESPECIALLY if we are to 
include it with the distribution.

-Steve


More information about the Digitalmars-d mailing list