Dub support was added to Meson

Russel Winder russel at winder.org.uk
Mon Aug 13 15:31:33 UTC 2018


On Mon, 2018-08-13 at 14:33 +0000, Matthias Klumpp via Digitalmars-d-announce
wrote:
[…]
> This is intentional, see this comment from Jussi: 
> https://github.com/mesonbuild/meson/pull/3592#issuecomment-390421754

I am not entirely sure I agree with everything there, but he is BDFL of the
project so his view wins. 

> Unfortunately, this makes the dub feature almost useless for 
> Linux distro integration.
> However, I hope we might be able to implement reading dub.json 
> files that are locally installed and incorporate D sources from 
> the dependency into the regular Meson build process.

I am rapidly heading this route for SCons: instead of using Dub to create the
libraries just use it to get the sources and then compile the sources as a
sub-project. However I still prefer having a Meson build for the library and
building that way. If however there is a way of using dub.sdl or dub.json that
would be interesting.

> This would mean that Meson's dlang plugin would have to implement 
> quite a bit of dub and dub.json parsing, which is some effort.
> The benefit would be the creation of a near-seamless bridge 
> between the dub and Meson worlds (you'd only have to locally 
> install a dub package), that is also useful for Linux 
> distribution packaging.

Perhaps there is a route whereby there can be a separate Python package to do
this that both Meson and SCons can use? Otherwise it risks there being
implementation of the same code for Meson and SCons separately.

[…]
> Jup, deterministic source lists are useful for split-building 
> stuff efficiently. And globbing sources is possible with Meson, 
> but highly discouraged (and even looks ugly).

I am not entirely convinced explicit manual lists are better, nor are they
required for consistent builds. If the source files structure changes you have
to create a new build anyway.

What is the ugly globbing way you know – I'm wondering if it better than the
hack I have. 

[…]
> At the moment, I think for a final project, adding Meson files to 
> dependencies still is the better way. However, for quickly 
> testing out things and for building something locally, the new 
> dub support is quite valuable.
> Also, we can expand it in future, this is a first step :-)

I get the feeling Meson Rust/Cargo support is easier and better than D/Dub
support, even though D seems to get more publicity in the Meson documentation.

I think a really good way forward for Meson (and analogously SCons) would be
to have the Dub dub.{json,sdl} file usable to create (and deploy if using
shared objects) a Meson (Scons) build of the dependency and then building the
project based on the created dependencies.

-- 
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-announce/attachments/20180813/0e591089/attachment.sig>


More information about the Digitalmars-d-announce mailing list