rvm / rvm

Ruby enVironment Manager (RVM)
https://rvm.io
Other
5.11k stars 1.03k forks source link

don't install version X when Ruby version X is currently being installed in a different window #3439

Open Nowaker opened 9 years ago

Nowaker commented 9 years ago

In one window console window, after cd to a directory with Ruby application:

ruby-2.2.2 is not installed - installing.
ruby-2.2.2 - #removing src/ruby-2.2.2 - please wait
Searching for binary rubies, this might take some time.
...

In a different console window doing cd too:

1 nowaker@nwkr-laptop ..y/virtkick/starter/webapp/engines/saas (git)-[master] % cd .                                                              :(
ruby-2.2.2 is not installed - installing.
ruby-2.2.2 - #removing src/ruby-2.2.2 - please wait
Error running '__rvm_rm_rf /home/nowaker/.rvm/src/ruby-2.2.2',
showing last 15 lines of /home/nowaker/.rvm/log/1433887801_ruby-2.2.2/remove.src.log
+__rvm_rm_rf_verbose:2:> typeset target
+__rvm_rm_rf_verbose:3:> target=/home/nowaker/.rvm/src/ruby-2.2.2 
+__rvm_rm_rf_verbose:7:if> [[ -n 5.0.8 ]]
+__rvm_rm_rf_verbose:9:then> setopt extendedglob
+__rvm_rm_rf_verbose:17:case> case /home/nowaker/.rvm/src/ruby-2.2.2 (*(/|.)@(|/Applications|/Developer|/Guides|/Information|/Library|/Network|/System|/User|/Users|/Volumes|/backups|/bdsm|/bin|/boot|/cores|/data|/dev|/etc|/home|/lib|/lib64|/mach_kernel|/media|/misc|/mnt|/net|/opt|/private|/proc|/root|/sbin|/selinux|/srv|/sys|/tmp|/usr|/var))
+__rvm_rm_rf_verbose:17:case> case /home/nowaker/.rvm/src/ruby-2.2.2 (*)
+__rvm_rm_rf_verbose:24:case if> [[ -z /home/nowaker/.rvm/src/ruby-2.2.2 ]]
+__rvm_rm_rf_verbose:29:case elif> [[ -d /home/nowaker/.rvm/src/ruby-2.2.2 ]]
+__rvm_rm_rf_verbose:31:case elif-then> rm -rf /home/nowaker/.rvm/src/ruby-2.2.2
rm: cannot remove ‘/home/nowaker/.rvm/src/ruby-2.2.2’: Directory not empty
+__rvm_rm_rf_verbose:33:case elif-then cmdor cursh> typeset 'ret=1'
+__rvm_rm_rf_verbose:34:case elif-then cmdor cursh> rvm_debug '__rvm_rm_rf error removing target dir '\''/home/nowaker/.rvm/src/ruby-2.2.2'\''.'
+rvm_debug:2:> ((  0  ))
+rvm_debug:2:cmdor> return 0
+__rvm_rm_rf_verbose:35:case elif-then cmdor cursh> return 1
Searching for binary rubies, this might take some time.

Conslusion: when rvm install X is in progress, the other window shouldn't be able to run the same rvm install X.

merceroncode commented 9 years ago

Some kind of locking mechanism should be implemented for this. I'll see this evening what I can do.