-
Notifications
You must be signed in to change notification settings - Fork 761
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
Always force the promises when loading using load_all #1009
Conversation
@@ -94,11 +94,14 @@ load_all <- function(pkg = ".", reset = TRUE, recompile = FALSE, | |||
# in the DESCRIPTION file | |||
pkg$collate <- as.package(pkg$path)$collate | |||
|
|||
# Forcing all of the promises for the loaded namespace now will avoid lazy-load | |||
# errors when the new package is installed overtop the old one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should it be "loaded" instead of "installed"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct, this comment was partially copied from install()
and I missed that. Fixed with jimhester@1ca9e28 Thanks!
@@ -94,11 +94,14 @@ load_all <- function(pkg = ".", reset = TRUE, recompile = FALSE, | |||
# in the DESCRIPTION file | |||
pkg$collate <- as.package(pkg$path)$collate | |||
|
|||
# Forcing all of the promises for the loaded namespace now will avoid lazy-load | |||
# errors when the new package is loaded overtop the old one. | |||
# | |||
# Reloading devtools is a special case. Normally, objects in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe delete this old comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept that comment because for the devtools case we are forcing the promises to avoid the lazy load errors and because it lets us continue to use the functions when devtools is being reloaded.
But I am fine removing it if it seems confusing.
Always force the promises when loading using load_all
Thanks! |
As a continuation of #1001 you can still get lazy load errors if you use
load_all()
on a already loaded package for the same reason (promises never forced and then invalided when new code is loaded).This was special cased for devtools so the functions would continue to work, but actually needs to be done for any package that is already loaded to avoid lazy load errors.