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

Always force the promises when loading using load_all #1009

Merged
merged 2 commits into from
Jan 12, 2016

Conversation

jimhester
Copy link
Member

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.

@@ -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.
Copy link
Member

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"?

Copy link
Member Author

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
Copy link
Member

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?

Copy link
Member Author

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.

hadley added a commit that referenced this pull request Jan 12, 2016
Always force the promises when loading using load_all
@hadley hadley merged commit 3835a87 into r-lib:master Jan 12, 2016
@hadley
Copy link
Member

hadley commented Jan 12, 2016

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants