www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Rust's simple download script

reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Rust has a nice way to download at 
https://www.rust-lang.org/downloads.html for Posix:

$ curl -sSf https://static.rust-lang.org/rustup.sh | sh -s --

The method is simple and transparent. An optional --channel=beta or 
--channel=nightly parameter chooses between a stable release (default), 
beta, or nightly build.

Should we do something similar?


Andrei
Nov 09 2015
next sibling parent reply "H. S. Teoh via Digitalmars-d" <digitalmars-d puremagic.com> writes:
On Mon, Nov 09, 2015 at 06:07:57PM -0500, Andrei Alexandrescu via Digitalmars-d
wrote:
 Rust has a nice way to download at
 https://www.rust-lang.org/downloads.html for Posix:
 
 $ curl -sSf https://static.rust-lang.org/rustup.sh | sh -s --
 
 The method is simple and transparent. An optional --channel=beta or
 --channel=nightly parameter chooses between a stable release
 (default), beta, or nightly build.
 
 Should we do something similar?
[...] Probably... ... though I have to admit that the idea of running a shell script downloaded from some random remote server (and that, as root, as otherwise it probably wouldn't work) scares me. A lot. T -- The irony is that Bill Gates claims to be making a stable operating system and Linus Torvalds claims to be trying to take over the world. -- Anonymous
Nov 09 2015
next sibling parent reply Vladimir Panteleev <thecybershadow.lists gmail.com> writes:
On Monday, 9 November 2015 at 23:13:03 UTC, H. S. Teoh wrote:
 On Mon, Nov 09, 2015 at 06:07:57PM -0500, Andrei Alexandrescu 
 via Digitalmars-d wrote:
 Rust has a nice way to download at 
 https://www.rust-lang.org/downloads.html for Posix:
 
 $ curl -sSf https://static.rust-lang.org/rustup.sh | sh -s --
 
 The method is simple and transparent. An optional 
 --channel=beta or --channel=nightly parameter chooses between 
 a stable release (default), beta, or nightly build.
 
 Should we do something similar?
[...] Probably... ... though I have to admit that the idea of running a shell script downloaded from some random remote server (and that, as root, as otherwise it probably wouldn't work) scares me. A lot.
Yeah, piping curl into shell is often criticized. It is convenient, though, so could be provided as an option if enough people show interest. It doesn't have to be run as root, as it can just download and unpack a portable installation (essentially what we have in the zip files). If we do this, it has to be done right (e.g. IIRC putting all code in a function so an interrupted download doesn't run a partial script).
Nov 09 2015
parent Adam D. Ruppe <destructionator gmail.com> writes:
On Monday, 9 November 2015 at 23:19:18 UTC, Vladimir Panteleev 
wrote:
 It doesn't have to be run as root, as it can just download and 
 unpack a portable installation (essentially what we have in the 
 zip files).
when I suggested this to my newbie friend, she found the PATH problem to be a hassle so I did wrapper scripts. What we could do though is download it locally then give them a "D shell" script to set the PATH up. (Or run it automatically in .bashrc or something, but I kinda prefer making it a local script they can run without changing any shared files)
Nov 09 2015
prev sibling next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 11/09/2015 06:09 PM, H. S. Teoh via Digitalmars-d wrote:
 On Mon, Nov 09, 2015 at 06:07:57PM -0500, Andrei Alexandrescu via
Digitalmars-d wrote:
 Rust has a nice way to download at
 https://www.rust-lang.org/downloads.html for Posix:

 $ curl -sSf https://static.rust-lang.org/rustup.sh | sh -s --

 The method is simple and transparent. An optional --channel=beta or
 --channel=nightly parameter chooses between a stable release
 (default), beta, or nightly build.

 Should we do something similar?
[...] Probably... ... though I have to admit that the idea of running a shell script downloaded from some random remote server (and that, as root, as otherwise it probably wouldn't work) scares me. A lot.
Piping through less would be a natural first thing to do. Also, let's not forget that installing from the same site carries the same risks. -- Andrei
Nov 09 2015
parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Tuesday, 10 November 2015 at 00:42:24 UTC, Andrei Alexandrescu 
wrote:
 Piping through less would be a natural first thing to do. Also, 
 let's not forget that installing from the same site carries the 
 same risks. -- Andrei
Not necessarily. At least a separate download gives you a chance to verify the download was completed too. Piping direct into shell could deliver an end-of-file in the middle of a file (e.g. in the case of a network error) which might change the results. Most likely result is a half-finished installation leaving not-working garbage on your system, but it might also run a different command... rm -r /yourfile is what it is supposed to do, but instead you received `rm -r /` <end of file>... oops. With a separate download you can at least verify the whole thing was there before running it.
Nov 09 2015
next sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 11/09/2015 07:46 PM, Adam D. Ruppe wrote:
 On Tuesday, 10 November 2015 at 00:42:24 UTC, Andrei Alexandrescu wrote:
 Piping through less would be a natural first thing to do. Also, let's
 not forget that installing from the same site carries the same risks.
 -- Andrei
Not necessarily. At least a separate download gives you a chance to verify the download was completed too. Piping direct into shell could deliver an end-of-file in the middle of a file (e.g. in the case of a network error) which might change the results. Most likely result is a half-finished installation leaving not-working garbage on your system, but it might also run a different command... rm -r /yourfile is what it is supposed to do, but instead you received `rm -r /` <end of file>... oops.
Color me convinced! -- Andrei
Nov 09 2015
prev sibling next sibling parent Jack Stouffer <jack jackstouffer.com> writes:
On Tuesday, 10 November 2015 at 00:46:39 UTC, Adam D. Ruppe wrote:
 With a separate download you can at least verify the whole 
 thing was there before running it.
Not to mention checksumming it.
Nov 09 2015
prev sibling parent reply qznc <qznc web.de> writes:
On Tuesday, 10 November 2015 at 00:46:39 UTC, Adam D. Ruppe wrote:
 Not necessarily. At least a separate download gives you a 
 chance to verify the download was completed too. Piping direct 
 into shell could deliver an end-of-file in the middle of a file 
 (e.g. in the case of a network error) which might change the 
 results.
From sandstorm.io I know the trick to wrap everything into a function and call it in the end. An EOF will result in a syntax error then.
Nov 10 2015
parent Adam D. Ruppe <destructionator gmail.com> writes:
On Tuesday, 10 November 2015 at 14:53:54 UTC, qznc wrote:
 From sandstorm.io I know the trick to wrap everything into a 
 function and call it in the end. An EOF will result in a syntax 
 error then.
yeah, I guess that combined with https (assuming the user hasn't disabled the annoying ssl checks because they rarely work. seriously, how broken are curl and openssl's install systems for trusted certs? but i digress) But I guess them aren't really too bad, no worse than blindly copy/pasting at least.
Nov 10 2015
prev sibling next sibling parent reply rcorre <ryan rcorre.net> writes:
On Monday, 9 November 2015 at 23:13:03 UTC, H. S. Teoh wrote:
 ... though I have to admit that the idea of running a shell 
 script downloaded from some random remote server (and that, as 
 root, as otherwise it probably wouldn't work) scares me. A lot.


 T
They've already been called out for it: http://curlpipesh.tumblr.com/search/rust I'd rather not see D up there as well...
Nov 09 2015
parent reply Zekereth <paul acheronsoft.com> writes:
On Tuesday, 10 November 2015 at 02:52:11 UTC, rcorre wrote:
 On Monday, 9 November 2015 at 23:13:03 UTC, H. S. Teoh wrote:
 ... though I have to admit that the idea of running a shell 
 script downloaded from some random remote server (and that, as 
 root, as otherwise it probably wouldn't work) scares me. A lot.


 T
They've already been called out for it: http://curlpipesh.tumblr.com/search/rust I'd rather not see D up there as well...
I agree completely. Please NO! What's wrong with the current system? It seems to work just fine for me.
Nov 09 2015
parent reply =?UTF-8?B?TcOhcmNpbw==?= Martins <marcioapm gmail.com> writes:
On Tuesday, 10 November 2015 at 04:43:18 UTC, Zekereth wrote:
...
 I agree completely. Please NO! What's wrong with the current 
 system? It seems to work just fine for me.
Well, you already use D so obviously it works good enough for you. However, there might be a million people out there that would love D, but they don't even give it chance because they don't have the skill or the patience to find out how easy/hard it is install it. Making this extremely obvious and easy can only help.
Nov 10 2015
parent Adam D. Ruppe <destructionator gmail.com> writes:
On Tuesday, 10 November 2015 at 13:39:02 UTC, Márcio Martins 
wrote:
 Well, you already use D so obviously it works good enough for 
 you. However, there might be a million people out there that 
 would love D, but they don't even give it chance because they 
 don't have the skill or the patience to find out how easy/hard 
 it is install it. Making this extremely obvious and easy can 
 only help.
Yeah, this is exactly what happened to a friend of mine. The install instructions as we have them now are complete garbage. They either tell you nothing or actively mislead you with idiocy like copying files all around the system.
Nov 10 2015
prev sibling parent Brad Anderson <eco gnuk.net> writes:
On Monday, 9 November 2015 at 23:13:03 UTC, H. S. Teoh wrote:
 On Mon, Nov 09, 2015 at 06:07:57PM -0500, Andrei Alexandrescu 
 via Digitalmars-d wrote:
 Rust has a nice way to download at 
 https://www.rust-lang.org/downloads.html for Posix:
 
 $ curl -sSf https://static.rust-lang.org/rustup.sh | sh -s --
 
 The method is simple and transparent. An optional 
 --channel=beta or --channel=nightly parameter chooses between 
 a stable release (default), beta, or nightly build.
 
 Should we do something similar?
[...] Probably... ... though I have to admit that the idea of running a shell script downloaded from some random remote server (and that, as root, as otherwise it probably wouldn't work) scares me. A lot. T
I found this article compelling about this subject: https://blog.sandstorm.io/news/2015-09-24-is-curl-bash-insecure-pgp-verified-install.html
Nov 09 2015
prev sibling next sibling parent reply Dicebot <public dicebot.lv> writes:
On Monday, 9 November 2015 at 23:07:57 UTC, Andrei Alexandrescu 
wrote:
 Rust has a nice way to download at 
 https://www.rust-lang.org/downloads.html for Posix:

 $ curl -sSf https://static.rust-lang.org/rustup.sh | sh -s --

 The method is simple and transparent. An optional 
 --channel=beta or --channel=nightly parameter chooses between a 
 stable release (default), beta, or nightly build.

 Should we do something similar?


 Andrei
If there is anything I hate Rust devs for, it is the madness being advertised as "simple and nice" starting point. It is so horrible I can't help but suspect intentional diversion intended to harm developer culture. - teaches people `curl X | sh` is fine and normal and not security abomination - completely ignores system package manager (and pollutes the system) - doesn't solve any interesting problems (i.e. switching between compiler versions)
Nov 09 2015
next sibling parent Adam D. Ruppe <destructionator gmail.com> writes:
On Monday, 9 November 2015 at 23:15:56 UTC, Dicebot wrote:
 - teaches people `curl X | sh` is fine and normal and not 
 security abomination
Well, to be fair, a LOT of users blindly copy/paste anyway... But that script is a whopping 1400 lines too. Yikes, I wouldn't run that just because it is too bloody big. At least mine is small enough to get the gist of what it is doing by eyeballing it for a minute.
Nov 09 2015
prev sibling parent ponce <contact gamesfrommars.fr> writes:
On Monday, 9 November 2015 at 23:15:56 UTC, Dicebot wrote:
 - teaches people `curl X | sh` is fine and normal and not 
 security abomination
There is even a tumblr for that :) http://curlpipesh.tumblr.com/
Nov 10 2015
prev sibling next sibling parent Adam D. Ruppe <destructionator gmail.com> writes:
On Monday, 9 November 2015 at 23:07:57 UTC, Andrei Alexandrescu 
wrote:
 Rust has a nice way to download at 
 https://www.rust-lang.org/downloads.html for Posix:
I actually wrote one for a friend who was having a very hard time getting started: http://arsdnet.net/dcode/install-d.sh Please don't curl | sh it, but you can take a look at what it does. Nothing terribly special, though it does install wrapper scripts system-wide which is a rooty thing.
Nov 09 2015
prev sibling next sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2015-11-10 00:07, Andrei Alexandrescu wrote:
 Rust has a nice way to download at
 https://www.rust-lang.org/downloads.html for Posix:

 $ curl -sSf https://static.rust-lang.org/rustup.sh | sh -s --

 The method is simple and transparent. An optional --channel=beta or
 --channel=nightly parameter chooses between a stable release (default),
 beta, or nightly build.

 Should we do something similar?
A bit long but this will install DVM [1] and the latest compiler: curl -L -o dvm https://github.com/jacob-carlborg/dvm/releases/download/v0.4.4/dvm-0.4.4-osx && chmod +x dvm && ./dvm install dvm && source ~/.dvm/scripts/dvm && dvm install -l And on Windows (with Power Shell) : powershell -Command "Invoke-WebRequest https://github.com/jacob-carlborg/dvm/releases/download/v0.4 4/dvm-0.4.4-win.exe -OutFile dvm.exe" && dvm install dvm && dvm install -l Links to other platforms are available here [1]. [1] https://github.com/jacob-carlborg/dvm -- /Jacob Carlborg
Nov 10 2015
parent reply Steven Schveighoffer <schveiguy yahoo.com> writes:
On 11/10/15 7:50 AM, Jacob Carlborg wrote:
 On 2015-11-10 00:07, Andrei Alexandrescu wrote:
 Rust has a nice way to download at
 https://www.rust-lang.org/downloads.html for Posix:

 $ curl -sSf https://static.rust-lang.org/rustup.sh | sh -s --

 The method is simple and transparent. An optional --channel=beta or
 --channel=nightly parameter chooses between a stable release (default),
 beta, or nightly build.

 Should we do something similar?
A bit long but this will install DVM [1] and the latest compiler: curl -L -o dvm https://github.com/jacob-carlborg/dvm/releases/download/v0.4.4/dvm-0.4.4-osx && chmod +x dvm && ./dvm install dvm && source ~/.dvm/scripts/dvm && dvm install -l And on Windows (with Power Shell) : powershell -Command "Invoke-WebRequest https://github.com/jacob-carlborg/dvm/releases/download/v0.4.4/dvm-0.4.4-win.exe -OutFile dvm.exe" && dvm install dvm && dvm install -l Links to other platforms are available here [1]. [1] https://github.com/jacob-carlborg/dvm
I've been using dvm, and do like it a lot. But I couple issues: 1. Every time I type dvm use, my path adds another directory. Couldn't you just replace the existing dvm path? 2. Every incorrect command given to dvm results in a stack trace. Otherwise, I thoroughly enjoy being able to switch/install compiler versions on a whim. -Steve
Nov 10 2015
next sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2015-11-10 17:56, Steven Schveighoffer wrote:

 I've been using dvm, and do like it a lot. But I couple issues:

 1. Every time I type dvm use, my path adds another directory. Couldn't
 you just replace the existing dvm path?
I guess. It was just easier this way.
 2. Every incorrect command given to dvm results in a stack trace.
Same thing here, laziness. It's best to report issues to github. Pull requests wouldn't hurt either ;)
 Otherwise, I thoroughly enjoy being able to switch/install compiler
 versions on a whim.
Cool, thanks :) -- /Jacob Carlborg
Nov 10 2015
parent reply Steven Schveighoffer <schveiguy yahoo.com> writes:
On 11/10/15 1:52 PM, Jacob Carlborg wrote:
 On 2015-11-10 17:56, Steven Schveighoffer wrote:

 I've been using dvm, and do like it a lot. But I couple issues:

 1. Every time I type dvm use, my path adds another directory. Couldn't
 you just replace the existing dvm path?
I guess. It was just easier this way.
 2. Every incorrect command given to dvm results in a stack trace.
Same thing here, laziness. It's best to report issues to github. Pull requests wouldn't hurt either ;)
will do the first, and the second if I have time ;) Though I don't know if I could go back to using tango. Perhaps for a minor bugfix such as this... -Steve
Nov 10 2015
parent Jacob Carlborg <doob me.com> writes:
On 2015-11-10 20:00, Steven Schveighoffer wrote:

 Though I don't know if I could go back to using tango. Perhaps for a
 minor bugfix such as this...
You're free to use Phobos if you prefer. I've started to modernized the code in a few places when I fixed some bug. -- /Jacob Carlborg
Nov 10 2015
prev sibling next sibling parent reply Chris <wendlec tcd.ie> writes:
On Tuesday, 10 November 2015 at 16:56:50 UTC, Steven 
Schveighoffer wrote:
 I've been using dvm, and do like it a lot. But I couple issues:

 1. Every time I type dvm use, my path adds another directory. 
 Couldn't you just replace the existing dvm path?
 2. Every incorrect command given to dvm results in a stack 
 trace.

 Otherwise, I thoroughly enjoy being able to switch/install 
 compiler versions on a whim.

 -Steve
I too use dvm all the time and I wonder, if we could integrate it with dub one day and extend it to cater for LDC and GDC as well. In fact, without dvm life would be a lot harder and I think it's high time it became part of an official D toolchain alongside dub.
Nov 10 2015
next sibling parent Chris <wendlec tcd.ie> writes:
On Tuesday, 10 November 2015 at 22:30:48 UTC, Chris wrote:
 I too use dvm all the time and I wonder, if we could integrate 
 it with dub one day and extend it to cater for LDC and GDC as 
 well. In fact, without dvm life would be a lot harder and I 
 think it's high time it became part of an official D toolchain 
 alongside dub.
We should bundle all the existing tools and maybe create a minimal GUI for it. We have dub, dvm, dscanner etc. If we bundle these apps, we can create a small but powerful toolchain.
Nov 10 2015
prev sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2015-11-10 23:30, Chris wrote:

 I too use dvm all the time and I wonder, if we could integrate it with
 dub one day and extend it to cater for LDC and GDC as well. In fact,
 without dvm life would be a lot harder and I think it's high time it
 became part of an official D toolchain alongside dub.
The issue is that they (the core developers) don't want Tango in any of the core tools and I don't feel like replacing Tango with Phobos for something that is working perfectly fine as it is. It's even working better, because it doesn't depend on libcurl which has caused a lot of problems. It's not even available by default on Windows. On the other hand. I would like to rewrite DVM from scratch and add support for LDC and GDC as well. That could be an opportunity to remove that dependency on Tango, as long as no new dependencies are added, like libcurl. -- /Jacob Carlborg
Nov 11 2015
parent reply Chris <wendlec tcd.ie> writes:
On Wednesday, 11 November 2015 at 09:48:14 UTC, Jacob Carlborg 
wrote:

 The issue is that they (the core developers) don't want Tango 
 in any of the core tools and I don't feel like replacing Tango 
 with Phobos for something that is working perfectly fine as it 
 is. It's even working better, because it doesn't depend on 
 libcurl which has caused a lot of problems. It's not even 
 available by default on Windows.

 On the other hand. I would like to rewrite DVM from scratch and 
 add support for LDC and GDC as well. That could be an 
 opportunity to remove that dependency on Tango, as long as no 
 new dependencies are added, like libcurl.
I see, but if you're going to rewrite DVM anyway, we might as well start brainstorming now and see what needs to be done, how a possible toolchain integration could / should like and so on. Are there any additional features you or anyone else would like?
Nov 11 2015
next sibling parent Chris <wendlec tcd.ie> writes:
On Wednesday, 11 November 2015 at 09:57:26 UTC, Chris wrote:

 I see, but if you're going to rewrite DVM anyway, we might as 
 well start brainstorming now and see what needs to be done, how 
 a possible toolchain integration could / should like and so on. 
 Are there any additional features you or anyone else would like?
Maybe it's time to have a dedicated tool team, something like a DTools project.
Nov 11 2015
prev sibling parent Jacob Carlborg <doob me.com> writes:
On 2015-11-11 10:57, Chris wrote:

 I see, but if you're going to rewrite DVM anyway, we might as well start
 brainstorming now and see what needs to be done, how a possible
 toolchain integration could / should like and so on. Are there any
 additional features you or anyone else would like?
I'm pretty satisfied with the feature set, except for the missing support for LDC and GDC. There are a bunch of minor things that could be implemented as well. -- /Jacob Carlborg
Nov 11 2015
prev sibling parent reply Rory McGuire via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Tue, Nov 10, 2015 at 6:56 PM, Steven Schveighoffer via Digitalmars-d <
digitalmars-d puremagic.com> wrote:

 I've been using dvm, and do like it a lot. But I couple issues:

 1. Every time I type dvm use, my path adds another directory. Couldn't you
 just replace the existing dvm path?
 2. Every incorrect command given to dvm results in a stack trace.

 Otherwise, I thoroughly enjoy being able to switch/install compiler
 versions on a whim.

 -Steve
I don't use DVM but I do switch compilers fairly easily with: rm /usr/local/dmd/current; ln -s /usr/local/dmd/2.069.0; To install a new compiler I just download the latest .tar.xz and place in /usr/local/dmd/; and then rename "dmd2" directory to version number. Didn't see anyone else post a similar install process. It obviously doesn't have to be installed system wide, I just don't really like installed executables to be writeable by my own user. A bash script based installer for the system I use would be very short and simple.
Nov 13 2015
parent Paolo Invernizzi <paolo.invernizzi no.address> writes:
On Friday, 13 November 2015 at 21:30:35 UTC, Rory McGuire wrote:
 On Tue, Nov 10, 2015 at 6:56 PM, Steven Schveighoffer via 
 Digitalmars-d < digitalmars-d puremagic.com> wrote:

 To install a new compiler I just download the latest .tar.xz 
 and place in /usr/local/dmd/; and then rename "dmd2" directory 
 to version number.
The same here... the most easy way. /P
Nov 14 2015
prev sibling next sibling parent reply =?UTF-8?B?TcOhcmNpbw==?= Martins <marcioapm gmail.com> writes:
On Monday, 9 November 2015 at 23:07:57 UTC, Andrei Alexandrescu 
wrote:
 Rust has a nice way to download at 
 https://www.rust-lang.org/downloads.html for Posix:

 $ curl -sSf https://static.rust-lang.org/rustup.sh | sh -s --

 The method is simple and transparent. An optional 
 --channel=beta or --channel=nightly parameter chooses between a 
 stable release (default), beta, or nightly build.

 Should we do something similar?


 Andrei
I also think curl | sh is bad, but the idea to have a quick no-brain "just works" installation is great. One good step would be providing packages for all major distros and providing a wget | pkginstall command which effectively does the same thing: wget DMD.deb && dpkg -i DMD.deb for Debian/Ubuntu For example, newbies to Ubuntu might not even know what dpkg is so they will not know what to do with a .deb file since their world consists of apt-get mostly. Many people also don't know what x86 or x86_AMD64 stand for so yet another doubt in a potential downloaders mind. Could then combine this with OS detection through user-agent on the website and show the user the most likely option and command-line suggestion. Another thing I would do is not show LDC and GDC in the front page but have a "other options" sort of thing. People are afraid to fail and each decision is a potential failure that will scare new people off. The idea is that people that already use D know where to find the other compilers and more importantly what they are, but someone that does not use D might get intimidated by too many choices they don't have the knowledge to make confidently. If in doubt, A/B test it. :)
Nov 10 2015
next sibling parent anonymous <anonymous example.com> writes:
On 10.11.2015 14:12, Márcio Martins wrote:
 Could then combine this with OS detection through user-agent on the
 website and show the user the most likely option and command-line
 suggestion.
