Fail to install CmdStan v2.35.0 with cmdstanr_0.8.1

Hi,

I have updated the cmdstanr to version 0.8.1 and now when I try to install CmdStan, the following error occurs

/usr/bin/tar: Cannot connect to C: resolve failed
Error: Problem extracting tarball. Exited with return code: 128

The full details are:

cmdstanr::install_cmdstan(cores = 4)
The C++ toolchain required for CmdStan is setup properly!
trying URL 'https://api.github.com/repos/stan-dev/cmdstan/releases/latest'
Content type 'application/json; charset=utf-8' length 15928 bytes (15 KB)
downloaded 15 KB

* Latest CmdStan release is v2.35.0
* Installing CmdStan v2.35.0 in C:\Users\ss16299/.cmdstan/cmdstan-2.35.0
* Downloading cmdstan-2.35.0.tar.gz from GitHub...
trying URL 'https://github.com/stan-dev/cmdstan/releases/download/v2.35.0/cmdstan-2.35.0.tar.gz'
Content type 'application/octet-stream' length 51682840 bytes (49.3 MB)
downloaded 49.3 MB

* Download complete
* Unpacking archive...
/usr/bin/tar: Cannot connect to C: resolve failed
Error: Problem extracting tarball. Exited with return code: 128
In addition: Warning messages:
1: R graphics engine version 16 is not supported by this version of RStudio. The Plots tab will be disabled until a newer version of RStudio is installed. 
2: In utils::untar(dest_file, exdir = dir_cmdstan, extras = "--strip-components 1") :
  ‘tar.exe -xf "C:\Users\ss16299/.cmdstan/cmdstan-2.35.0.tar.gz" -C "C:/Users/ss16299/.cmdstan/cmdstan-2.35.0" --strip-components 1’ returned error code 128
  • R version 4.4.0
  • CmdStan Version: 2.35.0
sessionInfo()
R version 4.4.0 (2024-04-24 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows Server 2016 x64 (build 14393)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

time zone: Europe/London
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] tensorA_0.36.2.1     backports_1.5.0      utf8_1.2.4           R6_2.5.1            
 [5] magrittr_2.0.3       posterior_1.5.0.9000 glue_1.7.0           abind_1.4-5         
 [9] tibble_3.2.1         pkgconfig_2.0.3      generics_0.1.3       lifecycle_1.0.4     
[13] ps_1.7.6             cli_3.6.2            processx_3.8.4       fansi_1.0.6         
[17] vctrs_0.6.5          withr_3.0.0          compiler_4.4.0       distributional_0.4.0
[21] rstudioapi_0.16.0    tools_4.4.0          checkmate_2.3.1      pillar_1.9.0        
[25] jsonlite_1.8.8       rlang_1.1.4          cmdstanr_0.8.1.9000 

Very odd, it looks like the call to utils::untar() to extract the cmdstan tarball is failing for some reason.

Can you try calling:

Sys.setenv("TAR"="internal")

Before install_cmdstan()?

Thank you for looking into the issue.

After calling Sys.setenv("TAR"="internal"), I now get a new error

* Download complete
* Unpacking archive...
Error in mydir.create(name) : 
  failed to create directory ‘cmdstan-2.35.0/stan/lib/stan_math/lib/boost_1.84.0/tools/auto_index/doc/html/boost_autoindex/tut/con’
In addition: Warning message:
In dir.create(path, showWarnings = TRUE, recursive = TRUE, ...) :
  cannot create dir 'cmdstan-2.35.0\stan\lib\stan_math\lib\boost_1.84.0\tools\auto_index\doc\html\boost_autoindex\tut\con', reason 'Invalid argument'