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/activate.R 1.0.8 stops processing of .Rprofile in RStudio #1990

Closed
jabenninghoff opened this issue Sep 21, 2024 · 6 comments
Closed

renv/activate.R 1.0.8 stops processing of .Rprofile in RStudio #1990

jabenninghoff opened this issue Sep 21, 2024 · 6 comments

Comments

@jabenninghoff
Copy link

When opening a project in RStudio (2024.04.2+764), source("renv/activate.R") stops processing of the .Rprofile.

Steps to reproduce:

  1. Create a new project in RStudio, selecting "Use renv with this project"
  2. Modify the .Rprofile as follows:
writeLines("start")
writeLines("activate")
source("renv/activate.R")
writeLines("options")
options(
  warnPartialMatchArgs = TRUE,
  warnPartialMatchAttr = TRUE,
  warnPartialMatchDollar = TRUE
)
writeLines("end")

Starting RStudio with renv 1.0.7:

Restarting R session...

start
activate
- Project '~/GitHub/renv-test' loaded. [renv 1.0.7]
options
end

Starting RStudio with renv 1.0.8:

Restarting R session...

start
activate
- Project '~/GitHub/renv-test' loaded. [renv 1.0.8]

Starting R with renv 1.0.8:

start
activate
- Project '~/GitHub/renv-test' loaded. [renv 1.0.8]
options
end

This seems to be caused by #1915.

@salim-b
Copy link
Contributor

salim-b commented Sep 23, 2024

I ran into the same issue after upgrading to renv 1.0.8. This is a serious regression!

I don't have a clear enough view of the renv starting behavior to be able to say exactly where things go south, but I noticed that setting options(renv.config.autoloader.enabled = FALSE) makes the .Rprofile script being executed fully again – with the downside of not properly loading the renv package cage anymore.

@kevinushey
Copy link
Collaborator

Thanks for the bug report -- we'll take a look and try to get this fixed up ASAP.

@kevinushey
Copy link
Collaborator

I've pushed a potential fix in 73d3841 that works locally for me -- are you able to test and report back? If everything looks good I can prepare a patch release for CRAN soon.

@jabenninghoff
Copy link
Author

@kevinushey I have tested the patched version locally and it does resolve the issue for me. Thanks!

@salim-b
Copy link
Contributor

salim-b commented Sep 23, 2024

@kevinushey I can also confirm that this issue is fixed with renv::upgrade(version = "73d3841").

@kevinushey
Copy link
Collaborator

Thanks for testing and confirming! renv 1.0.9 is now on CRAN; please let me know if you encounter any other issues.

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