Relevant PR that detects the OS and adds a direct download link to the right file to the homepage: https://github.com/D-Programming-Language/dlang.org/pull/1139
 Another thing I would do is not show LDC and GDC in the front page but
 have a "other options" sort of thing. People are afraid to fail and each
 decision is a potential failure that will scare new people off. The idea
 is that people that already use D know where to find the other compilers
 and more importantly what they are, but someone that does not use D
 might get intimidated by too many choices they don't have the knowledge
 to make confidently.
Exactly.
Nov 10 2015
prev sibling next sibling parent Matt Soucy <msoucy csh.rit.edu> writes:
On 11/10/2015 08:12 AM, M=C3=A1rcio Martins wrote:
 On Monday, 9 November 2015 at 23:07:57 UTC, Andrei Alexandrescu wrote:
 Rust has a nice way to download at https://www.rust-lang.org/downloads=
=2Ehtml for Posix:
 $ curl -sSf https://static.rust-lang.org/rustup.sh | sh -s --

 The method is simple and transparent. An optional --channel=3Dbeta or =
--channel=3Dnightly parameter chooses between a stable release (default),= beta, or nightly build.
 Should we do something similar?


 Andrei
=20 I also think curl | sh is bad, but the idea to have a quick no-brain "j=
ust works" installation is great. One good step would be providing packag= es for all major distros and providing a wget | pkginstall command which = effectively does the same thing: wget DMD.deb && dpkg -i DMD.deb for Debi= an/Ubuntu
=20
 For example, newbies to Ubuntu might not even know what dpkg is so they=
will not know what to do with a .deb file since their world consists of = apt-get mostly. Many people also don't know what x86 or x86_AMD64 stand f= or so yet another doubt in a potential downloaders mind.
=20
 Could then combine this with OS detection through user-agent on the web=
site and show the user the most likely option and command-line suggestion= =2E
=20
 Another thing I would do is not show LDC and GDC in the front page but =
have a "other options" sort of thing. People are afraid to fail and each = decision is a potential failure that will scare new people off. The idea = is that people that already use D know where to find the other compilers = and more importantly what they are, but someone that does not use D might= get intimidated by too many choices they don't have the knowledge to mak= e confidently.
=20
 If in doubt, A/B test it. :)
