Distributor's whishlist and questions for D

Marco Leise via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 21 10:41:52 PDT 2016


Am Thu, 21 Apr 2016 01:01:01 +0000
schrieb Matthias Klumpp <matthias at tenstral.net>:

> Hello!
> Me bringing dub to Debian (and subsequently Ubuntu) has sparked 
> quite some interest in getting more D applications shipped in 
> Linux distributions.

Having been in a similar situation years ago, I can share my
experience with packaging Dlang libraries and programs.

> ## Why is every D compiler shipping an own version of Phobos?
> If one assumes that the D2 language specification is stable, and 
> D compilers implement it completely, the question is why every 
> compiler is shipping an own copy of Phobos. This is a major pain, 
> since e.g. GDCs Phobos is behind what is documented on dlang.org, 
> but also because the compilers sometimes accidentally use the 
> "wrong" Phobos version (e.g. GDC trying to use the one of LDC), 
> leading to breakage.
> Also, distributors hate code duplication, so deduplicating this 
> would be awesome (druntime being compiler-specific makes sense to 
> me, Phobos not so much...).
> It's not an essential thing, but would be quite nice...

The compiler devs would need to explain the coupling of
druntime and Phobos. What I know is that Dlang's ABI and
Phobos' API are still changing. There are at this very moment
talks about changing the function name mangling, a
deprecation of broken visibility rules and the shared keyword
will need a rewrite at some point in the future.

In practice you have a different Phobos per compiler and
language release. I currently have 9 versions of Phobos
installed, most of them in 4 flavors: 32-bit/64-bit, shared
and static.

> ## Where should D source-code / D interfaces be put?
> If I install a D library or source-only module as a distribution 
> package, where should the sources be put? So far, I have seen:
>   * /usr/include/d
>   * /usr/include/dlang/
>   * /usr/include/d/(dmd|gdc|ldc)
>   * /usr/share/dlang
> Having one canonical path would be awesome ;-)

As explained Phobos is installed in multiple versions, so I
mostly used the compilers' defaults.
For third party libraries I had the same question and figured
the best would be a poll. Since November 2013 over 100 votes
were cast with ~2/3 preferring /usr/include/dlang/
over /usr/include/d/:
http://www.easypolls.net/poll.html?p=52828149e4b06cfb69b97527
This is today the de-facto path on Arch and Gentoo at least.

> ## dub: Where should dub modules be installed?
> ## dub: How to install modules?

For packaging purposes I avoided dub in the past as too much
of a black box, for the flexibility usually expected on Gentoo.
Many packages ship with make files that integrate better with
the system's package manager.

> ## Shared library support in all compilers

+1. For dmd, I changed the default in dmd.conf to link with the
shared Phobos. It's been working pretty well since around
2.065 or so. I also install packages like gtkd with .so

> ## Stable ABI among compilers

I agree with you, but let me add that you need multiple Phobos
versions installed in parallel in some cases. You may have an
app that depends on a library that doesn't compile with the
latest dmd/Phobos. IIRC gtkd for Gtk2 doesn't work on
dmd-2.071 any more.

-- 
Marco



More information about the Digitalmars-d mailing list