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::load(other_project) fails if autoload is disabled #1959

Closed
klmr opened this issue Aug 2, 2024 · 6 comments
Closed

renv::load(other_project) fails if autoload is disabled #1959

klmr opened this issue Aug 2, 2024 · 6 comments

Comments

@klmr
Copy link
Contributor

klmr commented Aug 2, 2024

In my environment I have intentionally set options(renv.config.autoloader.enabled = FALSE). In principle this works well.

However, it also breaks renv::load(other_project), because renv:::renv_load_switch(), which is called by renv::load(), sources the other project’s renv/activate.R file, which aborts if auto-loading is disabled.

As a user, this is unexpected: explicitly calling load() is the opposite of auto-loading. I’m wondering whether that’s an oversight (I am guessing that few people disable auto-loading, so that option is probably not as battle-tested) — or whether this is working as intended: in that case, is there a way of explicitly loading/switching to another renv project while keeping auto-loading disabled?

A workaround would be to temporarily unset the renv.config.autoloader.enabled option, but that requires awareness of the semantics.

@kevinushey
Copy link
Collaborator

This definitely seems like an oversight; I'll take a look.

@kevinushey
Copy link
Collaborator

Should be addressed via 2c51854; please let me know if this still appears to be an issue.

@klmr
Copy link
Contributor Author

klmr commented Nov 19, 2024

(I am super confused by the version numbers… I wanted to try out this commit but when comparing version numbers I noticed that this is apparently v1.0.7.9000, whereas I currently have v1.0.11 installed from CRAN. Are y’all counting backwards? 😆)

@kevinushey
Copy link
Collaborator

Shouldn't be that way; the current version on main is 1.0.11.9000:

Version: 1.0.11.9000

How did you install the development version of renv? Is an older version somehow getting installed here?

@kevinushey
Copy link
Collaborator

(The associated commit fixing the issue was actually merged some time ago; perhaps that's why?)

@klmr
Copy link
Contributor Author

klmr commented Nov 20, 2024

(The associated commit fixing the issue was actually merged some time ago; perhaps that's why?)

Ah I hadn’t noticed that! So the relevant change 2c51854 is already included in the version 1.0.11 that’s on CRAN. — I can’t quite reconstruct what happened since the bug was not yet fixed when I tested it yesterday before applying the patch, and packageVersion('renv') told me I was running 1.0.11.

However, after some back and forth, first installing the specific rstudio/renv@2c51854, and now also when (again?) installing renv@1.0.11 from CRAN, the issue is indeed fixed. Thank you very much. 🎉

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