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

could not find function "heredoc" in renv 1.0.6 activate script #1874

Closed
pascal-sauer opened this issue Apr 11, 2024 · 4 comments
Closed

could not find function "heredoc" in renv 1.0.6 activate script #1874

pascal-sauer opened this issue Apr 11, 2024 · 4 comments

Comments

@pascal-sauer
Copy link

I believe there is a critical bug in renv 1.0.6. When writing the corresponding renv/activate.R script it contains

    fmt <- heredoc("
      renv %1$s was loaded from project library, but this project is configured to use renv %2$s.
      - Use `renv::record(\"%3$s\")` to record renv %1$s in the lockfile.
      - Use `renv::restore(packages = \"renv\")` to install renv %2$s into the project library.
    ")

in lines 842+. This fails with an error when the R session starts and the renv version installed is not 1.0.6, because heredoc is not found (it is an unexported function of renv, renv:::heredoc works).

Error in heredoc("\n      renv %1$s was loaded from project library, but this project is configured to use renv %2$s.\n      - Use `renv::record(\"%3$s\")` to record renv %1$s in the lockfile.\n      - Use `renv::restore(packages = \"renv\")` to install renv %2$s into the project library.\n    ") : 
  could not find function "heredoc"
@kevinushey
Copy link
Collaborator

Thanks for the bug report -- I was able to reproduce; I'll get this fixed up ASAP.

@kevinushey
Copy link
Collaborator

kevinushey commented Apr 11, 2024

I've submitted a new version of renv to CRAN; now waiting for acceptance from a CRAN maintainer.

In the interim, it should suffice to update the lockfile record to match the installed version of renv with something like:

renv::record("renv@1.0.7")

@kevinushey
Copy link
Collaborator

kevinushey commented Apr 12, 2024

Thanks again for reporting -- this should now be resolved with the latest release of renv 1.0.7 on CRAN.

@pascal-sauer
Copy link
Author

Thanks for the fast response and fix!

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

2 participants