April 25, 2022
On Monday, 25 April 2022 at 11:18:57 UTC, bauss wrote:
> This discussion would never have happened if the project was just created with dub in mind from the beginning, like if it was built using dub since the beginning and not with make, or at the very least both.

Good, what's you plan to get every project restarted from scratch using dub?

April 25, 2022

On Monday, 25 April 2022 at 11:15:59 UTC, Guillaume Piolat wrote:

>

Things like DUB and NPM replaces attention by trust.

The big difference between RPM and dub is that one solve that problem for me while imposing it's worldview on me like it's on a mission from god and the other just works.

April 25, 2022
On Mon, Apr 25, 2022 at 04:05:10PM +0000, deadalnix via Digitalmars-d wrote:
> On Monday, 25 April 2022 at 11:18:57 UTC, bauss wrote:
> > This discussion would never have happened if the project was just created with dub in mind from the beginning, like if it was built using dub since the beginning and not with make, or at the very least both.
> 
> Good, what's you plan to get every project restarted from scratch using dub?

One ideological struggle I have with dub is that it imposes its worldview upon your project, instead of fitting itself into what already exists, like many other systems do.

I've worked with integrating software with OS package managers, for example, and they often involve simply adding some files, or maybe a subdirectory or two, to your existing source tree, and the packaging tools pick it up from there.  None of them involve mandatory, dictated-from-above reorganization of the source tree structure to fit its ideals (such a thing would have quickly become too onerous to use -- people would just give up trying to cater to the system, and the repository would just stagnate from a dearth of people who are willing to go far enough to satisfy its whims).

Or take the old workhorse Make, which everybody (including myself) hates. It does not require you to reorganize your source tree to fits its worldview; all it needs is to add a Makefile with the right contents, and it Just Works(tm).  The same can be said for a multitude of other Make-replacement build systems.

But not so for dub. It demands that you conform to its conventions, otherwise it flat out doesn't work (or refuses to).  It doesn't play well with external tools: it's theoretically *possible* to invoke other tools if you ask really nicely, but it's glued on as an afterthought, the core design obviously does not acknowledge such usage.  It does not support customization -- you either do things its way, or the highway.

And most importantly of all -- it does not integrate nicely with existing codebases that are already working with a different system. This is especially bad for a small ecosystem that's trying to grow. When the hurdle to adoption involves such efforts as restructuring your entire danged source tree to fit dub's completely (and needlessly) arbitrary requirements, guess how many eager projects are rushing to contribute.


T

-- 
A program should be written to model the concepts of the task it performs rather than the physical world or a process because this maximizes the potential for it to be applied to tasks that are conceptually similar and, more important, to tasks that have not yet been conceived. -- Michael B. Allen
April 25, 2022

On Monday, 25 April 2022 at 14:48:47 UTC, drug wrote:

>

Dub is much more easier than conan (we use it all over the place). Although conan works with binary artifacts in contrast to dub working with source code so dub and conan can't be compared easily.

I am very sceptical of distributing binaries without very restrictive maintainers. Microsoft has something called vcpkg. I have no idea how that works, but they might be big enough to sustain it.

April 25, 2022

On Monday, 25 April 2022 at 12:45:39 UTC, Ola Fosheim Grøstad wrote:

>

All I can say is that I wasn't pleased when small trivial tweak on the webserver turned into a longer debugging-session… (I wasn't planning on upgrading anything, just wanted to add a line of code.)

If you interpret your anecdote differently, it says that framework Flask subscribed to a >= dependency and got exactly what it asked for: unlimited breaking changes.
A solution would have been to make the build system even more restrictive :) and disallow that anti-pattern, in order to improve your life, as a user of the dependency.
Because there is one maintainer that needs to make a change, and much more users that will suffer.

Similarly, it seems in this thread people misunderstand what the declarative restrictions of DUB are about.

Yes, with make you can do "everything".

But can you write a macOS tool that takes a Makefile and build an Universal Binary from a make recipe that builds a single architecture binary? You can't because a Makefile can do anything and it fully imperative, nothing describes where the binary is, or architectures.
But with dub you can do that, because it's all declarative.

Can you write a tool that analyze all your dependent packages, get number of open issues and compute total LOC of the project? yes.
Can you get all import paths of the binary and dependencies, and generate an IDE project from that? yes.
Can you get a new architecture for free with the same recipe? yes.

cf: least power for the job => https://www.w3.org/2001/tag/doc/leastPower.html

April 25, 2022

On Monday, 25 April 2022 at 19:17:37 UTC, Guillaume Piolat wrote:

>

Similarly, it seems in this thread people misunderstand what the declarative restrictions of DUB are about.

Dude, we understand.

That condescending attitude is exactly how dub got as bad as it got.

April 25, 2022

On Monday, 25 April 2022 at 19:17:37 UTC, Guillaume Piolat wrote:

>

cf: least power for the job => https://www.w3.org/2001/tag/doc/leastPower.html

The least power for the job definitively implies not inserting a build system in the package manager.

April 26, 2022
On Monday, 25 April 2022 at 17:07:18 UTC, H. S. Teoh wrote:

