VSCode-R-Debugger icon indicating copy to clipboard operation
VSCode-R-Debugger copied to clipboard

r.debugger.updateRPackage fails due to incompatible binary

Open mulchy opened this issue 2 years ago • 2 comments

NOTE: Before submitting an issue, please make sure to install the latest version of both the vscode extension and the R package. This can usually be achieved by running the command r.debugger.updateRPackage in vscode's command palette (F1).

Describe the bug On MacOS 13.4, running the r.debugger.updateRPackage task generates the following output:

Executing task: /usr/local/bin/R --no-restore --quiet -f /Users/me/.vscode/extensions/rdebugger.r-debugger-0.5.4/R/install.R --args https://github.com/ManuelHentschel/VSCode-R-Debugger/releases/download/v0.5.4/vscDebugger_0.5.2.tgz 

> 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"))
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1101k  100 1101k    0     0  1876k      0 --:--:-- --:--:-- --:--:-- 1886k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 83054  100 83054    0     0   331k      0 --:--:-- --:--:-- --:--:--  337k

The downloaded binary packages are in
        /var/folders/_4/4twcl1p15bzczlld78695j2w0000gn/T//RtmpyfTPll/downloaded_packages
> 
> url <- commandArgs(trailingOnly = TRUE)[[1]]
> install.packages(url, repos = NULL)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Error: file ‘/var/folders/_4/4twcl1p15bzczlld78695j2w0000gn/T//RtmpyfTPll/downloaded_packages/vscDebugger_0.5.2.tgz’ is not a macOS binary package
Execution halted

Something that immediately jumps out to me is the // in the path ...T//RtmpyfTPll/.... Feels like maybe we tried to to concatenate path strings and one of them was empty.

To Reproduce Steps to reproduce the behavior:

  1. Use MacOS
  2. run r.debugger.updateRPackage
  3. See error

Your R code N/A

Your Launch config N/A

Expected behavior The task downloads the most recent release binary with the appropriate arch and installs it.

Actual behavior Fails with Error: file ‘/var/folders/_4/4twcl1p15bzczlld78695j2w0000gn/T//RtmpyfTPll/downloaded_packages/vscDebugger_0.5.2.tgz’ is not a macOS binary package

Desktop (please complete the following information):

  • OS: MacOS 13.4
  • R Version: R version 4.3.0 (2023-04-21) -- "Already Tomorrow" (from homebrew cask)
  • vscDebugger N/A
  • vscode-r-debugger Version: v0.5.4

Additional context N/A

mulchy avatar Jun 13 '23 19:06 mulchy

An easier way to reproduce:

> install.packages('https://github.com/ManuelHentschel/vscDebugger/releases/download/v0.5.2/vscDebugger_0.5.2.tgz', repos=NULL)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Error: file ‘/var/folders/_4/4twcl1p15bzczlld78695j2w0000gn/T//RtmpTqbd2n/downloaded_packages/vscDebugger_0.5.2.tgz’ is not a macOS binary package

mulchy avatar Jun 13 '23 19:06 mulchy

fwiw downloading the tarball and installing from that seems to work

install.packages('~/Downloads/vscDebugger_0.5.2.tar.gz', repos=NULL)
* installing *source* package ‘vscDebugger’ ...
** using staged installation
** libs
using C compiler: ‘Apple clang version 14.0.3 (clang-1403.0.22.14.1)’
using SDK: ‘MacOSX13.3.sdk’
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c init.c -o init.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c ppid.c -o ppid.o
clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -c promise.c -o promise.o
clang -arch arm64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o vscDebugger.so init.o ppid.o promise.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/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)

mulchy avatar Jun 13 '23 19:06 mulchy