www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Using Dub

reply Russel Winder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
Is there any way of setting dub to default to ldc2 rather than dmd as
the compiler of use? (I do not want to have to put --compiler ldc2 on
every dub command.)

--=20
Russel.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder ekiga.n=
et
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
Jan 15 2017
next sibling parent reply Daniel N <ufo orbiting.us> writes:
On Sunday, 15 January 2017 at 13:23:25 UTC, Russel Winder wrote:
 Is there any way of setting dub to default to ldc2 rather than 
 dmd as the compiler of use? (I do not want to have to put 
 --compiler ldc2 on every dub command.)
I have never used dub, but I know it's now also bundled with ldc2. I would assume that if your PATH to ldc2 comes before that of dmd, it would find the ldc2 bundled version of dub and it would do the smart thing(if not, that's a bug).
Jan 15 2017
parent reply Russel Winder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
On Sun, 2017-01-15 at 17:25 +0000, Daniel N via Digitalmars-d-learn
wrote:
 On Sunday, 15 January 2017 at 13:23:25 UTC, Russel Winder wrote:
 Is there any way of setting dub to default to ldc2 rather than=C2=A0
 dmd as the compiler of use? (I do not want to have to put=C2=A0
 --compiler ldc2 on every dub command.)
=20 I have never used dub, but I know it's now also bundled with ldc2.
On the one hand Cargo works wonderfully with Rust so I had hoped Dub would work wonderfully with D. Sadly I am finding it doesn't. Possibly my fault, but still annoying. There is a Dub package in Debian. It seems to default to GDC rather than LDC, which is annoying. Meson defaults to LDC, but getting it to handle the Dub repository is going to be impossible I suspect.
 I would assume that if your PATH to ldc2 comes before that of=C2=A0
 dmd, it would find the ldc2 bundled version of dub and it would=C2=A0
 do the smart thing(if not, that's a bug).
No DMD installed. Seemingly Dub chooses /usr/bin/gdc over /usr/bin/ldc2. :-( --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Jan 16 2017
parent Dejan Lekic <dejan.lekic gmail.com> writes:
On Monday, 16 January 2017 at 09:40:55 UTC, Russel Winder wrote:
 On the one hand Cargo works wonderfully with Rust so I had 
 hoped Dub would work wonderfully with D.  Sadly I am finding it 
 doesn't. Possibly my fault, but still annoying.
Cargo does not have multiple Rust compilers as an option. Dub could look to find for compiler if it is not set, but that may disappoint users who have multiple compilers installed (myself included)...
Jan 16 2017
prev sibling parent reply cym13 <cpicard openmailbox.org> writes:
On Sunday, 15 January 2017 at 13:23:25 UTC, Russel Winder wrote:
 Is there any way of setting dub to default to ldc2 rather than 
 dmd as the compiler of use? (I do not want to have to put 
 --compiler ldc2 on every dub command.)
Create a file ~/.dub/settings.json with the following content: { "defaultCompiler": "ldc2" }
Jan 15 2017
parent reply Russel Winder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
On Sun, 2017-01-15 at 17:44 +0000, cym13 via Digitalmars-d-learn wrote:
 On Sunday, 15 January 2017 at 13:23:25 UTC, Russel Winder wrote:
 Is there any way of setting dub to default to ldc2 rather than=C2=A0
 dmd as the compiler of use? (I do not want to have to put=C2=A0
 --compiler ldc2 on every dub command.)
=20 Create a file ~/.dub/settings.json with the following content: =20 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0{ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0"defaultCompiler":=
=C2=A0"ldc2"
 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0}
Will an SDL file also work? --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Jan 16 2017
parent reply cym13 <cpicard openmailbox.org> writes:
On Monday, 16 January 2017 at 09:42:03 UTC, Russel Winder wrote:
 On Sun, 2017-01-15 at 17:44 +0000, cym13 via 
 Digitalmars-d-learn wrote:
 On Sunday, 15 January 2017 at 13:23:25 UTC, Russel Winder 
 wrote:
 Is there any way of setting dub to default to ldc2 rather 
 than dmd as the compiler of use? (I do not want to have to 
 put --compiler ldc2 on every dub command.)
Create a file ~/.dub/settings.json with the following content:      {          "defaultCompiler": "ldc2"      }
Will an SDL file also work?
I don't think so, but as that's about the only option you can put in that file it's ok to use JSON.
Jan 16 2017
parent reply Russel Winder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
On Mon, 2017-01-16 at 10:47 +0000, cym13 via Digitalmars-d-learn wrote:
 On Monday, 16 January 2017 at 09:42:03 UTC, Russel Winder wrote:
 On Sun, 2017-01-15 at 17:44 +0000, cym13 via=C2=A0
 Digitalmars-d-learn wrote:
 On Sunday, 15 January 2017 at 13:23:25 UTC, Russel Winder=C2=A0
 wrote:
 Is there any way of setting dub to default to ldc2 rather=C2=A0
 than dmd as the compiler of use? (I do not want to have to=C2=A0
 put --compiler ldc2 on every dub command.)
=20 Create a file ~/.dub/settings.json with the following content: =20 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0{ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0"defaultCompile=
r":=C2=A0"ldc2"
 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0}
=20 Will an SDL file also work?
=20 I don't think so, but as that's about the only option you can put=C2=A0 in that file it's ok to use JSON.
I tried it, it failed. :-( Humans should never have to manually write XML or JSON. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Jan 16 2017
parent reply cym13 <cpicard openmailbox.org> writes:
On Monday, 16 January 2017 at 10:59:33 UTC, Russel Winder wrote:
 On Mon, 2017-01-16 at 10:47 +0000, cym13 via 
 Digitalmars-d-learn wrote:
 On Monday, 16 January 2017 at 09:42:03 UTC, Russel Winder 
 wrote:
 On Sun, 2017-01-15 at 17:44 +0000, cym13 via 
 Digitalmars-d-learn wrote:
 On Sunday, 15 January 2017 at 13:23:25 UTC, Russel Winder 
 wrote:
 Is there any way of setting dub to default to ldc2 
 rather than dmd as the compiler of use? (I do not want 
 to have to put --compiler ldc2 on every dub command.)
Create a file ~/.dub/settings.json with the following content:      {          "defaultCompiler": "ldc2"      }
Will an SDL file also work?
I don't think so, but as that's about the only option you can put in that file it's ok to use JSON.
I tried it, it failed. :-( Humans should never have to manually write XML or JSON.
What do you mean it failed? I did that on another computer to test and it works flawlessly for me. This configuration file can contain only two options: default compiler and urls to reach when looking for packets. It's litterally 3 lines, while I support the fact that one should never have to write XML that's about as concise as it can get.
Jan 16 2017
next sibling parent reply cym13 <cpicard openmailbox.org> writes:
On Monday, 16 January 2017 at 16:47:29 UTC, cym13 wrote:
 On Monday, 16 January 2017 at 10:59:33 UTC, Russel Winder wrote:
 On Mon, 2017-01-16 at 10:47 +0000, cym13 via 
 Digitalmars-d-learn wrote:
 On Monday, 16 January 2017 at 09:42:03 UTC, Russel Winder 
 wrote:
 On Sun, 2017-01-15 at 17:44 +0000, cym13 via 
 Digitalmars-d-learn wrote:
 [...]
Will an SDL file also work?
I don't think so, but as that's about the only option you can put in that file it's ok to use JSON.
I tried it, it failed. :-( Humans should never have to manually write XML or JSON.
What do you mean it failed? I did that on another computer to test and it works flawlessly for me. This configuration file can contain only two options: default compiler and urls to reach when looking for packets. It's litterally 3 lines, while I support the fact that one should never have to write XML that's about as concise as it can get.
Oh, maybe you're on windows, in which case the settings.json file must be placed in either $ProgramData\dub or in $APPDATA\dub. Relevant lines of dub.d: https://github.com/dlang/dub/blob/master/source/dub/dub.d#L165
Jan 16 2017
parent Russel Winder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
On Mon, 2017-01-16 at 16:51 +0000, cym13 via Digitalmars-d-learn wrote:
=20
[=E2=80=A6]
 Oh, maybe you're on windows, in which case the settings.json file=C2=A0
 must be placed in either $ProgramData\dub or in $APPDATA\dub.=C2=A0
 Relevant lines of dub.d:=C2=A0
 https://github.com/dlang/dub/blob/master/source/dub/dub.d#L165
Windows is anathema. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Jan 16 2017
prev sibling parent Russel Winder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
On Mon, 2017-01-16 at 16:47 +0000, cym13 via Digitalmars-d-learn wrote:
 [=E2=80=A6]
=20
 What do you mean it failed? I did that on another computer to=C2=A0
 test and it works flawlessly for me.
=20
 [=E2=80=A6]
trying a settings.sdl file failed setting.json works. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder ekiga.n= et 41 Buckmaster Road m: +44 7770 465 077 xmpp: russel winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
Jan 16 2017