> I've worked with integrating software with OS package managers, for example, and they often involve simply adding some files, or maybe a subdirectory or two, to your existing source tree, and the packaging tools pick it up from there.  None of them involve mandatory, dictated-from-above reorganization of the source tree structure to fit its ideals (such a thing would have quickly become too onerous to use -- people would just give up trying to cater to the system, and the repository would just stagnate from a dearth of people who are willing to go far enough to satisfy its whims).
>
> Or take the old workhorse Make, which everybody (including myself) hates. It does not require you to reorganize your source tree to fits its worldview; all it needs is to add a Makefile with the right contents, and it Just Works(tm).  The same can be said for a multitude of other Make-replacement build systems.
>
> But not so for dub. It demands that you conform to its conventions, otherwise it flat out doesn't work (or refuses to).  It doesn't play well with external tools: it's theoretically *possible* to invoke other tools if you ask really nicely, but it's glued on as an afterthought, the core design obviously does not acknowledge such usage.  It does not support customization -- you either do things its way, or the highway.


dub does *not* require you to use a specific structure for your source tree. It has a default that it looks for if none is specified ("source" or "src" subdirectories), but you have options to set it up however you'd like with the directives "sourcePaths", "sourceFiles", and "importPaths". You can output your binary to "targetPath" and use "workingDirectory" to specify where the executable should be run. It's missing a "libPaths" directive, but you can set that up for specific linkers via "lflags".


April 26, 2022

On Monday, 25 April 2022 at 20:12:19 UTC, deadalnix wrote:

>

The least power for the job definitively implies not inserting a build system in the package manager.

I'm posting in reply to deadalnix, but my comments are not directed at him specifically.

dub exists because it filled a huge, gaping hole in the D ecosystem.

Go back far enough and you'll find "build", later renamed "bud", by Derek Parnell. This was the first D build tool the community rallied around. Several D users adopted it.

https://www.digitalmars.com/d/archives/digitalmars/D/40914.html

Gregor Richards wasn't happy with bud, so he created "Rebuild" as an alternative build tool, but added a package manager on top of it called "DSSS" (D Shared Software System). Rebuild actually parsed source files looking for custom pragmas, and IIRC DSSS could install packages from multiple locations (svn, git, etc). Several D libraries users adopted it.

https://forum.dlang.org/thread/f06hsi$ng1$2@digitalmars.com

So let me tell you, this sounds but it was also a serious PITA as a library maintainer. You had the bud crowd demanding support for bud, the dsss crowd demanding support for dsss, and the crowd who refused to use either because make was good enough. At one point I had three platform-specific make files, a dsss.conf, and a forbud.txt (I eventually replaced some of that with a buildme.d file).

There was no standard way of building D projects, and it sucked. Then Derek and Gregor disappeared, and suddenly these build systems everyone is using are no longer supported. No one takes them over, so we're in the Dark Ages again. Then dub comes along and saves the day.

It caught on quickly. Then people start thinking: "What happens if Sönke disappears? This should be an official D thing." So dub gets added to the installation. And here we are.

Without dub, we would not have the ecosystem that we do have. Personally, I love it. It makes using dependencies a snap. I'm happy with the default source tree expectations, and I don't mind compiling C libraries separately when I need them.

But I understand that no everyone is going to be happy with it (I don't understand the level of hatred some people direct at it, but I just chalk it up as "they aren't happy with it" and move on).

The question is, what exactly is dub missing and how can it be improved? Which perceived shortcomings are reasonable to address and which are not? And assuming we can answer those questions, who is going to address them?

We tried to secure funding a while back for someone to oversee development more actively since Sönke is too busy to spend the time on it that he used to, but that didn't happen. And no one on the core team has the time needed to steer the project. So until one of those things changes, the only way it's going to happen is if one or more people step up and make it happen.

So I propose someone, anyone, who has an interest in seeing dub evolve raise their hand and take on the task of gathering requirements. Not dive in and start refactoring code, not sit down and write a new build tool, but to gather the gripes and complaints from bitch sessions here and on Discord and distill them into lists of needs, wants, and nice-to-haves. (I'd do it myself, but I just don't have the time.)

Then that list can be a starting point for a plan to move forward. I'm sure I can put together a team of interested parties willing to donate a little of their time to provide input on formulating that plan. Then we can look at how to actually get the work done, e.g., putting out a task list that contributors can spend time on, picking out more complicated tasks for contract work funded from our ecosystem fund, etc.

So please, someone take all this energy directed at telling us all how terrible dub is and take the first step toward redirecting at turning dub into something more of us are willing to use.

April 26, 2022
On Monday, 25 April 2022 at 14:48:47 UTC, drug wrote:
> On 25.04.2022 07:54, norm wrote:
>> 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.
>
> Dub is much more easier than conan (we use it all over the place). Although conan works with binary artifacts in contrast to dub working with source code so dub and conan can't be compared easily.

Conan works with either packaged binaries or packaged sources. I think the comparison is valid. I also disagree that dub is easier. Sure it is much simpler to get started for trivial projects but with any non-trivial project you end up hitting its walled garden pretty hard.