Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renv::restore() is not reliable on Windows; calls make and other Linux utilities #1896

Open
juliusmoore opened this issue May 3, 2024 · 2 comments
Milestone

Comments

@juliusmoore
Copy link

juliusmoore commented May 3, 2024

We want to use renv on Windows, but have encountered an issue running renv::restore() on the lockfile generated by migrating from packrat. Specifically, renv::restore() fails because 1: It asks for things like make and g++ on Windows machines, without installing these dependencies itself.

I've worked around this problem by using renv::init() instead, however we need to be able to rely on renv::restore() because we don't want the packages to update when we reproduce old run throughs of code. This was only an option because I was working on a new run through.

Occurs: Running renv::restore() on the new lockfile after migrating from packrat to renv.
renv::restore() does not work for restoring some libraries on windows machines. Specifically the sys library, from the renv.lock file

"sys": {
      "Package": "sys",
      "Version": "3.3",
      "Source": "CRAN"
    }
R version, from the lockfile:
"R": {
    "Version": "3.6.2",
    "Repositories": [
      {
        "Name": "CRAN",
        "URL": "https://cran.rstudio.com"
      }
    ]
  },

R version on my machine: 4.3.1 (From R console)

> version
               _                                
platform       x86_64-w64-mingw32               
arch           x86_64                           
os             mingw32                          
crt            ucrt                             
system         x86_64, mingw32                  
status                                          
major          4                                
minor          3.1                              
year           2023                             
month          06                               
day            16                               
svn rev        84548                            
language       R                                
version.string R version 4.3.1 (2023-06-16 ucrt)
nickname       Beagle Scouts

Running on Windows 11, 64-bit

The issue was isolated by calling renv::restore(packages=“sys”)

image

The error persists after installing make and adding it to the path. It can be isolated to renv::restore(packages=“sys”).

image

The error does not occur when renv::init() is called, and option 2 is chosen.

> renv::init()
This project already has a lockfile. What would you like to do? 

1: Restore the project from the lockfile.
2: Discard the lockfile and re-initialize the project.
3: Activate the project without snapshotting or installing any packages.
4: Abort project initialization.

Selection: 2
@remlapmot
Copy link
Contributor

Maybe this helps you - on Windows you need the corresponding version of Rtools installed for a particular version of R. See https://cran.r-project.org/bin/windows/Rtools/

@kevinushey
Copy link
Collaborator

renv also has some tooling for installing Rtools on the users behalf via renv::equip(), but I don't think this has been updated for R 4.4.0 yet.

@kevinushey kevinushey added this to the 1.1.0 milestone May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants