ManuelHentschel / vscDebugger

(Partial) Implementation of the Debug Adapter Protocol for R
https://manuelhentschel.github.io/vscDebugger/
MIT License
90 stars 14 forks source link

Lack of dependency on the svSocket package when install from VSCode R Debugger on Linux #169

Closed eitsupi closed 3 years ago

eitsupi commented 3 years ago

Describe the bug

From the topic in https://github.com/microsoft/vscode-dev-containers/pull/954, I installed the R Debugger on a container connected by Remote-Containers and executed the command to install this package, but the following error occurred.

$ /usr/local/bin/R --no-restore --quiet -f "/home/rstudio/.vscode-server/extensions/rdebugger.r-debugger-0.4.6/R/install.R" --args "https://github.com/ManuelHentschel/VSCode-R-Debugger/releases/download/v0.4.6/vscDebugger_0.4.6.tar.gz"
> repos <- getOption("repos")
> if (is.null(repos) || identical(repos, c(CRAN = "@CRAN@"))) {
+   options(repos = c(CRAN = "https://cloud.r-project.org/"))
+ }
> 
> install.packages(c("jsonlite", "R6"))
Installing packages into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/jsonlite_1.7.2.tar.gz'
Content type 'binary/octet-stream' length 536214 bytes (523 KB)
==================================================
downloaded 523 KB

trying URL 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/R6_2.5.0.tar.gz'
Content type 'binary/octet-stream' length 81940 bytes (80 KB)
==================================================
downloaded 80 KB

* installing *binary* package ‘jsonlite’ ...
* DONE (jsonlite)
* installing *binary* package ‘R6’ ...
* DONE (R6)

The downloaded source packages are in
        ‘/tmp/RtmpBnMYKD/downloaded_packages’
> 
> url <- commandArgs(trailingOnly = TRUE)[[1]]
> install.packages(url, repos = NULL)
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://github.com/ManuelHentschel/VSCode-R-Debugger/releases/download/v0.4.6/vscDebugger_0.4.6.tar.gz'
Content type 'application/octet-stream' length 331497 bytes (323 KB)
==================================================
downloaded 323 KB

ERROR: dependency ‘svSocket’ is not available for package ‘vscDebugger’
* removing ‘/usr/local/lib/R/site-library/vscDebugger’
Warning message:
In install.packages(url, repos = NULL) :
  installation of package ‘/tmp/RtmpBnMYKD/downloaded_packages/vscDebugger_0.4.6.tar.gz’ had non-zero exit status

After installing the svSocket package, I ran it again and it installed successfully.

renkun-ken commented 3 years ago

@ManuelHentschel The tagged version does not seem to work correctly. The latest commit seems to work.

eitsupi commented 3 years ago

Is svSocket not being used in the latest commit? Sorry, I understood that svSocket was removed from DESCRIPTION later than v0.4.6.

https://github.com/ManuelHentschel/vscDebugger/blob/0fa6d6177ae9ded53b0c4b60c157b2377d915dfe/R/websocket.R#L7-L26

eitsupi commented 3 years ago

Could it be an issue with the release workflow, since the installation succeeds when I use devtools::install_github as shown below?

$ docker run --rm -it rocker/tidyverse Rscript -e "devtools::install_github('ManuelHentschel/vscDebugger@v0.4.6')"

As I wrote in my post above, installation from the compressed file attached to the release seems to fail.

$ docker run --rm -it rocker/tidyverse Rscript -e "install.packages('https://github.com/ManuelHentschel/VSCode-R-Debugger/releases/download/v0.4.6/vscDebugger_0.4.6.tar.gz', repos = NULL)"
ManuelHentschel commented 3 years ago

We removed svSocket from DESCRIPTION, since the functionality that uses it depends on a custom fork of the package. This was meant as a temporary workaround, but since the maintainers of svSocket are not planning to implement the changes required to work with vscDebugger, I'm planning to implement an internal solution (e.g. a socket in C) that does not use svSocket at all.

~Is svSocket not being used in the latest commit?~ Sorry, I understood that svSocket was removed from DESCRIPTION later than v0.4.6.

svSocket is still referenced in the code, but wrapped in tryCatch and a check, if the modified version is used, so for normal usage it's fine to not install svSocket at all.

@ManuelHentschel The tagged version does not seem to work correctly. The latest commit seems to work.

Thanks for pointing this out, I'll release a new version that does not list svSocket as dependency.

eitsupi commented 3 years ago

It works now, thanks!

$ /usr/local/bin/R --no-restore --quiet -f "/home/rstudio/.vscode-server/extensions/rdebugger.r-debugger-0.4.7/R/install.R" --args "https://github.com/ManuelHentschel/VSCode-R-Debugger/releases/download/v0.4.7/vscDebugger_0.4.7.tar.gz"
> repos <- getOption("repos")
> if (is.null(repos) || identical(repos, c(CRAN = "@CRAN@"))) {
+   options(repos = c(CRAN = "https://cloud.r-project.org/"))
+ }
> 
> install.packages(c("jsonlite", "R6"))
Installing packages into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/jsonlite_1.7.2.tar.gz'
Content type 'binary/octet-stream' length 536214 bytes (523 KB)
==================================================
downloaded 523 KB

trying URL 'https://packagemanager.rstudio.com/all/__linux__/focal/latest/src/contrib/R6_2.5.0.tar.gz'
Content type 'binary/octet-stream' length 81940 bytes (80 KB)
==================================================
downloaded 80 KB

* installing *binary* package ‘jsonlite’ ...
* DONE (jsonlite)
* installing *binary* package ‘R6’ ...
* DONE (R6)

The downloaded source packages are in
        ‘/tmp/RtmpHnW8cJ/downloaded_packages’
> 
> url <- commandArgs(trailingOnly = TRUE)[[1]]
> install.packages(url, repos = NULL)
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://github.com/ManuelHentschel/VSCode-R-Debugger/releases/download/v0.4.7/vscDebugger_0.4.7.tar.gz'
Content type 'application/octet-stream' length 329954 bytes (322 KB)
==================================================
downloaded 322 KB

* installing *source* package ‘vscDebugger’ ...
** using staged installation
** libs
gcc -I"/usr/local/lib/R/include" -DNDEBUG   -I/usr/local/include   -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
gcc -I"/usr/local/lib/R/include" -DNDEBUG   -I/usr/local/include   -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c ppid.c -o ppid.o
gcc -I"/usr/local/lib/R/include" -DNDEBUG   -I/usr/local/include   -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c promise.c -o promise.o
gcc -shared -L/usr/local/lib/R/lib -L/usr/local/lib -o vscDebugger.so init.o ppid.o promise.o -L/usr/local/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/00LOCK-vscDebugger/00new/vscDebugger/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (vscDebugger)