April 25, 2022
On 25/04/2022 1:51 AM, Paul Backus wrote:
> The registry could also allow you to create releases manually. Like, you type the version number and the tag/commit hash you want to use for that version into a form, and then whenever somebody asks for version x.y.z, it gives them the commit you specified.

For a while now I've been wanting the dub registry to be augmented with a proper artifact server.

After that its just a matter of teaching both dub and the registry the order of the versions for the given package.
April 24, 2022

On Sunday, 24 April 2022 at 09:44:40 UTC, Guillaume Piolat wrote:

>

On Saturday, 23 April 2022 at 20:15:27 UTC, deadalnix wrote:

>

I want tool to work for me, not work for the tool.

DUB gives me a chance to download and run your program and just type "dub".

While if I have to understand your build system first (especially if it's a custom build system), install the right version of make, etc.. I will probably go on with my life and not even try.

Just have dub ship the right version of make and alike. Problem solved.

April 24, 2022

On Saturday, 23 April 2022 at 20:15:27 UTC, deadalnix wrote:

>

So, I have this nice little project, sdc. It builds using make, and everything was good. People wanted it to be distributed via dub, so be it, let's create a dub.json file.

Writing a makefile from sratch for the first time is not easier than writing a DUB recipe. I think 2 over 3 of your complains are invalid (license, semver), you should have read the manual before. It is clearly specified that they are mandatory fields, here.

The only thing that's valid is the shared version for the other application.

April 24, 2022
On Sunday, 24 April 2022 at 09:56:13 UTC, rikki cattermole wrote:
>
> On 24/04/2022 9:44 PM, Guillaume Piolat wrote:
>> On Saturday, 23 April 2022 at 20:15:27 UTC, deadalnix wrote:
>>> I want tool to work for me, not work for the tool.
>> 
>> 
>> DUB gives me a chance to download and run your program and just type "dub".
>> 
>> While if I have to understand your build system first (especially if it's a _custom_ build system), install the right version of make, etc.. I will probably go on with my life and not even try.
>
> Is it dmc make? Cygwin's make, Microsoft's nmake? MingW's make...
>
> So many options, and not a one may be on the PATH variable when dub executes.
>

dub contains a dependency manager.

This is *EXACTLY* the problem that a dependency manager solves.

> At least with dub, unless you did something stupid involving shell commands or non-D dependencies, or didn't test on a given platform it should "just work".

Any project that is big enough so that `dmd -i` doesn't cut it anymore will do one of these things, most likely both.
April 24, 2022
On Sun, Apr 24, 2022 at 03:30:06PM +0000, deadalnix via Digitalmars-d wrote:
> On Sunday, 24 April 2022 at 09:44:40 UTC, Guillaume Piolat wrote:
> > On Saturday, 23 April 2022 at 20:15:27 UTC, deadalnix wrote:
> > > I want tool to work for me, not work for the tool.
> > 
> > 
> > DUB gives me a chance to download and run your program and just type "dub".
> > 
> > While if I have to understand your build system first (especially if it's a _custom_ build system), install the right version of make, etc..  I will probably go on with my life and not even try.
> 
> Just have dub ship the right version of make and alike. Problem solved.

+1.  Had dub been designed with the proper build capabilities, it would have been a simple of matter of: "Project P uses build system B" -> dub downloads B, downloads P, and builds P with B. You can even version it: "Project P version V1 uses build system B version V2" -> dub downloads P version V1, downloads P version V2, and builds P with B.

This can't be *that* hard to do, can it?


T

-- 
"The number you have dialed is imaginary. Please rotate your phone 90 degrees and try again."
April 25, 2022

On Saturday, 23 April 2022 at 20:15:27 UTC, deadalnix wrote:

>

So, I have this nice little project, sdc. It builds using make, and everything was good. People wanted it to be distributed via dub, so be it, let's create a dub.json file.

[...]

At my company we use Conan for D because the majority of code is C++. Our D projects are Conan packages using Makefiles or CMake, just like our C++ projects. It is a pity D decided to try and reinvent package management when there are battle hardened options already available that are flexible enough to just work with D.

Conan is NOT perfect but to date it has just worked and is much easier when integrating D with C/C++ code and mixed build systems.

April 25, 2022

On Saturday, 23 April 2022 at 20:15:27 UTC, deadalnix wrote:

>

Why do we use a package manager that expect everyone to use it to work in a certain way? It is blatantly obvious that many organization out there are not going to use the exact setup dub expects. So what do they do if they want to adopt D? Not use dub at all? It's an option, but everything is distributed via dub nowadays in the D ecosystem. Use dub to build everything? Fork their own version of dub? No, the only sensible path forward for pretty much any organization stumbling on this bullshit is to not use D at all because none of the crap we put out there is going to play nicely with what they already have.

Just shell out to dub as required. That's what we do.

I disagree with this post. Dub's requirements seem eminently sensible to me, if you publish source code without a license, you're basically setting a copyright trap for the unwary. I disagree with the v1.2.3 format but it's explicitly called out as a common choice in the semver spec. And dub's goal should be to be simple first, composable second. Why make dub shell out to another build system? If you want to use another build system, just build with that system. Dub is off in its own little world of D packages, and that's fine, it limits the breakage surface, encourages internal standardization and makes it easy to get started for a newcomer. Imagine if you run 'dub build' and it told you to install meson (because some dependency needed it), you'd be weirded out, right? "So is Dub the D build system or meson?" Imagine needing to install multiple build systems. I'm glad that dub doesn't enable that sort of mess.

It's okay to not have a feature sometimes.

April 25, 2022
> my way or the highway attitude

Just view it from the other side: You are typically publishing a package for an audience to use. If you insist on using your own choice of build system, you also dictate that upon the users of your package - forcing them to install and use that system, as well as forcing custom integration of any build artifacts into development dependencies (aka C/C++ dependency hell).

Having said that, you can define a custom command to run make if you really want to.

The way versions are managed is very convenient for publishing if DUB is your primary target, but may admittedly get in the way if you have other systems. Nothing, except the need to put the necessary work into the registry, speaks against supporting other mechanisms, though.

This applies to many of the current shortcomings, such as the error diagnostics when adding packages. A lot of things are not meant to be limitations, but simply represent what people were willing to invest or deemed sufficient.
April 25, 2022

On Monday, 25 April 2022 at 06:43:47 UTC, FeepingCreature wrote:

>

I disagree with this post. Dub's requirements seem eminently sensible to me, if you publish source code without a license, you're basically setting a copyright trap for the unwary.

I don't know. I recently spent quite a bit of time with Faust and its standard library has different licenses for different functions (GPL, LGPL, MIT etc). This makes perfect sense when you want to use the best tools (DSP algorithms) for the job and have them all at your fingertips. So it isn't obvious that having one license for a library make sense. For some projects it would make more sense to have a "license filter" of some sort at the compiler-level.

So, for instance instead of having one FFT function in your "numerical" package you can have an FFT interface and have many FFT implementations (with various licenses) in the same "numerical" package. Then you can easily test many of them for performance/quality in your application with little effort.

In general, it is a problem if D has a package system that authors don't use. It would probably make more sense to use what is/becomes common for C++/C and build on top of that. Larger D projects will use a lot of C++/C code anyway.

>

system, just build with that system. Dub is off in its own little world of D packages, and that's fine, it limits the breakage surface, encourages internal standardization and makes it easy to get started for a newcomer.

Ok, so you have to decide what the purpose of Dub is. If it is primarily for newbies, then you focus more on quality testing packages before making them public, requiring good documentation and making sure that they are removed when outdated.

If it is for more advanced projects you have to make sure that everybody wants to use it. If one commonly used library choses not to use it, then it becomes unworkable.

In Java, Javascript, Go and Rust you have a culture of not using much FFI, so they are not really comparable to a language where you use a lot of FFI. More importantly they have a large enough user base to maintain libraries over time. In some of these languages you cannot avoid using their leading package managers/build systems, it is close to mandatory. And some of the builds that these package managers lead to adds bloat.

Anyway, there is a reason for why there is an increasing demand for header-only libraries in C++. People learn the hard way that libraries that require setup will suck up time, increase complexity and usually add bloat, regardless of build system used…

Fo D I don't really think it matters either way, as the main issue seems to be to get enough maintained high quality libraries to drive the adoption in the first place.

The best strategic option right now seems to be to have maintained C-library bindings that uses "import C" and ship them with the compiler (funded by the D foundation) and provide an install-option that uses the operating system's package manager (linux distribution, macports, homebrew etc) so that the install becomes 100% build-free.

I personally try to avoid libraries, regardless of language, that require building beyond the standard compiler features. I think most pure D libraries should be nothing more than a github fetch and it would be better to reuse a system that is likely to be dominating C/C++ builds in the future, or rather to use a fork of such a system that adds information useful for D builds in a registry, such as classifying existing C-libraries as "import C" compatible.

April 25, 2022
On Sunday, 24 April 2022 at 09:56:13 UTC, rikki cattermole wrote:
> Is it dmc make? Cygwin's make, Microsoft's nmake? MingW's make...

GNU-make is dominating, but then you have cmake and the like with their overcomplicating "autoconfig-setups". Most D authors probably cannot test their build setup on enough platforms to iron out all possible build quirks…

Dub might be a valuable resource for getting attraction to new projects, but perhaps insufficient for complex projects.