www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - On Dub

reply Russel Winder via Digitalmars-d <digitalmars-d puremagic.com> writes:
Dub has a "run" capability, but apparently no "install" one. Also it
appears to leave compilation products inside the ~/.dub directory.

Go puts compiled executables into $GOPATH/bin or $GOBIN and packages in
$GOPATH/pkg which separates nicely downloaded repository clones from
compilation products.

Cargo puts compilation products into the using project tree and not the
~/.cargo tree.

For me, wanting to use ~/.dub, with three different architectures,
having compilation products in that directory is a bad idea. Whilst go
and cargo have different solutions to this, both are better than what
dub currently appears to do. Unless I am missing something=E2=80=A6
=C2=A0
--=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 17 2016
next sibling parent reply rsw0x <anonymous anonymous.com> writes:
On Sunday, 17 January 2016 at 11:21:41 UTC, Russel Winder wrote:
 Dub has a "run" capability, but apparently no "install" one. 
 Also it appears to leave compilation products inside the ~/.dub 
 directory.

 Go puts compiled executables into $GOPATH/bin or $GOBIN and 
 packages in $GOPATH/pkg which separates nicely downloaded 
 repository clones from compilation products.

 Cargo puts compilation products into the using project tree and 
 not the ~/.cargo tree.

 For me, wanting to use ~/.dub, with three different 
 architectures,
 having compilation products in that directory is a bad idea. 
 Whilst go
 and cargo have different solutions to this, both are better 
 than what
 dub currently appears to do. Unless I am missing something…
