Problems with setting up dub for publication

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Mar 4 17:54:22 PST 2017


On Saturday, 4 March 2017 at 21:14:23 UTC, solidstate1991 wrote:

> However, after I wrote the dub.json and try to compile it as a 
> test, I get this output:

I don't see anything in your config that jumps out at me as a 
potential cause of your problem (though, see below). Do you have 
the project in a git repository somewhere so I can troubleshoot?


> 			{
> 			"pixelperfectengine:pixelperfectengine": "*",
> 			"derelict-sdl2": "~>2.1.0",
>
> 			"derelict-util": "~>2.1.0"
> ,
> 			"derelict-fi": "~>3.0.0-alpha.1"
> 			},
> 	}
> 	],
> }
>

Two things, neither of which (probably) is going to cure your 
problem:

- You don't need the derelict-util dependency. All of the 
derelict packages are configured to use it. That's how dub works 
-- each package defines its own dependencies so you don't have to 
worry about them. Besides which, all of the derelict packages are 
configured to use derelict-util 2.0.x, not 2.1. Leave it out and 
dub will pull in the appropriate version.

- Don't mix the alpha versions of any of the Derelict packages 
with any of the non-alpha versions. I realize this isn't 
documented anywhere yet, but all of the alpha versions require 
derelict-util 3.0 alpha, which is binary incompatible with 
earlier versions of derelict-util. You should be using ~>2.0.3 
for derelict-fi. When all of the alpha versions are finally 
finished, I'll document which versions are compatible.

> The dependencies compile by themselves (as I don't like to use 
> dub because of things like > this), I don't know what's the 
> problem.

Don't let things like this turn you off of dub. It's an excellent 
tool. I was reluctant to use it at first because such tools had 
come and gone in the D community before. But once I did, I never 
looked back. I rarely have issues with it and when I do it's 
almost always because of user error.

One thing you might try is to delete the dub.selections.json that 
was created in your project directory (and the .dub directory for 
good measure), update the dependencies as I said above, and try 
again.


More information about the Digitalmars-d-learn mailing list