oracle / fastr

A high-performance implementation of the R programming language, built on GraalVM.
Other
624 stars 64 forks source link

Installation of ggplot2 fails because of `failed to lock fastr library directory` on macOS #192

Closed TinusChen closed 2 years ago

TinusChen commented 2 years ago

Repro: 'install.packages("ggplot2")'

ERROR: failed to lock directory ‘/Users/tinus.chen/R/x86_64-apple-darwin-library/fastr-21.0.0.2-3.6’ for modifying

Here's the error:

> install.packages("ggplot2")
Installing package into ‘/Users/tinus.chen/R/x86_64-apple-darwin-library/fastr-21.0.0.2-3.6’
(as ‘lib’ is unspecified)
also installing the dependency ‘gtable’

Content type 'application/octet-stream' length 368081 bytes (359 KB)
Content type 'application/octet-stream' length 3204655 bytes (3.1 MB)
ERROR: failed to lock directory ‘/Users/tinus.chen/R/x86_64-apple-darwin-library/fastr-21.0.0.2-3.6’ for modifying
Try removing ‘/Users/tinus.chen/R/x86_64-apple-darwin-library/fastr-21.0.0.2-3.6/00LOCK-gtable’
* installing *source* package ‘ggplot2’ ...
** package ‘ggplot2’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (ggplot2)

The downloaded source packages are in
    ‘/private/var/folders/44/gx8cvxzn511_pr_g39l6t2f40000gn/T/RtmpXYbxMu/downloaded_packages’
Warning message:
In install.packages("ggplot2") :
  installation of package ‘gtable’ had non-zero exit status
> install.packages("ggplot2", INSTALL_opts = c('--no-lock'))
Installing package into ‘/Users/tinus.chen/R/x86_64-apple-darwin-library/fastr-21.0.0.2-3.6’
(as ‘lib’ is unspecified)
Content type 'application/octet-stream' length 3204655 bytes (3.1 MB)
* installing *source* package ‘ggplot2’ ...
** package ‘ggplot2’ successfully unpacked and MD5 sums checked
staged installation is only possible with locking
** using non-staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (ggplot2)

The downloaded source packages are in
    ‘/private/var/folders/44/gx8cvxzn511_pr_g39l6t2f40000gn/T/RtmpXYbxMu/downloaded_packages’

I was able to fix this by running the following commands as a workaround:

install.packages("ggplot2", INSTALL_opts = c('--no-lock'))

The same situation will be encountered when installing another package 'gtable'. This problem can be also solved using the above method.

Env:

graalvm-ce-java11-21.0.0.2
fastr-21.0.0.2-3.6

> version

platform       x86_64-apple-darwin16.7.0       
arch           x86_64                          
os             darwin16.7.0                    
system         x86_64, darwin16.7.0            
major          3                               
minor          6.1                             
year           2019                            
month          07                              
day            05                              
svn rev                                        
language       R                               
engine         FastR                           
version.string FastR version 3.6.1 (2019-07-05)
steve-s commented 2 years ago

Hello TinusChen,

have you tried removing the /Users/tinus.chen/R/x86_64-apple-darwin-library/fastr-21.0.0.2-3.6/00LOCK-gtable directory as the error message suggests? You can do that with

rm -rf /Users/tinus.chen/R/x86_64-apple-darwin-library/fastr-21.0.0.2-3.6/00LOCK-gtable

If you can reproduce this issue again and following the suggestions in the error message:

ERROR: failed to lock directory ‘/Users/tinus.chen/R/x86_64-apple-darwin-library/fastr-21.0.0.2-3.6’ for modifying
Try removing ‘/Users/tinus.chen/R/x86_64-apple-darwin-library/fastr-21.0.0.2-3.6/00LOCK-gtable’

do not fix the problem, then please re-open this issue.

TinusChen commented 2 years ago

Hello TinusChen,

have you tried removing the /Users/tinus.chen/R/x86_64-apple-darwin-library/fastr-21.0.0.2-3.6/00LOCK-gtable directory as the error message suggests? You can do that with

rm -rf /Users/tinus.chen/R/x86_64-apple-darwin-library/fastr-21.0.0.2-3.6/00LOCK-gtable

If you can reproduce this issue again and following the suggestions in the error message:

ERROR: failed to lock directory ‘/Users/tinus.chen/R/x86_64-apple-darwin-library/fastr-21.0.0.2-3.6’ for modifying
Try removing ‘/Users/tinus.chen/R/x86_64-apple-darwin-library/fastr-21.0.0.2-3.6/00LOCK-gtable’

do not fix the problem, then please re-open this issue.

The problem could be also solved by removing the 00LOCK-gtable directory. Thanks for your suggestion.