Skip to content

Commit 1ea9245

Browse files
Retire 'envir', but keep it temporarily bc civis::CivisFuture needs it
1 parent 900c100 commit 1ea9245

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future
2-
Version: 1.68.0-9009
2+
Version: 1.68.0-9031
33
Title: Unified Parallel and Distributed Processing in R for Everyone
44
Depends:
55
R (>= 3.2.0)

R/backend_api-Future-class.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,17 @@ Future <- function(expr = NULL, envir = parent.frame(), substitute = TRUE, stdou
228228
## Additional named arguments
229229
for (key in args_names) core[[key]] <- args[[key]]
230230

231+
## Backward compatibility: drop field 'envir' in future (> 1.68.0)
232+
## 1. civis::CivisFuture() relies on 'envir'
233+
## 2. there might be other unknown dependencies out there => option
234+
if (getOption("future.Future.envir.keep", FALSE)) {
235+
core[["envir"]] <- envir
236+
} else if (all(c("required_resources", "docker_image_name",
237+
"docker_image_tag") %in% args_names) && "civis" %in% loadedNamespaces()) {
238+
## Looks like Future() was called from CivisFuture
239+
core[["envir"]] <- envir
240+
}
241+
231242
structure(core, class = c("Future", class(core)))
232243
}
233244

@@ -591,6 +602,7 @@ run.Future <- function(future, ...) {
591602
args <- list(
592603
quote(future[["expr"]]),
593604
substitute = FALSE,
605+
envir = future[["envir"]], ## For backward compatibility with 'civis'
594606
lazy = TRUE,
595607
stdout = future[["stdout"]],
596608
conditions = future[["conditions"]],

R/utils-options.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,4 +471,5 @@ update_package_options <- function(debug = FALSE) {
471471
update_package_option("future.future.gc", mode = "character", debug = debug)
472472
update_package_option("future.future.local", mode = "character", debug = debug)
473473
update_package_option("future.plan.earlySignal", mode = "character", debug = debug)
474+
update_package_option("future.Future.envir.keep", mode = "logical", debug = debug)
474475
}

0 commit comments

Comments
 (0)