Debian-based systems have d-apt, though it's hosted on SourceForge, which= is (IMO) rather sketchy as of late. It's quite easy to create something = similar for RPM-based repositories - I set one up on my local server, if = I get some blessing I can post it here or work with others to get it migr= ated to a more official D server. (Preferably soon, I'll lose access to m= y wonderful upload speeds in a few months). I actually don't even install= the RPM directly anymore, I update the repository on my server then just= run `sudo dnf update` like I would for any other update. This doesn't handle every distro and OS, but it can help if we get things= more convenient to install. --=20 Matt Soucy http://msoucy.me/
Nov 10 2015
prev sibling parent Martin Nowak <code+news.digitalmars dawg.eu> writes:
On 11/10/2015 02:12 PM, Márcio Martins wrote:
 
 I also think curl | sh is bad, but the idea to have a quick no-brain
 "just works" installation is great. One good step would be providing
 packages for all major distros and providing a wget | pkginstall command
 which effectively does the same thing: wget DMD.deb && dpkg -i DMD.deb
 for Debian/Ubuntu
Unfortunately it's sudo dpkg -i dmd.deb || true sudo apt-get -fy install because dpkg doesn't resolve/install dependencies on it's own and apt-get can't install local packages. It's simpler with rpm based packages. sudo yum localinstall dmd.rpm sudo dnf install dmd.rpm
Nov 11 2015
prev sibling parent reply Martin Nowak <code+news.digitalmars dawg.eu> writes:
On 11/10/2015 12:07 AM, Andrei Alexandrescu wrote:
 Rust has a nice way to download at
 https://www.rust-lang.org/downloads.html for Posix:
 
 $ curl -sSf https://static.rust-lang.org/rustup.sh | sh -s --
 
 The method is simple and transparent. An optional --channel=beta or
 --channel=nightly parameter chooses between a stable release (default),
 beta, or nightly build.
 
 Should we do something similar?
 
 
 Andrei
Yes, such an installer would be helpful and I already wrote it twice. https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/script/d.rb https://github.com/MartinNowak/heroku-buildpack-d/blob/master/bin/compile This would be fairly simple to adopt (choosing a good default install location, e.g. ~/.dlang) and can already install the latest dmd, gdc, ldc, any specific dmd-2.068.2, ldc-0.16.1-alpha1 version, and dub. This does not replace a good package installer, but is great for simply downloading and testing without doing a system wide installation. For the necessary env changes we could adopt something like virtualenv's activate/deactive, i.e. `source ~/.dlang/dmd-2.069.0/activate` to use dmd-2.069.0. And of course we can activate the env after the download. Disclaimer: I did not just volunteer to write the script but I'm glad to help anyone doing so.
Nov 11 2015
next sibling parent Martin Nowak <code dawg.eu> writes:
On Wednesday, 11 November 2015 at 10:26:09 UTC, Martin Nowak 
wrote:
 Disclaimer: I did not just volunteer to write the script but 
 I'm glad to help anyone doing so.
Nice effect an installer script that makes working with tarballs a snap, would allows us to easily distribute nightlies. http://forum.dlang.org/post/n1vgtk$161g$1 digitalmars.com
Nov 11 2015
prev sibling next sibling parent Martin Nowak <code dawg.eu> writes:
On Wednesday, 11 November 2015 at 10:26:09 UTC, Martin Nowak 
wrote:
 For the necessary env changes we could adopt something like 
 virtualenv's
 activate/deactive, i.e. `source ~/.dlang/dmd-2.069.0/activate` 
 to use
 dmd-2.069.0. And of course we can activate the env after the 
 download.
There is a pull request, try it out and provide feedback. https://trello.com/c/loy1eCRj/136-install-script https://github.com/D-Programming-Language/installer/pull/162
Nov 18 2015
prev sibling parent reply Jacob Carlborg <doob me.com> writes:
On 2015-11-11 11:24, Martin Nowak wrote:

 Yes, such an installer would be helpful and I already wrote it twice.

 https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/script/d.rb
 https://github.com/MartinNowak/heroku-buildpack-d/blob/master/bin/compile

 This would be fairly simple to adopt (choosing a good default install
 location, e.g. ~/.dlang) and can already install the latest dmd, gdc,
 ldc, any specific dmd-2.068.2, ldc-0.16.1-alpha1 version, and dub.

 This does not replace a good package installer, but is great for simply
 downloading and testing without doing a system wide installation.
 For the necessary env changes we could adopt something like virtualenv's
 activate/deactive, i.e. `source ~/.dlang/dmd-2.069.0/activate` to use
 dmd-2.069.0. And of course we can activate the env after the download.

 Disclaimer: I did not just volunteer to write the script but I'm glad to
 help anyone doing so.
DVM already does all this. Why reinvent the wheel? -- /Jacob Carlborg
Nov 18 2015
parent reply Martin Nowak <code dawg.eu> writes:
On Thursday, 19 November 2015 at 07:58:52 UTC, Jacob Carlborg 
wrote:
 DVM already does all this. Why reinvent the wheel?
Because we already have the code for Travis-CI and Heroku. Also an intransparent binary is yet another hurdle trying to convince someone to try out D. BTW, I hust tried to use dvm. The linux binary doesn't work for my distribution (Fedora). ./dvm: error while loading shared libraries: libbz2.so.1.0: cannot open shared object file: No such file or directory Compiling dvm with the latest dmd fails. ../../.dub/packages/tango-1.0.1_2.067/tango/io/vfs/ZipFolder.d(302,27): Error: function tango.io.vfs.ZipFolder.ZipSubFolder.toString cannot have an in contract when overriden function object.Object.toString does not have an in contract ../../.dub/packages/tango-1.0.1_2.067/tango/io/vfs/ZipFolder.d(977,27): Error: function tango.io.vfs.ZipFolder.ZipFile.toString cannot have an in contract when overriden function object.Object.toString does not have an in contract Not too surprising given the amount of code, the number of dependencies, and the lack of any CI testing. I managed to build dvm using dmd-2.067.0 (as indicated by the tango dependency). Apart from the fact that dvm --help offers weird choices (-t, --tango Installs Tango as the standard library.), dvm install --help or dvm --help don't explain how to install a compiler. dvm install dmd-2.068.2 tango.core.Exception.IOException ../../.dub/packages/tango-1.0.1_2.067/tango/c re/Exception.d(59): The resource with URL "http://ftp.digitalmars.com/dmd.dmd-2.068.2.zip" could not be found. dvm install -l An error occurred: dvm.dvm.Exceptions.DvmException .dub/packages/dvm-0.4.4/dvm/co mands/Fetch.d(270): Failed to get the latest DMD version. Looking at strace it seems you're trying to parse http://dlang.org/download.html, please just use http://ftp.digitalmars.com/LATEST instead. After some trial and error it fails to install the selected compiler (and doesn't use the much smaller tar.xz downloads btw). dvm install 2.068.2 Fetching: http://downloads.dlang.org/releases/2.x/2.068.2/dmd.2.068.2.linux.zip [========================================>] 25969/25335 KB Installing: dmd-2.068.2 An unknown error occurred: tango.core.Exception.IOException ../../.dub/packages/tango-1.0.1_2.067/tango/c re/Exception.d(59): /home/dawg/.dvm/bin/dmd-2.068.2 :: No such file or directory All of the above, plus the ability to install gdc/ldc and verify downloaded dmd binaries, are achieved by a ~500LOC bash script. Of course downloading and installing dmd used to be a lot more chaotic when DVM was originally written. But making installations more scriptable is a direct outcome of writing such scripts, which works much better than building complex tools to deal with inconsistencies.
Nov 20 2015
parent Jacob Carlborg <doob me.com> writes:
On 2015-11-20 18:43, Martin Nowak wrote:

 Because we already have the code for Travis-CI and Heroku.
