September 04, 2014
On 9/4/2014 4:51 PM, Jordi Sayol via Digitalmars-d-announce wrote:
> El 04/09/14 a les 22:17, Nick Sabalausky via Digitalmars-d-announce ha escrit:
>>> What I'm doing wrong?
>>
>> dvm install dvm
>
> On Debian testing (mate desktop) without ~/.dvm dir, dmd still not found:
> ----
> $ dvm install dvm
> $ dvm install 2.065.0
> Fetching: http://ftp.digitalmars.com/dmd.2.065.0.zip
> [========================================>] 50581/49347 KB
>
> Installing: dmd-2.065.0
> $ dvm use 2.065.0
> $ dmd
> bash: dmd: command not found
> ----
>
> BTW Is there a reason to mandatory copy dvm to ~/.dvm/bin directory?
>

Hmm, may wanna check your .bashrc. Unless it's changed since last time I looked, the Posix versions of dvm work by adding code to .bashrc which set up "dmd" as an alias.

Then again, I'm not sure that should matter if you're manually running "dvm use ...".

Are you maybe not using bash?

September 04, 2014
El 05/09/14 a les 00:30, Nick Sabalausky via Digitalmars-d-announce ha escrit:
> On 9/4/2014 4:51 PM, Jordi Sayol via Digitalmars-d-announce wrote:
>> El 04/09/14 a les 22:17, Nick Sabalausky via Digitalmars-d-announce ha escrit:
>>>> What I'm doing wrong?
>>>
>>> dvm install dvm
>>
>> On Debian testing (mate desktop) without ~/.dvm dir, dmd still not found:
>> ----
>> $ dvm install dvm
>> $ dvm install 2.065.0
>> Fetching: http://ftp.digitalmars.com/dmd.2.065.0.zip
>> [========================================>] 50581/49347 KB
>>
>> Installing: dmd-2.065.0
>> $ dvm use 2.065.0
>> $ dmd
>> bash: dmd: command not found
>> ----
>>
>> BTW Is there a reason to mandatory copy dvm to ~/.dvm/bin directory?
>>
> 
> Hmm, may wanna check your .bashrc. Unless it's changed since last time I looked, the Posix versions of dvm work by adding code to .bashrc which set up "dmd" as an alias.
> 
> Then again, I'm not sure that should matter if you're manually running "dvm use ...".
> 
> Are you maybe not using bash?
> 
> 

GNU bash, version 4.3.24(1)-release (i586-pc-linux-gnu)

-- 
Jordi Sayol
September 05, 2014
On 04/09/14 21:50, Jordi Sayol via Digitalmars-d-announce wrote:
> El 03/09/14 a les 08:10, Jacob Carlborg via Digitalmars-d-announce ha escrit:
>> I only chose Debian because it's a stable/old system with a high chance of being binary compatible with other distributions.
>
> On Debian 7.6 64-bit I got this error:
> ----
> $ dvm
> dvm: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by dvm)
> ----
> "libc6" on Debian 7.6 (stable) is v2.13.

Hmm, ok. I'm pretty sure I'm using a vanilla Debian 7 for building the 64bit release. I'm not sure the exact minor version.

> On Debian testing:
>
> ----
> $ dvm install 2.065.0
> Fetching: http://ftp.digitalmars.com/dmd.2.065.0.zip
> [========================================>] 50581/49347 KB
>
> Installing: dmd-2.065.0
> An unknown error occurred:
> tango.core.Exception.IOException@/home/doob/development/d/tango/tango/core/Exception.d(59): /home/jordi/.dvm/bin/dmd-2.065.0 :: No such file or directory
> ...
> ----
>
> After manually created this directory and properly install dmd 2.065.0:
>
> ----
> $ dvm use 2.065.0
> $ dmd
> bash: dmd: command not found
> ----
>
> What I'm doing wrong?

You need to install DVM first: "dvm install dvm".

-- 
/Jacob Carlborg
September 05, 2014
On 04/09/14 22:51, Jordi Sayol via Digitalmars-d-announce wrote:

> On Debian testing (mate desktop) without ~/.dvm dir, dmd still not found:
> ----
> $ dvm install dvm
> $ dvm install 2.065.0
> Fetching: http://ftp.digitalmars.com/dmd.2.065.0.zip
> [========================================>] 50581/49347 KB
>
> Installing: dmd-2.065.0
> $ dvm use 2.065.0
> $ dmd
> bash: dmd: command not found
> ----
>
> BTW Is there a reason to mandatory copy dvm to ~/.dvm/bin directory?

Yes. DVM works like this:

* When invoking "dvm" on the command line a bash function is actually called

* The bash function will forward to the "dvm" executable located in ~/.dvm/bin

* When running "dvm use 2.065.0" the executable it will write a shell script setting up the PATH variable to point to path of the install compiler with the specified version. In this case which will be ~/.dvm/compilers/dmd-2.065.0/linux/bin

* When the "dvm" executable has finished running the "dvm" function will source the shell script which modifies the PATH variable in the current session