dub should be using the $XDG_CACHE_HOME/dub (or $HOME/.cache/dub if it's not set) for storing build files to abide by XDG standards.
Jan 17 2016
parent Russel Winder via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Sun, 2016-01-17 at 12:04 +0000, rsw0x via Digitalmars-d wrote:

=20
 dub should be using the $XDG_CACHE_HOME/dub (or $HOME/.cache/dub=C2=A0
 if it's not set) for storing build files to abide by XDG=C2=A0
 standards.
True, but this is a Linux thing and, as we know, people will insist on using Windows and OSX.=C2=A0 ;-) --=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 17 2016
prev sibling next sibling parent reply Guillaume Piolat <name.lastname gmail.com> writes:
On Sunday, 17 January 2016 at 11:21:41 UTC, Russel Winder wrote:
 Cargo puts compilation products into the using project tree and 
 not the ~/.cargo tree.
Sönke said once that DUB used to work like Cargo and not have packages installed globally, and then users asked for a change. While I would also like DUB to work like cargo, the pluses and minuses were probably carefully evaluated.
Jan 17 2016
next sibling parent reply Russel Winder via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Sun, 2016-01-17 at 12:17 +0000, Guillaume Piolat via Digitalmars-d
wrote:
 On Sunday, 17 January 2016 at 11:21:41 UTC, Russel Winder wrote:
 Cargo puts compilation products into the using project tree and=C2=A0
 not the ~/.cargo tree.
=20
=20 S=C3=B6nke said once that DUB used to work like Cargo and not have=C2=A0 packages installed globally, and then users asked for a change.=C2=A0 While I would also like DUB to work like cargo, the pluses and=C2=A0 minuses were probably carefully evaluated.
S=C3=B6nke was doing things right, and the user who moaned were and are clearly wrong. Dub should behave either like Go or Cargo, or something equally good at separating downloaded source from compilation products. The current state is a blocker to Dub usage. --=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 17 2016
parent reply rsw0x <anonymous anonymous.com> writes:
On Sunday, 17 January 2016 at 12:32:47 UTC, Russel Winder wrote:
 On Sun, 2016-01-17 at 12:17 +0000, Guillaume Piolat via 
 Digitalmars-d wrote:
 On Sunday, 17 January 2016 at 11:21:41 UTC, Russel Winder 
 wrote:
 Cargo puts compilation products into the using project tree 
 and not the ~/.cargo tree.
 
Sönke said once that DUB used to work like Cargo and not have packages installed globally, and then users asked for a change. While I would also like DUB to work like cargo, the pluses and minuses were probably carefully evaluated.
Sönke was doing things right, and the user who moaned were and are clearly wrong. Dub should behave either like Go or Cargo, or something equally good at separating downloaded source from compilation products. The current state is a blocker to Dub usage.
It wouldn't be a very big change to just adhere to $DUBPPATH if it exists, which seems to be your major gripe about Go vs Dub.
Jan 17 2016
parent reply Russel Winder via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Sun, 2016-01-17 at 12:39 +0000, rsw0x via Digitalmars-d wrote:
=20
[=E2=80=A6]
 It wouldn't be a very big change to just adhere to $DUBPPATH if=C2=A0
 it exists, which seems to be your major gripe about Go vs Dub.
My gripe is that Dub is neither Cargo (doesn't have install, compiles in the project) nor Go (installs to a known place determined by environment variable, compiles to a known place =E2=80=93 or a transitory p= lace somewhere temporary). Currently I am favouring the Go way rather than the Cargo way. Obviously SCons and CMake have a far better story on all this making and installing, but they do not do dependency management. If Dub was changed to use environment variables to specify where compilation products went rather than just putting it in ~/.dub, and there was a way of installing executables to a place specified by an install variable, then things would be nicer. --=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 17 2016
parent rsw0x <anonymous anonymous.com> writes:
On Sunday, 17 January 2016 at 15:34:13 UTC, Russel Winder wrote:
 On Sun, 2016-01-17 at 12:39 +0000, rsw0x via Digitalmars-d 
 wrote:
 
[…]
 It wouldn't be a very big change to just adhere to $DUBPPATH 
 if it exists, which seems to be your major gripe about Go vs 
 Dub.
My gripe is that Dub is neither Cargo (doesn't have install, compiles in the project) nor Go (installs to a known place determined by environment variable, compiles to a known place – or a transitory place somewhere temporary). Currently I am favouring the Go way rather than the Cargo way. Obviously SCons and CMake have a far better story on all this making and installing, but they do not do dependency management. If Dub was changed to use environment variables to specify where compilation products went rather than just putting it in ~/.dub, and there was a way of installing executables to a place specified by an install variable, then things would be nicer.
The cargo-like behavior(I believe?) is almost implemented, there's a single issue left that would enable a flag so that dub just stores everything in a .dub/ folder in the current project directory. See this issue https://github.com/D-Programming-Language/dub/issues/319
Jan 17 2016
prev sibling parent Russel Winder via Digitalmars-d <digitalmars-d puremagic.com> writes:
On reflection the Cargo way of working only works if you clean
everything and rebuild everything every time. The Go way of working
allows to trivially switch the output of the compilation products by a
simple change of environment variable.

Go's way of vendoring does however suck.

--=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 17 2016
prev sibling next sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2016-01-17 12:21, Russel Winder via Digitalmars-d wrote:

 Dub has a "run" capability, but apparently no "install" one.
I think the reason for the missing "install" command is that most packagers will claim that software should only be installed through the system package manager. -- /Jacob Carlborg
Jan 17 2016
parent Russel Winder via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Sun, 2016-01-17 at 13:47 +0100, Jacob Carlborg via Digitalmars-d
wrote:
 On 2016-01-17 12:21, Russel Winder via Digitalmars-d wrote:
=20
 Dub has a "run" capability, but apparently no "install" one.
=20 I think the reason for the missing "install" command is that most=C2=A0 packagers will claim that software should only be installed through the=C2=A0 system package manager.
Indeed, I allow no executables in /bin /usr/bin unless put there by the system package manager. This is just being sensible. However I have a ~/Built hierarchy in which I put everything I build. With SCons, CMake, Autotools, etc. it is trivially easy to specify a destination location for installation. Go makes things a bit awkward, but their solution is cross-platform and so has some backing and rationale. Cargo doesn't have an install per se, but I bet there is a plugin for that. --=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 17 2016
prev sibling parent Martin Nowak <code dawg.eu> writes:
On Sunday, 17 January 2016 at 11:21:41 UTC, Russel Winder wrote:
 Dub has a "run" capability, but apparently no "install" one. 
 Also it appears to leave compilation products inside the ~/.dub 
 directory.
Well run already runs the binary, so you can just use that `dub run myprog -- args`. Anything that installs binaries to some common `.dub/bin` path will have to deal with colliding binaries, different versions of packages, and w/ shared libraries in the package folders or somewhere else. If you figured out all of this, here is the install command https://github.com/D-Programming-Language/dub/blob/fe02126ea2ca7d58eab31797d4efe4a8b4878c9b/source/dub/commandline.d#L1131.
Jan 17 2016