DVM was already available before that ;)
 Also an intransparent binary is yet another hurdle trying to convince
 someone to try out D.
Not sure how much difference that is compared to the other opaque native installers. Also, a 500 LOC bash script is almost as an opaque binary ;)
 BTW, I hust tried to use dvm.

 The linux binary doesn't work for my distribution (Fedora).
 ./dvm: error while loading shared libraries: libbz2.so.1.0: cannot open
 shared object file: No such file or directory
I assume you actually have libz installed and there's some other problem here?
 Compiling dvm with the latest dmd fails.

 ../../.dub/packages/tango-1.0.1_2.067/tango/io/vfs/ZipFolder.d(302,27):
 Error: function tango.io.vfs.ZipFolder.ZipSubFolder.toString cannot have
 an in contract when overriden function object.Object.toString does not
 have an in contract
 ../../.dub/packages/tango-1.0.1_2.067/tango/io/vfs/ZipFolder.d(977,27):
 Error: function tango.io.vfs.ZipFolder.ZipFile.toString cannot have an
 in contract when overriden function object.Object.toString does not have
 an in contract

 Not too surprising given the amount of code, the number of dependencies,
 and the lack of any CI testing.
The issue is that DMD constantly breaks my code. Yes I test the betas, many times the bugs I'm reporting are closed as "won't fix". Every single release of DMD since at least 2.050 broke at least one of my projects. I don't see how any CI testing would help when the code breakage I encounter is not fixed. Anyway, I've updated the dependency and it builds with DMD 2.069.1. The number of dependencies are two. The reason for why I'm still using Tango is the libcurl disaster in Phobos. That has hopefully been fixed now but that means a yet another dependency and which is not installed by default on Windows (perhaps static linking would work).
 I managed to build dvm using dmd-2.067.0 (as indicated by the tango
 dependency).
 Apart from the fact that dvm --help offers weird choices (-t,
 --tango      Installs Tango as the standard library.), dvm install
 --help or dvm --help don't explain how to install a compiler.
The --tango flag is a perfectly reasonable option for a D1 compiler.
 dvm install dmd-2.068.2

 tango.core.Exception.IOException ../../.dub/packages/tango-1.0.1_2.067/tango/core/Exception.d(59):
 The resource with URL "http://ftp.digitalmars.com/dmd.dmd-2.068.2.zip"
 could not be found.

 dvm install -l

 An error occurred:
 dvm.dvm.Exceptions.DvmException .dub/packages/dvm-0.4.4/dvm/commands/Fetch.d(270):
 Failed to get the latest DMD version.


 Looking at strace it seems you're trying to parse
 http://dlang.org/download.html, please just use
 http://ftp.digitalmars.com/LATEST instead.
Yeah, I've noticed that broke. I haven't had time yet to update the code to use LATEST instead.
 After some trial and error it fails to install the selected compiler
 (and doesn't use the much smaller tar.xz downloads btw).
Is the tar.xz archives something that has been announced? I had no idea about it. BTW, I suspect Phobos can't unpack these files. Which either means resorting to third party libraries, something you seem to dislike. Or shell commands, which are not portable.
 dvm install 2.068.2

 Fetching:
 http://downloads.dlang.org/releases/2.x/2.068.2/dmd.2.068.2.linux.zip
 [========================================>] 25969/25335 KB

 Installing: dmd-2.068.2
 An unknown error occurred:
 tango.core.Exception.IOException ../../.dub/packages/tango-1.0.1_2.067/tango/core/Exception.d(59):
 /home/dawg/.dvm/bin/dmd-2.068.2 :: No such file or directory
Have you installed DVM? As Walter would say, bugs reported to the newsgroup will most likely be forgotten.
 All of the above, plus the ability to install gdc/ldc and verify
 downloaded dmd binaries, are achieved by a ~500LOC bash script.

 Of course downloading and installing dmd used to be a lot more chaotic
 when DVM was originally written. But making installations more
 scriptable is a direct outcome of writing such scripts, which works much
 better than building complex tools to deal with inconsistencies.
I guess your script only cares about the latest version, making everything a lot easier. The reason I brought it up because DVM already exist (I guess your script did as well), offers other features as well and works on Windows. -- /Jacob Carlborg
Nov 21 2015