This is the only why I found to propagate environment variables from a child process (dvm) to the parent process (the shell)

When running "dvm install dvm", dvm will do the following:

* Setup the necessary directory structure in "~/.dvm"

* Install the shell script containing [1] the "dvm" bash function to ~/.dvm/scripts

* Copy itself to ~/.dvm/bin

* Add a couple of lines to .bash_profile or .bashrc that sources the "dvm" script:

if [ -s ~/.dvm/scripts/dvm ] ; then
  . ~/.dvm/scripts/dvm
fi

I wanted the installation process to be as easy as possible, what's why I wrote an installer in the tool. Yes I know, that's not how most tools work like. But it do require some special setup and most tools don't require.

[1] https://github.com/jacob-carlborg/dvm/blob/master/resources/dvm.sh

-- 
/Jacob Carlborg
September 05, 2014
On 05/09/14 00:30, Nick Sabalausky wrote:

> Then again, I'm not sure that should matter if you're manually running
> "dvm use ...".

Yes it will matter. It's the DVM bash function that makes everything work with the PATH variable.

-- 
/Jacob Carlborg
September 05, 2014
On 05/09/14 01:02, Jordi Sayol via Digitalmars-d-announce wrote:

> GNU bash, version 4.3.24(1)-release (i586-pc-linux-gnu)

You can validate the installation by running:

$ type dvm | head -n 1

It should print "dvm is a function". If it doesn't, dvm is not installed correctly.

-- 
/Jacob Carlborg
September 05, 2014
On 04/09/14 21:53, Jordi Sayol via Digitalmars-d-announce wrote:
> Sorry, i forget to mention that on Debian testing, my desktop is Mate <http://mate-desktop.org/>

Actually, I'm using Mate as well. Perhaps that's the issue.

-- 
/Jacob Carlborg
September 05, 2014
On Friday, 5 September 2014 at 06:26:30 UTC, Jacob Carlborg wrote:
> On 04/09/14 21:53, Jordi Sayol via Digitalmars-d-announce wrote:
>> Sorry, i forget to mention that on Debian testing, my desktop is Mate <http://mate-desktop.org/>
>
> Actually, I'm using Mate as well. Perhaps that's the issue.

Unlikely. DVM seems to work really the same as RVM (for Ruby). Similar problems with RVM usually come from problems with the shell profile. Mostly it can be solved by starting a new shell or sourcing the .bash_profile script in your current shell (it's only read at startup):

    . ~/.bash_profile
or
    . ~/.bashrc
September 05, 2014
On Thursday, 4 September 2014 at 18:24:10 UTC, Jacob Carlborg wrote:
> On 2014-09-04 10:40, Chris wrote:
>
>> Weird, I did try the zero at the end (as described on the homepage*),
>> yet I got an error. Maybe I typed a comma instead of a "." without
>> realizing it. However, I'm almost sure I didn't type the zero when
>> installing 2.066 and I got the right version.
>
> DVM just takes the argument you give it, in this case 2.066. Then it prepends "dmd." and appends ".zip" forming something like this:
>
> dmd.2.066.zip
>
> Then it prepends "ftp://ftp.digitalmars.com/" to that filename. If there is a file matching that name in the Digital Mars FTP it will work. As you can see, there is no file named "dmd.2.066.zip", so you must have used "2.066.0".

Chances are I did, yeah. It's hard to remember later what I typed exactly once the shell is closed. Would there be a way to download the latest version by default, if the user types "install 2.066" or just "install [dmd]"? If there isn't, what could be done on the dmd side of things to facilitate this? DVM is a pretty handy tool, but it still has some rough edges. I think it could one day be part of a D Development Framework (DDF). Please keep it up.

>> If you've seen this mistake several times, maybe it would be good to
>> point it out under "Usage". And maybe having/trying more than one mirror
>> would be good too, if it makes sense for DVM.
>
> There is no mirror, as far as I know.

September 05, 2014
On 05/09/14 10:27, "Marc Schütz" <schuetzm@gmx.net>" wrote:
> On Friday, 5 September 2014 at 06:26:30 UTC, Jacob Carlborg wrote:
>> On 04/09/14 21:53, Jordi Sayol via Digitalmars-d-announce wrote:
>>> Sorry, i forget to mention that on Debian testing, my desktop is Mate
>>> <http://mate-desktop.org/>
>>
>> Actually, I'm using Mate as well. Perhaps that's the issue.
>
> Unlikely. DVM seems to work really the same as RVM (for Ruby). Similar
> problems with RVM usually come from problems with the shell profile.
> Mostly it can be solved by starting a new shell or sourcing the
> .bash_profile script in your current shell (it's only read at startup):
>
>      . ~/.bash_profile
> or
>      . ~/.bashrc

Yes, it works basically the same as RVM, but it's written in D (mostly) instead of shell script.

I was more thinking of the issue with wrong version of Glibc, which is unrelated to the shell.

-- 
/Jacob Carlborg