You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[X ] Search for duplicates among the existing issues, both open and closed.
[ X] Advanced users: verify that the bug still persists in the current development version (i.e. remotes::install_github("ropensci/drake")) and mention the SHA-1 hash of the Git commit you install.
Description
I noticed this when switching from one computer to another. I tried to run the existing plan with r_make but kept getting a strange error message:
Error in assign(dumpto, last.dump, envir = .GlobalEnv) :
cannot add bindings to a locked environment
At first, I thought this was related to lock_envir and set that to FALSE but the error remained.
Finally, I tried running my plan with make(plan) and got the error that
Error: package fst not installed. Please install it with install.packages("fst").
Once installing fst on the new computer, the errors went away, as expected.
Reproducible example
Provide a minimal reproducible example with code and output that demonstrates the bug. The reprex package is extremely helpful for this.
Expected result
What should have happened? Please be as specific as possible.
Session info
End the reproducible example with a call to sessionInfo() in the same session (e.g. reprex(si = TRUE)) and include the output.
r_make() is built on callr. When a callr process throws an error, it dumps the error and stacktrace to the global environment (variables Last.error etc). When I manually unlocked the global environment right before throwing the error in assert_pkg(), the error message became more informative.
library(callr)
library(drake)
writeLines(
c(
"library(drake)",
"plan <- drake_plan(x = target(mtcars, format = \"fst\"))",
"config <- drake_config(plan)"
),
"_drake.R"
)
r_make()
#> �[32mtarget�[39m x#> Error : package fst not installed. Please install it with install.packages("fst").#> Error: callr subprocess failed: package fst not installed. Please install it with install.packages("fst").
Perhaps r_make() needs to always lock/unlock the environment separately for each target. Or maybe drake should do this for make() too. Need to revisit profiling studies to make sure this is fast enough.
Checked profiling studies, and unlocking/relocking the environment did not even put a dent in performance. So I think that's the right way to go. It will allow these informative error messages to appear without having to set lock_envir to FALSE.
Prework
drake
's code of conduct.remotes::install_github("ropensci/drake")
) and mention the SHA-1 hash of the Git commit you install.Description
I noticed this when switching from one computer to another. I tried to run the existing plan with
r_make
but kept getting a strange error message:At first, I thought this was related to
lock_envir
and set that to FALSE but the error remained.Finally, I tried running my plan with
make(plan)
and got the error thatError: package fst not installed. Please install it with install.packages("fst").
Once installing
fst
on the new computer, the errors went away, as expected.Reproducible example
Provide a minimal reproducible example with code and output that demonstrates the bug. The
reprex
package is extremely helpful for this.Expected result
What should have happened? Please be as specific as possible.
Session info
End the reproducible example with a call to
sessionInfo()
in the same session (e.g.reprex(si = TRUE)
) and include the output.The text was updated successfully, but these errors were encountered: