CRAN Package Check Results for Package doFuture

Last updated on 2025-04-22 12:49:25 CEST.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.0.2 3.45 134.81 138.26 OK
r-devel-linux-x86_64-debian-gcc 1.0.2 2.23 107.34 109.57 OK
r-devel-linux-x86_64-fedora-clang 1.0.2 233.43 OK
r-devel-linux-x86_64-fedora-gcc 1.0.2 208.82 OK
r-devel-windows-x86_64 1.0.2 5.00 309.00 314.00 ERROR
r-patched-linux-x86_64 1.0.2 2.77 130.75 133.52 OK
r-release-linux-x86_64 1.0.2 3.31 131.09 134.40 OK
r-release-macos-arm64 1.0.2 116.00 OK
r-release-macos-x86_64 1.0.2 176.00 OK
r-release-windows-x86_64 1.0.2 4.00 310.00 314.00 ERROR
r-oldrel-macos-arm64 1.0.2 110.00 OK
r-oldrel-macos-x86_64 1.0.2 281.00 OK
r-oldrel-windows-x86_64 1.0.2 6.00 351.00 357.00 ERROR

Check Details

Version: 1.0.2
Check: tests
Result: ERROR Running 'foreach_dofuture,cluster-missing-doFuture-pkg.R' [62s] Running 'foreach_dofuture,errors.R' [10s] Running 'foreach_dofuture,globals.R' [7s] Running 'foreach_dofuture,nested_colon.R' [14s] Running 'foreach_dofuture,nested_dofuture.R' [15s] Running 'foreach_dofuture,rng.R' [4s] Running 'foreach_dofuture.R' [3s] Running 'foreach_dopar,cluster-missing-doFuture-pkg.R' [62s] Running 'foreach_dopar,doRNG,dopar.R' [2s] Running 'foreach_dopar,doRNG,dorng.R' [5s] Running 'foreach_dopar,errors.R' [8s] Running 'foreach_dopar,globals.R' [7s] Running 'foreach_dopar,nested_colon.R' [13s] Running 'foreach_dopar,nested_dopar.R' [16s] Running 'foreach_dopar,options-for-export.R' [5s] Running 'foreach_dopar.R' [3s] Running 'makeChunks.R' [4s] Running 'options,nested.R' [4s] Running 'registerDoFuture.R' [2s] Running 'times.R' [2s] Running 'utils.R' [1s] Running 'withDoRNG.R' [4s] Running the tests in 'tests/foreach_dofuture,cluster-missing-doFuture-pkg.R' failed. Complete output: > source("incl/start.R") Loading required package: foreach Loading required package: future R Under development (unstable) (2025-04-19 r88161 ucrt) Platform: x86_64-w64-mingw32/x64 Running under: Windows Server 2022 x64 (build 20348) Matrix products: default LAPACK version 3.12.1 locale: [1] LC_COLLATE=C LC_CTYPE=German_Germany.utf8 [3] LC_MONETARY=C LC_NUMERIC=C [5] LC_TIME=C time zone: Europe/Berlin tzcode source: internal attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] doFuture_1.0.2 future_1.40.0 foreach_1.5.2 loaded via a namespace (and not attached): [1] compiler_4.6.0 parallelly_1.43.0 tools_4.6.0 [4] parallel_4.6.0 future.apply_1.11.3 listenv_0.9.1 [7] codetools_0.2-20 iterators_1.0.14 digest_0.6.37 [10] globals_0.17.0 > options(future.debug = FALSE) > > message("*** cluster() ...") *** cluster() ... > > message("Library paths: ", paste(sQuote(.libPaths()), collapse = ", ")) Library paths: 'D:/temp/2025_04_20_01_50_00_2710/RtmpIbHUMU/RLIBS_1de545140549b', 'D:/RCompile/recent/R/library' > message("Package path: ", sQuote(system.file(package = "future"))) Package path: 'D:/RCompile/CRANpkg/lib/4.6/future' > > types <- "PSOCK" > #if (supportsMulticore()) types <- c(types, "FORK") > > setupClusterWithoutPkgs <- function(type = "PSOCK", + withs = c("digest", "globals", + "listenv", "future"), + withouts = c("doFuture")) { + cl <- parallel::makeCluster(1L, type = type, timeout = 60) + + ## Emulate a worker that does not have 'future' installed. + ## by setting a different user library path on the worker. + libs <- parallel::clusterEvalQ(cl, .libPaths(tempdir()))[[1]] + attr(cl, "libs") <- libs + + ## 'withouts' tops 'withs' for conveniency + withs <- setdiff(withs, withouts) + + ## "Install" any 'withs' packages? + if (length(withs) > 0L) { + paths <- find.package(withs) + res <- parallel::clusterCall(cl, fun = sapply, X = paths, + FUN = file.copy, to = libs[1], + recursive = TRUE)[[1]] + res <- parallel::clusterCall(cl, fun = sapply, X = withs, + FUN = requireNamespace)[[1]] + } + attr(cl, "withs") <- res + + ## Check whether 'future' is still available on the worker or not. + ## It could be that it is installed in the system library path, which + ## in case we cannot "hide" the future package from the worker. + res <- parallel::clusterCall(cl, fun = sapply, X = withouts, + FUN = requireNamespace)[[1]] + attr(cl, "withouts") <- res + + cl + } > > cl <- NULL > for (type in types) { + message(sprintf("Test set #1 with cluster type %s ...", sQuote(type))) + + cl <- setupClusterWithoutPkgs(type, withouts = c("future", "doFuture")) + if (all(attr(cl, "withs")) && !all(attr(cl, "withouts"))) { + plan(cluster, workers = cl, .init = FALSE) + + ## Here we will get: + ## <UnexpectedFutureResultError: Unexpected result (of class + ## 'snow-try-error' != 'FutureResult') retrieved for ClusterFuture + ## future (label = '<none>', expression = '{ ... }'): + ## Package 'future' is not installed on worker (r_version: ...)> + ## Note: This error is produced by the future backend when it recieves + ## the unexpected results. + res <- tryCatch({ + y <- foreach(ii = 1:3) %dofuture% ii + }, error = identity) + print(res) + stopifnot(inherits(res, "FutureError")) + } + parallel::stopCluster(cl) + cl <- NULL + + cl <- setupClusterWithoutPkgs(type) + if (all(attr(cl, "withs")) && !all(attr(cl, "withouts"))) { + plan(cluster, workers = cl, .init = FALSE) + + ## Here we will get: + ## <UnexpectedFutureResultError: Unexpected result (of class + ## 'snow-try-error' != 'FutureResult') retrieved for ClusterFuture + ## future (label = '<none>', expression = '{ ... }'): + ## there is no package called 'doFuture'> + ## Note: This error is produced by the future backend when it recieves + ## the unexpected results. + res <- tryCatch({ + y <- foreach(ii = 1:3) %dofuture% ii + }, error = identity) + print(res) + stopifnot(inherits(res, "FutureError")) + } + parallel::stopCluster(cl) + cl <- NULL + + plan(sequential) + + message(sprintf("Test set #1 with cluster type %s ... DONE", sQuote(type))) + } ## for (type ...) Test set #1 with cluster type 'PSOCK' ... [12:16:43.144] doFuture2() ... [12:16:43.201] Number of chunks: 1 [12:16:43.202] Number of futures (= number of chunks): 1 [12:16:43.202] seed = FALSE [12:16:43.202] NULL [12:16:43.206] seed = FALSE [12:16:43.206] seed = FALSE [12:16:43.206] - %dofuture% R expression: [12:16:43.207] ii [12:16:43.207] - foreach iterator arguments: [1] 'ii' [12:16:43.207] - dummy globals (as locals): [1] 'ii' [12:16:43.208] - R expression (map-reduce expression adjusted for RNG): [12:16:43.208] { [12:16:43.208] NULL [12:16:43.208] "# doFuture():::doFuture2(): process chunk of elements" [12:16:43.208] lapply(seq_along(...future.x_ii), FUN = function(jj) { [12:16:43.208] ...future.x_jj <- ...future.x_ii[[jj]] [12:16:43.208] { [12:16:43.208] NULL [12:16:43.208] ii <- NULL [12:16:43.208] } [12:16:43.208] ...future.env <- environment() [12:16:43.208] local({ [12:16:43.208] for (name in names(...future.x_jj)) { [12:16:43.208] assign(name, ...future.x_jj[[name]], envir = ...future.env, [12:16:43.208] inherits = FALSE) [12:16:43.208] } [12:16:43.208] }) [12:16:43.208] NULL [12:16:43.208] tryCatch(ii, error = identity) [12:16:43.208] }) [12:16:43.208] } [12:16:43.209] - identifying globals and packages ... [12:16:43.209] - Argument 'globals': [12:16:43.209] logi TRUE [12:16:43.209] - attr(*, "add")= chr "...future.x_ii" [12:16:43.209] - attr(*, "ignore")= chr "ii" [12:16:43.212] - R expression (map-reduce expression searched for globals): [12:16:43.212] { [12:16:43.212] NULL [12:16:43.212] "# doFuture():::doFuture2(): process chunk of elements" [12:16:43.212] lapply(seq_along(...future.x_ii), FUN = function(jj) { [12:16:43.212] ...future.x_jj <- ...future.x_ii[[jj]] [12:16:43.212] { [12:16:43.212] NULL [12:16:43.212] ii <- NULL [12:16:43.212] } [12:16:43.212] ...future.env <- environment() [12:16:43.212] local({ [12:16:43.212] for (name in names(...future.x_jj)) { [12:16:43.212] assign(name, ...future.x_jj[[name]], envir = ...future.env, [12:16:43.212] inherits = FALSE) [12:16:43.212] } [12:16:43.212] }) [12:16:43.212] NULL [12:16:43.212] tryCatch(ii, error = identity) [12:16:43.212] }) [12:16:43.212] } [12:16:43.228] - R expression (%dofuture% expression searched for globals): [12:16:43.228] ii [12:16:43.230] - Globals in %dofuture% R expression not in map-reduce expression: [12:16:43.230] - Appending 0 globals only found in the vanilla %dofuture% expression: [12:16:43.230] - globals: [1] '...future.x_ii' [12:16:43.231] List of 1 [12:16:43.231] $ ...future.x_ii: num 42 [12:16:43.231] - attr(*, "where")=List of 1 [12:16:43.231] ..$ ...future.x_ii:<environment: R_EmptyEnv> [12:16:43.231] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [12:16:43.231] - attr(*, "resolved")= logi FALSE [12:16:43.231] - attr(*, "total_size")= num 39 [12:16:43.235] - packages: [1] 'doFuture' [12:16:43.235] - identifying globals and packages ... DONE [12:16:43.235] Launching 1 futures (chunks) ... [12:16:43.236] Chunk #1 of 1 ... [12:16:43.236] - Finding globals in 'args_list' for chunk #1 ... [12:16:43.237] [12:16:43.237] [12:16:43.238] - Finding globals in 'args_list' for chunk #1 ... DONE [12:16:43.238] - seeds: <none> [12:16:43.245] Chunk #1 of 1 ... DONE [12:16:43.245] Launching 1 futures (chunks) ... DONE [12:16:43.245] - resolving futures [12:16:43.245] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture2-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: a511a1229c4a800940f693494d3ad513-2 DEBUG: BEGIN TROUBLESHOOTING HELP Future involved: ClusterFuture: Label: 'doFuture2-1' Expression: { NULL "# doFuture():::doFuture2(): process chunk of elements" lapply(seq_along(...future.x_ii), FUN = function(jj) { ...future.x_jj <- ...future.x_ii[[jj]] { NULL ii <- NULL } ...future.env <- environment() local({ for (name in names(...future.x_jj)) { assign(name, ...future.x_jj[[name]], envir = ...future.env, inherits = FALSE) } }) NULL tryCatch(ii, error = identity) }) } Lazy evaluation: FALSE Asynchronous evaluation: TRUE Local evaluation: TRUE Environment: R_GlobalEnv Capture standard output: TRUE Capture condition classes: 'condition' (excluding '<none>') Immediate condition classes: 'immediateCondition' Globals: 1 objects totaling 194 bytes (list '...future.x_ii' of 194 bytes) Packages: 1 packages ('doFuture') L'Ecuyer-CMRG RNG seed: <none> (seed = FALSE) Resolved: TRUE Value: <not collected> Conditions captured: <none> Early signaling: FALSE Owner process: a511a1229c4a800940f693494d3ad513 Class: 'ClusterFuture', 'MultiprocessFuture', 'Future' DEBUG: END TROUBLESHOOTING HELP Error in serialize(data, node$con) : error writing to connection Calls: <Anonymous> ... postNode -> sendData -> sendData.SOCKnode -> serialize Execution halted Running the tests in 'tests/foreach_dopar,cluster-missing-doFuture-pkg.R' failed. Complete output: > source("incl/start.R") Loading required package: foreach Loading required package: future R Under development (unstable) (2025-04-19 r88161 ucrt) Platform: x86_64-w64-mingw32/x64 Running under: Windows Server 2022 x64 (build 20348) Matrix products: default LAPACK version 3.12.1 locale: [1] LC_COLLATE=C LC_CTYPE=German_Germany.utf8 [3] LC_MONETARY=C LC_NUMERIC=C [5] LC_TIME=C time zone: Europe/Berlin tzcode source: internal attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] doFuture_1.0.2 future_1.40.0 foreach_1.5.2 loaded via a namespace (and not attached): [1] compiler_4.6.0 parallelly_1.43.0 tools_4.6.0 [4] parallel_4.6.0 future.apply_1.11.3 listenv_0.9.1 [7] codetools_0.2-20 iterators_1.0.14 digest_0.6.37 [10] globals_0.17.0 > options(future.debug = FALSE) > > message("*** cluster() ...") *** cluster() ... > > registerDoFuture() > > message("Library paths: ", paste(sQuote(.libPaths()), collapse = ", ")) Library paths: 'D:/temp/2025_04_20_01_50_00_2710/RtmpIbHUMU/RLIBS_1de545140549b', 'D:/RCompile/recent/R/library' > message("Package path: ", sQuote(system.file(package = "future"))) Package path: 'D:/RCompile/CRANpkg/lib/4.6/future' > > types <- "PSOCK" > #if (supportsMulticore()) types <- c(types, "FORK") > > setupClusterWithoutPkgs <- function(type = "PSOCK", + withs = c("digest", "globals", + "listenv", "future"), + withouts = c("doFuture")) { + cl <- parallel::makeCluster(1L, type = type, timeout = 60) + + ## Emulate a worker that does not have 'future' installed. + ## by setting a different user library path on the worker. + libs <- parallel::clusterEvalQ(cl, .libPaths(tempdir()))[[1]] + attr(cl, "libs") <- libs + + ## 'withouts' tops 'withs' for conveniency + withs <- setdiff(withs, withouts) + + ## "Install" any 'withs' packages? + if (length(withs) > 0L) { + paths <- find.package(withs) + res <- parallel::clusterCall(cl, fun = sapply, X = paths, + FUN = file.copy, to = libs[1], + recursive = TRUE)[[1]] + res <- parallel::clusterCall(cl, fun = sapply, X = withs, + FUN = requireNamespace)[[1]] + } + attr(cl, "withs") <- res + + ## Check whether 'future' is still available on the worker or not. + ## It could be that it is installed in the system library path, which + ## in case we cannot "hide" the future package from the worker. + res <- parallel::clusterCall(cl, fun = sapply, X = withouts, + FUN = requireNamespace)[[1]] + attr(cl, "withouts") <- res + + cl + } > > > cl <- NULL > for (type in types) { + message(sprintf("Test set #1 with cluster type %s ...", sQuote(type))) + + cl <- setupClusterWithoutPkgs(type, withouts = c("future", "doFuture")) + if (all(attr(cl, "withs")) && !all(attr(cl, "withouts"))) { + plan(cluster, workers = cl, .init = FALSE) + + ## Here we will get: + ## <UnexpectedFutureResultError: Unexpected result (of class + ## 'snow-try-error' != 'FutureResult') retrieved for ClusterFuture + ## future (label = '<none>', expression = '{ ... }'): + ## Package 'future' is not installed on worker (r_version: ...)> + ## Note: This error is produced by the future backend when it recieves + ## the unexpected results. + res <- tryCatch({ + y <- foreach(ii = 1:3) %dopar% ii + }, error = identity) + print(res) + stopifnot(inherits(res, "FutureError")) + } + parallel::stopCluster(cl) + cl <- NULL + + cl <- setupClusterWithoutPkgs(type) + if (all(attr(cl, "withs")) && !all(attr(cl, "withouts"))) { + plan(cluster, workers = cl, .init = FALSE) + + ## Here we will get: + ## <UnexpectedFutureResultError: Unexpected result (of class + ## 'snow-try-error' != 'FutureResult') retrieved for ClusterFuture + ## future (label = '<none>', expression = '{ ... }'): + ## there is no package called 'doFuture'> + ## Note: This error is produced by the future backend when it recieves + ## the unexpected results. + res <- tryCatch({ + y <- foreach(ii = 1:3) %dopar% ii + }, error = identity) + print(res) + stopifnot(inherits(res, "FutureError")) + } + parallel::stopCluster(cl) + cl <- NULL + + plan(sequential) + + message(sprintf("Test set #1 with cluster type %s ... DONE", sQuote(type))) + } ## for (type ...) Test set #1 with cluster type 'PSOCK' ... [12:18:38.401] doFuture() ... [12:18:38.403] - dummy globals (as locals): [1] 'ii' [12:18:38.404] - R expression: [12:18:38.404] { [12:18:38.404] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [12:18:38.404] "# also in nested calls " [12:18:38.404] doFuture::registerDoFuture() [12:18:38.404] "# doFuture():::doFuture(): process chunk of elements" [12:18:38.404] lapply(seq_along(...future.x_ii), FUN = function(jj) { [12:18:38.404] ...future.x_jj <- ...future.x_ii[[jj]] [12:18:38.404] { [12:18:38.404] NULL [12:18:38.404] ii <- NULL [12:18:38.404] } [12:18:38.404] ...future.env <- environment() [12:18:38.404] local({ [12:18:38.404] for (name in names(...future.x_jj)) { [12:18:38.404] assign(name, ...future.x_jj[[name]], envir = ...future.env, [12:18:38.404] inherits = FALSE) [12:18:38.404] } [12:18:38.404] }) [12:18:38.404] tryCatch(ii, error = identity) [12:18:38.404] }) [12:18:38.404] } [12:18:38.405] - identifying globals and packages ... [12:18:38.423] List of 1 [12:18:38.423] $ ...future.x_ii: NULL [12:18:38.423] - attr(*, "where")=List of 1 [12:18:38.423] ..$ ...future.x_ii:<environment: R_EmptyEnv> [12:18:38.423] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [12:18:38.423] - attr(*, "resolved")= logi FALSE [12:18:38.423] - attr(*, "total_size")= num 27 [12:18:38.432] - R expression: [12:18:38.432] { [12:18:38.432] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [12:18:38.432] "# also in nested calls " [12:18:38.432] doFuture::registerDoFuture() [12:18:38.432] "# doFuture():::doFuture(): process chunk of elements" [12:18:38.432] lapply(seq_along(...future.x_ii), FUN = function(jj) { [12:18:38.432] ...future.x_jj <- ...future.x_ii[[jj]] [12:18:38.432] { [12:18:38.432] NULL [12:18:38.432] ii <- NULL [12:18:38.432] } [12:18:38.432] ...future.env <- environment() [12:18:38.432] local({ [12:18:38.432] for (name in names(...future.x_jj)) { [12:18:38.432] assign(name, ...future.x_jj[[name]], envir = ...future.env, [12:18:38.432] inherits = FALSE) [12:18:38.432] } [12:18:38.432] }) [12:18:38.432] tryCatch(ii, error = identity) [12:18:38.432] }) [12:18:38.432] } [12:18:38.433] - globals: [1] '...future.x_ii' [12:18:38.434] List of 1 [12:18:38.434] $ ...future.x_ii: NULL [12:18:38.434] - attr(*, "where")=List of 1 [12:18:38.434] ..$ ...future.x_ii:<environment: R_EmptyEnv> [12:18:38.434] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [12:18:38.434] - attr(*, "resolved")= logi FALSE [12:18:38.434] - attr(*, "total_size")= num 27 [12:18:38.438] - packages: [1] 'doFuture' [12:18:38.438] - identifying globals and packages ... DONE [12:18:38.491] Number of chunks: 1 [12:18:38.491] Number of futures (= number of chunks): 1 [12:18:38.491] Launching 1 futures (chunks) ... [12:18:38.492] Chunk #1 of 1 ... [12:18:38.492] - Finding globals in 'args_list' chunk #1 ... [12:18:38.493] [12:18:38.493] [12:18:38.494] - Finding globals in 'args_list' for chunk #1 ... DONE [12:18:38.501] Chunk #1 of 1 ... DONE [12:18:38.501] Launching 1 futures (chunks) ... DONE [12:18:38.501] - resolving futures [12:18:38.501] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: dbc264267d972b4949a8481bff1a7732-2 DEBUG: BEGIN TROUBLESHOOTING HELP Future involved: ClusterFuture: Label: 'doFuture-1' Expression: { "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" "# also in nested calls " doFuture::registerDoFuture() "# doFuture():::doFuture(): process chunk of elements" lapply(seq_along(...future.x_ii), FUN = function(jj) { ...future.x_jj <- ...future.x_ii[[jj]] { NULL ii <- NULL } ...future.env <- environment() local({ for (name in names(...future.x_jj)) { assign(name, ...future.x_jj[[name]], envir = ...future.env, inherits = FALSE) } }) tryCatch(ii, error = identity) }) } Lazy evaluation: FALSE Asynchronous evaluation: TRUE Local evaluation: TRUE Environment: R_GlobalEnv Capture standard output: TRUE Capture condition classes: 'condition' (excluding '<none>') Immediate condition classes: 'immediateCondition' Globals: 1 objects totaling 194 bytes (list '...future.x_ii' of 194 bytes) Packages: 1 packages ('doFuture') L'Ecuyer-CMRG RNG seed: <none> (seed = FALSE) Resolved: TRUE Value: <not collected> Conditions captured: <none> Early signaling: FALSE Owner process: dbc264267d972b4949a8481bff1a7732 Class: 'ClusterFuture', 'MultiprocessFuture', 'Future' DEBUG: END TROUBLESHOOTING HELP Error in serialize(data, node$con) : error writing to connection Calls: <Anonymous> ... postNode -> sendData -> sendData.SOCKnode -> serialize Execution halted Flavor: r-devel-windows-x86_64

Version: 1.0.2
Check: tests
Result: ERROR Running 'foreach_dofuture,cluster-missing-doFuture-pkg.R' [62s] Running 'foreach_dofuture,errors.R' [10s] Running 'foreach_dofuture,globals.R' [7s] Running 'foreach_dofuture,nested_colon.R' [14s] Running 'foreach_dofuture,nested_dofuture.R' [15s] Running 'foreach_dofuture,rng.R' [4s] Running 'foreach_dofuture.R' [3s] Running 'foreach_dopar,cluster-missing-doFuture-pkg.R' [62s] Running 'foreach_dopar,doRNG,dopar.R' [2s] Running 'foreach_dopar,doRNG,dorng.R' [5s] Running 'foreach_dopar,errors.R' [8s] Running 'foreach_dopar,globals.R' [7s] Running 'foreach_dopar,nested_colon.R' [13s] Running 'foreach_dopar,nested_dopar.R' [16s] Running 'foreach_dopar,options-for-export.R' [5s] Running 'foreach_dopar.R' [3s] Running 'makeChunks.R' [4s] Running 'options,nested.R' [4s] Running 'registerDoFuture.R' [2s] Running 'times.R' [2s] Running 'utils.R' [1s] Running 'withDoRNG.R' [4s] Running the tests in 'tests/foreach_dofuture,cluster-missing-doFuture-pkg.R' failed. Complete output: > source("incl/start.R") Loading required package: foreach Loading required package: future R version 4.5.0 (2025-04-11 ucrt) Platform: x86_64-w64-mingw32/x64 Running under: Windows Server 2022 x64 (build 20348) Matrix products: default LAPACK version 3.12.1 locale: [1] LC_COLLATE=C LC_CTYPE=German_Germany.utf8 [3] LC_MONETARY=C LC_NUMERIC=C [5] LC_TIME=C time zone: Europe/Berlin tzcode source: internal attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] doFuture_1.0.2 future_1.40.0 foreach_1.5.2 loaded via a namespace (and not attached): [1] compiler_4.5.0 parallelly_1.43.0 tools_4.5.0 [4] parallel_4.5.0 future.apply_1.11.3 listenv_0.9.1 [7] codetools_0.2-20 iterators_1.0.14 digest_0.6.37 [10] globals_0.17.0 > options(future.debug = FALSE) > > message("*** cluster() ...") *** cluster() ... > > message("Library paths: ", paste(sQuote(.libPaths()), collapse = ", ")) Library paths: 'D:/temp/2025_04_21_01_50_00_22712/Rtmpq4CPx5/RLIBS_2add896744', 'D:/RCompile/recent/R-4.5.0/library' > message("Package path: ", sQuote(system.file(package = "future"))) Package path: 'D:/RCompile/CRANpkg/lib/4.5/future' > > types <- "PSOCK" > #if (supportsMulticore()) types <- c(types, "FORK") > > setupClusterWithoutPkgs <- function(type = "PSOCK", + withs = c("digest", "globals", + "listenv", "future"), + withouts = c("doFuture")) { + cl <- parallel::makeCluster(1L, type = type, timeout = 60) + + ## Emulate a worker that does not have 'future' installed. + ## by setting a different user library path on the worker. + libs <- parallel::clusterEvalQ(cl, .libPaths(tempdir()))[[1]] + attr(cl, "libs") <- libs + + ## 'withouts' tops 'withs' for conveniency + withs <- setdiff(withs, withouts) + + ## "Install" any 'withs' packages? + if (length(withs) > 0L) { + paths <- find.package(withs) + res <- parallel::clusterCall(cl, fun = sapply, X = paths, + FUN = file.copy, to = libs[1], + recursive = TRUE)[[1]] + res <- parallel::clusterCall(cl, fun = sapply, X = withs, + FUN = requireNamespace)[[1]] + } + attr(cl, "withs") <- res + + ## Check whether 'future' is still available on the worker or not. + ## It could be that it is installed in the system library path, which + ## in case we cannot "hide" the future package from the worker. + res <- parallel::clusterCall(cl, fun = sapply, X = withouts, + FUN = requireNamespace)[[1]] + attr(cl, "withouts") <- res + + cl + } > > cl <- NULL > for (type in types) { + message(sprintf("Test set #1 with cluster type %s ...", sQuote(type))) + + cl <- setupClusterWithoutPkgs(type, withouts = c("future", "doFuture")) + if (all(attr(cl, "withs")) && !all(attr(cl, "withouts"))) { + plan(cluster, workers = cl, .init = FALSE) + + ## Here we will get: + ## <UnexpectedFutureResultError: Unexpected result (of class + ## 'snow-try-error' != 'FutureResult') retrieved for ClusterFuture + ## future (label = '<none>', expression = '{ ... }'): + ## Package 'future' is not installed on worker (r_version: ...)> + ## Note: This error is produced by the future backend when it recieves + ## the unexpected results. + res <- tryCatch({ + y <- foreach(ii = 1:3) %dofuture% ii + }, error = identity) + print(res) + stopifnot(inherits(res, "FutureError")) + } + parallel::stopCluster(cl) + cl <- NULL + + cl <- setupClusterWithoutPkgs(type) + if (all(attr(cl, "withs")) && !all(attr(cl, "withouts"))) { + plan(cluster, workers = cl, .init = FALSE) + + ## Here we will get: + ## <UnexpectedFutureResultError: Unexpected result (of class + ## 'snow-try-error' != 'FutureResult') retrieved for ClusterFuture + ## future (label = '<none>', expression = '{ ... }'): + ## there is no package called 'doFuture'> + ## Note: This error is produced by the future backend when it recieves + ## the unexpected results. + res <- tryCatch({ + y <- foreach(ii = 1:3) %dofuture% ii + }, error = identity) + print(res) + stopifnot(inherits(res, "FutureError")) + } + parallel::stopCluster(cl) + cl <- NULL + + plan(sequential) + + message(sprintf("Test set #1 with cluster type %s ... DONE", sQuote(type))) + } ## for (type ...) Test set #1 with cluster type 'PSOCK' ... [15:16:42.827] doFuture2() ... [15:16:42.876] Number of chunks: 1 [15:16:42.876] Number of futures (= number of chunks): 1 [15:16:42.876] seed = FALSE [15:16:42.877] NULL [15:16:42.880] seed = FALSE [15:16:42.880] seed = FALSE [15:16:42.880] - %dofuture% R expression: [15:16:42.880] ii [15:16:42.881] - foreach iterator arguments: [1] 'ii' [15:16:42.881] - dummy globals (as locals): [1] 'ii' [15:16:42.882] - R expression (map-reduce expression adjusted for RNG): [15:16:42.882] { [15:16:42.882] NULL [15:16:42.882] "# doFuture():::doFuture2(): process chunk of elements" [15:16:42.882] lapply(seq_along(...future.x_ii), FUN = function(jj) { [15:16:42.882] ...future.x_jj <- ...future.x_ii[[jj]] [15:16:42.882] { [15:16:42.882] NULL [15:16:42.882] ii <- NULL [15:16:42.882] } [15:16:42.882] ...future.env <- environment() [15:16:42.882] local({ [15:16:42.882] for (name in names(...future.x_jj)) { [15:16:42.882] assign(name, ...future.x_jj[[name]], envir = ...future.env, [15:16:42.882] inherits = FALSE) [15:16:42.882] } [15:16:42.882] }) [15:16:42.882] NULL [15:16:42.882] tryCatch(ii, error = identity) [15:16:42.882] }) [15:16:42.882] } [15:16:42.883] - identifying globals and packages ... [15:16:42.883] - Argument 'globals': [15:16:42.883] logi TRUE [15:16:42.883] - attr(*, "add")= chr "...future.x_ii" [15:16:42.883] - attr(*, "ignore")= chr "ii" [15:16:42.886] - R expression (map-reduce expression searched for globals): [15:16:42.886] { [15:16:42.886] NULL [15:16:42.886] "# doFuture():::doFuture2(): process chunk of elements" [15:16:42.886] lapply(seq_along(...future.x_ii), FUN = function(jj) { [15:16:42.886] ...future.x_jj <- ...future.x_ii[[jj]] [15:16:42.886] { [15:16:42.886] NULL [15:16:42.886] ii <- NULL [15:16:42.886] } [15:16:42.886] ...future.env <- environment() [15:16:42.886] local({ [15:16:42.886] for (name in names(...future.x_jj)) { [15:16:42.886] assign(name, ...future.x_jj[[name]], envir = ...future.env, [15:16:42.886] inherits = FALSE) [15:16:42.886] } [15:16:42.886] }) [15:16:42.886] NULL [15:16:42.886] tryCatch(ii, error = identity) [15:16:42.886] }) [15:16:42.886] } [15:16:42.898] - R expression (%dofuture% expression searched for globals): [15:16:42.898] ii [15:16:42.900] - Globals in %dofuture% R expression not in map-reduce expression: [15:16:42.901] - Appending 0 globals only found in the vanilla %dofuture% expression: [15:16:42.901] - globals: [1] '...future.x_ii' [15:16:42.901] List of 1 [15:16:42.901] $ ...future.x_ii: num 42 [15:16:42.901] - attr(*, "where")=List of 1 [15:16:42.901] ..$ ...future.x_ii:<environment: R_EmptyEnv> [15:16:42.901] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [15:16:42.901] - attr(*, "resolved")= logi FALSE [15:16:42.901] - attr(*, "total_size")= num 39 [15:16:42.906] - packages: [1] 'doFuture' [15:16:42.906] - identifying globals and packages ... DONE [15:16:42.906] Launching 1 futures (chunks) ... [15:16:42.906] Chunk #1 of 1 ... [15:16:42.907] - Finding globals in 'args_list' for chunk #1 ... [15:16:42.908] [15:16:42.908] [15:16:42.908] - Finding globals in 'args_list' for chunk #1 ... DONE [15:16:42.909] - seeds: <none> [15:16:42.917] Chunk #1 of 1 ... DONE [15:16:42.917] Launching 1 futures (chunks) ... DONE [15:16:42.918] - resolving futures [15:16:42.918] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture2-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: ab6ac241301fcb17640b305f217dbefd-2 DEBUG: BEGIN TROUBLESHOOTING HELP Future involved: ClusterFuture: Label: 'doFuture2-1' Expression: { NULL "# doFuture():::doFuture2(): process chunk of elements" lapply(seq_along(...future.x_ii), FUN = function(jj) { ...future.x_jj <- ...future.x_ii[[jj]] { NULL ii <- NULL } ...future.env <- environment() local({ for (name in names(...future.x_jj)) { assign(name, ...future.x_jj[[name]], envir = ...future.env, inherits = FALSE) } }) NULL tryCatch(ii, error = identity) }) } Lazy evaluation: FALSE Asynchronous evaluation: TRUE Local evaluation: TRUE Environment: R_GlobalEnv Capture standard output: TRUE Capture condition classes: 'condition' (excluding '<none>') Immediate condition classes: 'immediateCondition' Globals: 1 objects totaling 194 bytes (list '...future.x_ii' of 194 bytes) Packages: 1 packages ('doFuture') L'Ecuyer-CMRG RNG seed: <none> (seed = FALSE) Resolved: TRUE Value: <not collected> Conditions captured: <none> Early signaling: FALSE Owner process: ab6ac241301fcb17640b305f217dbefd Class: 'ClusterFuture', 'MultiprocessFuture', 'Future' DEBUG: END TROUBLESHOOTING HELP Error in serialize(data, node$con) : error writing to connection Calls: <Anonymous> ... postNode -> sendData -> sendData.SOCKnode -> serialize Execution halted Running the tests in 'tests/foreach_dopar,cluster-missing-doFuture-pkg.R' failed. Complete output: > source("incl/start.R") Loading required package: foreach Loading required package: future R version 4.5.0 (2025-04-11 ucrt) Platform: x86_64-w64-mingw32/x64 Running under: Windows Server 2022 x64 (build 20348) Matrix products: default LAPACK version 3.12.1 locale: [1] LC_COLLATE=C LC_CTYPE=German_Germany.utf8 [3] LC_MONETARY=C LC_NUMERIC=C [5] LC_TIME=C time zone: Europe/Berlin tzcode source: internal attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] doFuture_1.0.2 future_1.40.0 foreach_1.5.2 loaded via a namespace (and not attached): [1] compiler_4.5.0 parallelly_1.43.0 tools_4.5.0 [4] parallel_4.5.0 future.apply_1.11.3 listenv_0.9.1 [7] codetools_0.2-20 iterators_1.0.14 digest_0.6.37 [10] globals_0.17.0 > options(future.debug = FALSE) > > message("*** cluster() ...") *** cluster() ... > > registerDoFuture() > > message("Library paths: ", paste(sQuote(.libPaths()), collapse = ", ")) Library paths: 'D:/temp/2025_04_21_01_50_00_22712/Rtmpq4CPx5/RLIBS_2add896744', 'D:/RCompile/recent/R-4.5.0/library' > message("Package path: ", sQuote(system.file(package = "future"))) Package path: 'D:/RCompile/CRANpkg/lib/4.5/future' > > types <- "PSOCK" > #if (supportsMulticore()) types <- c(types, "FORK") > > setupClusterWithoutPkgs <- function(type = "PSOCK", + withs = c("digest", "globals", + "listenv", "future"), + withouts = c("doFuture")) { + cl <- parallel::makeCluster(1L, type = type, timeout = 60) + + ## Emulate a worker that does not have 'future' installed. + ## by setting a different user library path on the worker. + libs <- parallel::clusterEvalQ(cl, .libPaths(tempdir()))[[1]] + attr(cl, "libs") <- libs + + ## 'withouts' tops 'withs' for conveniency + withs <- setdiff(withs, withouts) + + ## "Install" any 'withs' packages? + if (length(withs) > 0L) { + paths <- find.package(withs) + res <- parallel::clusterCall(cl, fun = sapply, X = paths, + FUN = file.copy, to = libs[1], + recursive = TRUE)[[1]] + res <- parallel::clusterCall(cl, fun = sapply, X = withs, + FUN = requireNamespace)[[1]] + } + attr(cl, "withs") <- res + + ## Check whether 'future' is still available on the worker or not. + ## It could be that it is installed in the system library path, which + ## in case we cannot "hide" the future package from the worker. + res <- parallel::clusterCall(cl, fun = sapply, X = withouts, + FUN = requireNamespace)[[1]] + attr(cl, "withouts") <- res + + cl + } > > > cl <- NULL > for (type in types) { + message(sprintf("Test set #1 with cluster type %s ...", sQuote(type))) + + cl <- setupClusterWithoutPkgs(type, withouts = c("future", "doFuture")) + if (all(attr(cl, "withs")) && !all(attr(cl, "withouts"))) { + plan(cluster, workers = cl, .init = FALSE) + + ## Here we will get: + ## <UnexpectedFutureResultError: Unexpected result (of class + ## 'snow-try-error' != 'FutureResult') retrieved for ClusterFuture + ## future (label = '<none>', expression = '{ ... }'): + ## Package 'future' is not installed on worker (r_version: ...)> + ## Note: This error is produced by the future backend when it recieves + ## the unexpected results. + res <- tryCatch({ + y <- foreach(ii = 1:3) %dopar% ii + }, error = identity) + print(res) + stopifnot(inherits(res, "FutureError")) + } + parallel::stopCluster(cl) + cl <- NULL + + cl <- setupClusterWithoutPkgs(type) + if (all(attr(cl, "withs")) && !all(attr(cl, "withouts"))) { + plan(cluster, workers = cl, .init = FALSE) + + ## Here we will get: + ## <UnexpectedFutureResultError: Unexpected result (of class + ## 'snow-try-error' != 'FutureResult') retrieved for ClusterFuture + ## future (label = '<none>', expression = '{ ... }'): + ## there is no package called 'doFuture'> + ## Note: This error is produced by the future backend when it recieves + ## the unexpected results. + res <- tryCatch({ + y <- foreach(ii = 1:3) %dopar% ii + }, error = identity) + print(res) + stopifnot(inherits(res, "FutureError")) + } + parallel::stopCluster(cl) + cl <- NULL + + plan(sequential) + + message(sprintf("Test set #1 with cluster type %s ... DONE", sQuote(type))) + } ## for (type ...) Test set #1 with cluster type 'PSOCK' ... [15:18:38.918] doFuture() ... [15:18:38.922] - dummy globals (as locals): [1] 'ii' [15:18:38.922] - R expression: [15:18:38.923] { [15:18:38.923] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [15:18:38.923] "# also in nested calls " [15:18:38.923] doFuture::registerDoFuture() [15:18:38.923] "# doFuture():::doFuture(): process chunk of elements" [15:18:38.923] lapply(seq_along(...future.x_ii), FUN = function(jj) { [15:18:38.923] ...future.x_jj <- ...future.x_ii[[jj]] [15:18:38.923] { [15:18:38.923] NULL [15:18:38.923] ii <- NULL [15:18:38.923] } [15:18:38.923] ...future.env <- environment() [15:18:38.923] local({ [15:18:38.923] for (name in names(...future.x_jj)) { [15:18:38.923] assign(name, ...future.x_jj[[name]], envir = ...future.env, [15:18:38.923] inherits = FALSE) [15:18:38.923] } [15:18:38.923] }) [15:18:38.923] tryCatch(ii, error = identity) [15:18:38.923] }) [15:18:38.923] } [15:18:38.924] - identifying globals and packages ... [15:18:38.943] List of 1 [15:18:38.943] $ ...future.x_ii: NULL [15:18:38.943] - attr(*, "where")=List of 1 [15:18:38.943] ..$ ...future.x_ii:<environment: R_EmptyEnv> [15:18:38.943] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [15:18:38.943] - attr(*, "resolved")= logi FALSE [15:18:38.943] - attr(*, "total_size")= num 27 [15:18:38.950] - R expression: [15:18:38.950] { [15:18:38.950] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [15:18:38.950] "# also in nested calls " [15:18:38.950] doFuture::registerDoFuture() [15:18:38.950] "# doFuture():::doFuture(): process chunk of elements" [15:18:38.950] lapply(seq_along(...future.x_ii), FUN = function(jj) { [15:18:38.950] ...future.x_jj <- ...future.x_ii[[jj]] [15:18:38.950] { [15:18:38.950] NULL [15:18:38.950] ii <- NULL [15:18:38.950] } [15:18:38.950] ...future.env <- environment() [15:18:38.950] local({ [15:18:38.950] for (name in names(...future.x_jj)) { [15:18:38.950] assign(name, ...future.x_jj[[name]], envir = ...future.env, [15:18:38.950] inherits = FALSE) [15:18:38.950] } [15:18:38.950] }) [15:18:38.950] tryCatch(ii, error = identity) [15:18:38.950] }) [15:18:38.950] } [15:18:38.951] - globals: [1] '...future.x_ii' [15:18:38.951] List of 1 [15:18:38.951] $ ...future.x_ii: NULL [15:18:38.951] - attr(*, "where")=List of 1 [15:18:38.951] ..$ ...future.x_ii:<environment: R_EmptyEnv> [15:18:38.951] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [15:18:38.951] - attr(*, "resolved")= logi FALSE [15:18:38.951] - attr(*, "total_size")= num 27 [15:18:38.956] - packages: [1] 'doFuture' [15:18:38.956] - identifying globals and packages ... DONE [15:18:39.019] Number of chunks: 1 [15:18:39.019] Number of futures (= number of chunks): 1 [15:18:39.019] Launching 1 futures (chunks) ... [15:18:39.020] Chunk #1 of 1 ... [15:18:39.020] - Finding globals in 'args_list' chunk #1 ... [15:18:39.021] [15:18:39.021] [15:18:39.022] - Finding globals in 'args_list' for chunk #1 ... DONE [15:18:39.029] Chunk #1 of 1 ... DONE [15:18:39.029] Launching 1 futures (chunks) ... DONE [15:18:39.029] - resolving futures [15:18:39.030] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: 4e0b1ad2c47842f5b1daebb174e76686-2 DEBUG: BEGIN TROUBLESHOOTING HELP Future involved: ClusterFuture: Label: 'doFuture-1' Expression: { "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" "# also in nested calls " doFuture::registerDoFuture() "# doFuture():::doFuture(): process chunk of elements" lapply(seq_along(...future.x_ii), FUN = function(jj) { ...future.x_jj <- ...future.x_ii[[jj]] { NULL ii <- NULL } ...future.env <- environment() local({ for (name in names(...future.x_jj)) { assign(name, ...future.x_jj[[name]], envir = ...future.env, inherits = FALSE) } }) tryCatch(ii, error = identity) }) } Lazy evaluation: FALSE Asynchronous evaluation: TRUE Local evaluation: TRUE Environment: R_GlobalEnv Capture standard output: TRUE Capture condition classes: 'condition' (excluding '<none>') Immediate condition classes: 'immediateCondition' Globals: 1 objects totaling 194 bytes (list '...future.x_ii' of 194 bytes) Packages: 1 packages ('doFuture') L'Ecuyer-CMRG RNG seed: <none> (seed = FALSE) Resolved: TRUE Value: <not collected> Conditions captured: <none> Early signaling: FALSE Owner process: 4e0b1ad2c47842f5b1daebb174e76686 Class: 'ClusterFuture', 'MultiprocessFuture', 'Future' DEBUG: END TROUBLESHOOTING HELP Error in serialize(data, node$con) : error writing to connection Calls: <Anonymous> ... postNode -> sendData -> sendData.SOCKnode -> serialize Execution halted Flavor: r-release-windows-x86_64

Version: 1.0.2
Check: tests
Result: ERROR Running 'foreach_dofuture,cluster-missing-doFuture-pkg.R' [63s] Running 'foreach_dofuture,errors.R' [13s] Running 'foreach_dofuture,globals.R' [9s] Running 'foreach_dofuture,nested_colon.R' [18s] Running 'foreach_dofuture,nested_dofuture.R' [19s] Running 'foreach_dofuture,rng.R' [5s] Running 'foreach_dofuture.R' [4s] Running 'foreach_dopar,cluster-missing-doFuture-pkg.R' [63s] Running 'foreach_dopar,doRNG,dopar.R' [3s] Running 'foreach_dopar,doRNG,dorng.R' [7s] Running 'foreach_dopar,errors.R' [9s] Running 'foreach_dopar,globals.R' [9s] Running 'foreach_dopar,nested_colon.R' [16s] Running 'foreach_dopar,nested_dopar.R' [21s] Running 'foreach_dopar,options-for-export.R' [6s] Running 'foreach_dopar.R' [4s] Running 'makeChunks.R' [4s] Running 'options,nested.R' [4s] Running 'registerDoFuture.R' [2s] Running 'times.R' [2s] Running 'utils.R' [1s] Running 'withDoRNG.R' [5s] Running the tests in 'tests/foreach_dofuture,cluster-missing-doFuture-pkg.R' failed. Complete output: > source("incl/start.R") Loading required package: foreach Loading required package: future R version 4.4.3 (2025-02-28 ucrt) Platform: x86_64-w64-mingw32/x64 Running under: Windows Server 2022 x64 (build 20348) Matrix products: default locale: [1] LC_COLLATE=C LC_CTYPE=German_Germany.utf8 [3] LC_MONETARY=C LC_NUMERIC=C [5] LC_TIME=C time zone: Europe/Berlin tzcode source: internal attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] doFuture_1.0.2 future_1.40.0 foreach_1.5.2 loaded via a namespace (and not attached): [1] compiler_4.4.3 parallelly_1.43.0 tools_4.4.3 [4] parallel_4.4.3 future.apply_1.11.3 listenv_0.9.1 [7] codetools_0.2-20 iterators_1.0.14 digest_0.6.37 [10] globals_0.17.0 > options(future.debug = FALSE) > > message("*** cluster() ...") *** cluster() ... > > message("Library paths: ", paste(sQuote(.libPaths()), collapse = ", ")) Library paths: 'D:/temp/2025_04_21_01_50_00_22712/Rtmpk1kbEm/RLIBS_24ca078352101', 'D:/RCompile/recent/R-4.4.3/library' > message("Package path: ", sQuote(system.file(package = "future"))) Package path: 'D:/RCompile/CRANpkg/lib/4.4/future' > > types <- "PSOCK" > #if (supportsMulticore()) types <- c(types, "FORK") > > setupClusterWithoutPkgs <- function(type = "PSOCK", + withs = c("digest", "globals", + "listenv", "future"), + withouts = c("doFuture")) { + cl <- parallel::makeCluster(1L, type = type, timeout = 60) + + ## Emulate a worker that does not have 'future' installed. + ## by setting a different user library path on the worker. + libs <- parallel::clusterEvalQ(cl, .libPaths(tempdir()))[[1]] + attr(cl, "libs") <- libs + + ## 'withouts' tops 'withs' for conveniency + withs <- setdiff(withs, withouts) + + ## "Install" any 'withs' packages? + if (length(withs) > 0L) { + paths <- find.package(withs) + res <- parallel::clusterCall(cl, fun = sapply, X = paths, + FUN = file.copy, to = libs[1], + recursive = TRUE)[[1]] + res <- parallel::clusterCall(cl, fun = sapply, X = withs, + FUN = requireNamespace)[[1]] + } + attr(cl, "withs") <- res + + ## Check whether 'future' is still available on the worker or not. + ## It could be that it is installed in the system library path, which + ## in case we cannot "hide" the future package from the worker. + res <- parallel::clusterCall(cl, fun = sapply, X = withouts, + FUN = requireNamespace)[[1]] + attr(cl, "withouts") <- res + + cl + } > > cl <- NULL > for (type in types) { + message(sprintf("Test set #1 with cluster type %s ...", sQuote(type))) + + cl <- setupClusterWithoutPkgs(type, withouts = c("future", "doFuture")) + if (all(attr(cl, "withs")) && !all(attr(cl, "withouts"))) { + plan(cluster, workers = cl, .init = FALSE) + + ## Here we will get: + ## <UnexpectedFutureResultError: Unexpected result (of class + ## 'snow-try-error' != 'FutureResult') retrieved for ClusterFuture + ## future (label = '<none>', expression = '{ ... }'): + ## Package 'future' is not installed on worker (r_version: ...)> + ## Note: This error is produced by the future backend when it recieves + ## the unexpected results. + res <- tryCatch({ + y <- foreach(ii = 1:3) %dofuture% ii + }, error = identity) + print(res) + stopifnot(inherits(res, "FutureError")) + } + parallel::stopCluster(cl) + cl <- NULL + + cl <- setupClusterWithoutPkgs(type) + if (all(attr(cl, "withs")) && !all(attr(cl, "withouts"))) { + plan(cluster, workers = cl, .init = FALSE) + + ## Here we will get: + ## <UnexpectedFutureResultError: Unexpected result (of class + ## 'snow-try-error' != 'FutureResult') retrieved for ClusterFuture + ## future (label = '<none>', expression = '{ ... }'): + ## there is no package called 'doFuture'> + ## Note: This error is produced by the future backend when it recieves + ## the unexpected results. + res <- tryCatch({ + y <- foreach(ii = 1:3) %dofuture% ii + }, error = identity) + print(res) + stopifnot(inherits(res, "FutureError")) + } + parallel::stopCluster(cl) + cl <- NULL + + plan(sequential) + + message(sprintf("Test set #1 with cluster type %s ... DONE", sQuote(type))) + } ## for (type ...) Test set #1 with cluster type 'PSOCK' ... [19:15:42.131] doFuture2() ... [19:15:42.213] Number of chunks: 1 [19:15:42.214] Number of futures (= number of chunks): 1 [19:15:42.214] seed = FALSE [19:15:42.214] NULL [19:15:42.217] seed = FALSE [19:15:42.218] seed = FALSE [19:15:42.218] - %dofuture% R expression: [19:15:42.218] ii [19:15:42.219] - foreach iterator arguments: [1] 'ii' [19:15:42.219] - dummy globals (as locals): [1] 'ii' [19:15:42.220] - R expression (map-reduce expression adjusted for RNG): [19:15:42.220] { [19:15:42.220] NULL [19:15:42.220] "# doFuture():::doFuture2(): process chunk of elements" [19:15:42.220] lapply(seq_along(...future.x_ii), FUN = function(jj) { [19:15:42.220] ...future.x_jj <- ...future.x_ii[[jj]] [19:15:42.220] { [19:15:42.220] NULL [19:15:42.220] ii <- NULL [19:15:42.220] } [19:15:42.220] ...future.env <- environment() [19:15:42.220] local({ [19:15:42.220] for (name in names(...future.x_jj)) { [19:15:42.220] assign(name, ...future.x_jj[[name]], envir = ...future.env, [19:15:42.220] inherits = FALSE) [19:15:42.220] } [19:15:42.220] }) [19:15:42.220] NULL [19:15:42.220] tryCatch(ii, error = identity) [19:15:42.220] }) [19:15:42.220] } [19:15:42.221] - identifying globals and packages ... [19:15:42.221] - Argument 'globals': [19:15:42.222] logi TRUE [19:15:42.222] - attr(*, "add")= chr "...future.x_ii" [19:15:42.222] - attr(*, "ignore")= chr "ii" [19:15:42.226] - R expression (map-reduce expression searched for globals): [19:15:42.227] { [19:15:42.227] NULL [19:15:42.227] "# doFuture():::doFuture2(): process chunk of elements" [19:15:42.227] lapply(seq_along(...future.x_ii), FUN = function(jj) { [19:15:42.227] ...future.x_jj <- ...future.x_ii[[jj]] [19:15:42.227] { [19:15:42.227] NULL [19:15:42.227] ii <- NULL [19:15:42.227] } [19:15:42.227] ...future.env <- environment() [19:15:42.227] local({ [19:15:42.227] for (name in names(...future.x_jj)) { [19:15:42.227] assign(name, ...future.x_jj[[name]], envir = ...future.env, [19:15:42.227] inherits = FALSE) [19:15:42.227] } [19:15:42.227] }) [19:15:42.227] NULL [19:15:42.227] tryCatch(ii, error = identity) [19:15:42.227] }) [19:15:42.227] } [19:15:42.250] - R expression (%dofuture% expression searched for globals): [19:15:42.250] ii [19:15:42.253] - Globals in %dofuture% R expression not in map-reduce expression: [19:15:42.254] - Appending 0 globals only found in the vanilla %dofuture% expression: [19:15:42.254] - globals: [1] '...future.x_ii' [19:15:42.254] List of 1 [19:15:42.254] $ ...future.x_ii: num 42 [19:15:42.254] - attr(*, "where")=List of 1 [19:15:42.254] ..$ ...future.x_ii:<environment: R_EmptyEnv> [19:15:42.254] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [19:15:42.254] - attr(*, "resolved")= logi FALSE [19:15:42.254] - attr(*, "total_size")= num 39 [19:15:42.261] - packages: [1] 'doFuture' [19:15:42.261] - identifying globals and packages ... DONE [19:15:42.261] Launching 1 futures (chunks) ... [19:15:42.262] Chunk #1 of 1 ... [19:15:42.262] - Finding globals in 'args_list' for chunk #1 ... [19:15:42.264] [19:15:42.264] [19:15:42.265] - Finding globals in 'args_list' for chunk #1 ... DONE [19:15:42.265] - seeds: <none> [19:15:42.275] Chunk #1 of 1 ... DONE [19:15:42.275] Launching 1 futures (chunks) ... DONE [19:15:42.276] - resolving futures [19:15:42.276] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture2-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: 3ae73bb53c5e85ca275d3174c69095d8-2 DEBUG: BEGIN TROUBLESHOOTING HELP Future involved: ClusterFuture: Label: 'doFuture2-1' Expression: { NULL "# doFuture():::doFuture2(): process chunk of elements" lapply(seq_along(...future.x_ii), FUN = function(jj) { ...future.x_jj <- ...future.x_ii[[jj]] { NULL ii <- NULL } ...future.env <- environment() local({ for (name in names(...future.x_jj)) { assign(name, ...future.x_jj[[name]], envir = ...future.env, inherits = FALSE) } }) NULL tryCatch(ii, error = identity) }) } Lazy evaluation: FALSE Asynchronous evaluation: TRUE Local evaluation: TRUE Environment: R_GlobalEnv Capture standard output: TRUE Capture condition classes: 'condition' (excluding '<none>') Immediate condition classes: 'immediateCondition' Globals: 1 objects totaling 194 bytes (list '...future.x_ii' of 194 bytes) Packages: 1 packages ('doFuture') L'Ecuyer-CMRG RNG seed: <none> (seed = FALSE) Resolved: TRUE Value: <not collected> Conditions captured: <none> Early signaling: FALSE Owner process: 3ae73bb53c5e85ca275d3174c69095d8 Class: 'ClusterFuture', 'MultiprocessFuture', 'Future' DEBUG: END TROUBLESHOOTING HELP Error in serialize(data, node$con) : error writing to connection Calls: <Anonymous> ... postNode -> sendData -> sendData.SOCKnode -> serialize Execution halted Running the tests in 'tests/foreach_dopar,cluster-missing-doFuture-pkg.R' failed. Complete output: > source("incl/start.R") Loading required package: foreach Loading required package: future R version 4.4.3 (2025-02-28 ucrt) Platform: x86_64-w64-mingw32/x64 Running under: Windows Server 2022 x64 (build 20348) Matrix products: default locale: [1] LC_COLLATE=C LC_CTYPE=German_Germany.utf8 [3] LC_MONETARY=C LC_NUMERIC=C [5] LC_TIME=C time zone: Europe/Berlin tzcode source: internal attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] doFuture_1.0.2 future_1.40.0 foreach_1.5.2 loaded via a namespace (and not attached): [1] compiler_4.4.3 parallelly_1.43.0 tools_4.4.3 [4] parallel_4.4.3 future.apply_1.11.3 listenv_0.9.1 [7] codetools_0.2-20 iterators_1.0.14 digest_0.6.37 [10] globals_0.17.0 > options(future.debug = FALSE) > > message("*** cluster() ...") *** cluster() ... > > registerDoFuture() > > message("Library paths: ", paste(sQuote(.libPaths()), collapse = ", ")) Library paths: 'D:/temp/2025_04_21_01_50_00_22712/Rtmpk1kbEm/RLIBS_24ca078352101', 'D:/RCompile/recent/R-4.4.3/library' > message("Package path: ", sQuote(system.file(package = "future"))) Package path: 'D:/RCompile/CRANpkg/lib/4.4/future' > > types <- "PSOCK" > #if (supportsMulticore()) types <- c(types, "FORK") > > setupClusterWithoutPkgs <- function(type = "PSOCK", + withs = c("digest", "globals", + "listenv", "future"), + withouts = c("doFuture")) { + cl <- parallel::makeCluster(1L, type = type, timeout = 60) + + ## Emulate a worker that does not have 'future' installed. + ## by setting a different user library path on the worker. + libs <- parallel::clusterEvalQ(cl, .libPaths(tempdir()))[[1]] + attr(cl, "libs") <- libs + + ## 'withouts' tops 'withs' for conveniency + withs <- setdiff(withs, withouts) + + ## "Install" any 'withs' packages? + if (length(withs) > 0L) { + paths <- find.package(withs) + res <- parallel::clusterCall(cl, fun = sapply, X = paths, + FUN = file.copy, to = libs[1], + recursive = TRUE)[[1]] + res <- parallel::clusterCall(cl, fun = sapply, X = withs, + FUN = requireNamespace)[[1]] + } + attr(cl, "withs") <- res + + ## Check whether 'future' is still available on the worker or not. + ## It could be that it is installed in the system library path, which + ## in case we cannot "hide" the future package from the worker. + res <- parallel::clusterCall(cl, fun = sapply, X = withouts, + FUN = requireNamespace)[[1]] + attr(cl, "withouts") <- res + + cl + } > > > cl <- NULL > for (type in types) { + message(sprintf("Test set #1 with cluster type %s ...", sQuote(type))) + + cl <- setupClusterWithoutPkgs(type, withouts = c("future", "doFuture")) + if (all(attr(cl, "withs")) && !all(attr(cl, "withouts"))) { + plan(cluster, workers = cl, .init = FALSE) + + ## Here we will get: + ## <UnexpectedFutureResultError: Unexpected result (of class + ## 'snow-try-error' != 'FutureResult') retrieved for ClusterFuture + ## future (label = '<none>', expression = '{ ... }'): + ## Package 'future' is not installed on worker (r_version: ...)> + ## Note: This error is produced by the future backend when it recieves + ## the unexpected results. + res <- tryCatch({ + y <- foreach(ii = 1:3) %dopar% ii + }, error = identity) + print(res) + stopifnot(inherits(res, "FutureError")) + } + parallel::stopCluster(cl) + cl <- NULL + + cl <- setupClusterWithoutPkgs(type) + if (all(attr(cl, "withs")) && !all(attr(cl, "withouts"))) { + plan(cluster, workers = cl, .init = FALSE) + + ## Here we will get: + ## <UnexpectedFutureResultError: Unexpected result (of class + ## 'snow-try-error' != 'FutureResult') retrieved for ClusterFuture + ## future (label = '<none>', expression = '{ ... }'): + ## there is no package called 'doFuture'> + ## Note: This error is produced by the future backend when it recieves + ## the unexpected results. + res <- tryCatch({ + y <- foreach(ii = 1:3) %dopar% ii + }, error = identity) + print(res) + stopifnot(inherits(res, "FutureError")) + } + parallel::stopCluster(cl) + cl <- NULL + + plan(sequential) + + message(sprintf("Test set #1 with cluster type %s ... DONE", sQuote(type))) + } ## for (type ...) Test set #1 with cluster type 'PSOCK' ... [19:17:54.214] doFuture() ... [19:17:54.216] - dummy globals (as locals): [1] 'ii' [19:17:54.217] - R expression: [19:17:54.217] { [19:17:54.217] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [19:17:54.217] "# also in nested calls " [19:17:54.217] doFuture::registerDoFuture() [19:17:54.217] "# doFuture():::doFuture(): process chunk of elements" [19:17:54.217] lapply(seq_along(...future.x_ii), FUN = function(jj) { [19:17:54.217] ...future.x_jj <- ...future.x_ii[[jj]] [19:17:54.217] { [19:17:54.217] NULL [19:17:54.217] ii <- NULL [19:17:54.217] } [19:17:54.217] ...future.env <- environment() [19:17:54.217] local({ [19:17:54.217] for (name in names(...future.x_jj)) { [19:17:54.217] assign(name, ...future.x_jj[[name]], envir = ...future.env, [19:17:54.217] inherits = FALSE) [19:17:54.217] } [19:17:54.217] }) [19:17:54.217] tryCatch(ii, error = identity) [19:17:54.217] }) [19:17:54.217] } [19:17:54.218] - identifying globals and packages ... [19:17:54.241] List of 1 [19:17:54.241] $ ...future.x_ii: NULL [19:17:54.241] - attr(*, "where")=List of 1 [19:17:54.241] ..$ ...future.x_ii:<environment: R_EmptyEnv> [19:17:54.241] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [19:17:54.241] - attr(*, "resolved")= logi FALSE [19:17:54.241] - attr(*, "total_size")= num 27 [19:17:54.253] - R expression: [19:17:54.254] { [19:17:54.254] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [19:17:54.254] "# also in nested calls " [19:17:54.254] doFuture::registerDoFuture() [19:17:54.254] "# doFuture():::doFuture(): process chunk of elements" [19:17:54.254] lapply(seq_along(...future.x_ii), FUN = function(jj) { [19:17:54.254] ...future.x_jj <- ...future.x_ii[[jj]] [19:17:54.254] { [19:17:54.254] NULL [19:17:54.254] ii <- NULL [19:17:54.254] } [19:17:54.254] ...future.env <- environment() [19:17:54.254] local({ [19:17:54.254] for (name in names(...future.x_jj)) { [19:17:54.254] assign(name, ...future.x_jj[[name]], envir = ...future.env, [19:17:54.254] inherits = FALSE) [19:17:54.254] } [19:17:54.254] }) [19:17:54.254] tryCatch(ii, error = identity) [19:17:54.254] }) [19:17:54.254] } [19:17:54.255] - globals: [1] '...future.x_ii' [19:17:54.256] List of 1 [19:17:54.256] $ ...future.x_ii: NULL [19:17:54.256] - attr(*, "where")=List of 1 [19:17:54.256] ..$ ...future.x_ii:<environment: R_EmptyEnv> [19:17:54.256] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [19:17:54.256] - attr(*, "resolved")= logi FALSE [19:17:54.256] - attr(*, "total_size")= num 27 [19:17:54.263] - packages: [1] 'doFuture' [19:17:54.263] - identifying globals and packages ... DONE [19:17:54.319] Number of chunks: 1 [19:17:54.320] Number of futures (= number of chunks): 1 [19:17:54.320] Launching 1 futures (chunks) ... [19:17:54.320] Chunk #1 of 1 ... [19:17:54.321] - Finding globals in 'args_list' chunk #1 ... [19:17:54.322] [19:17:54.322] [19:17:54.322] - Finding globals in 'args_list' for chunk #1 ... DONE [19:17:54.331] Chunk #1 of 1 ... DONE [19:17:54.331] Launching 1 futures (chunks) ... DONE [19:17:54.331] - resolving futures [19:17:54.332] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: c15bfa5a41f38e0182f75b847f5c7cba-2 DEBUG: BEGIN TROUBLESHOOTING HELP Future involved: ClusterFuture: Label: 'doFuture-1' Expression: { "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" "# also in nested calls " doFuture::registerDoFuture() "# doFuture():::doFuture(): process chunk of elements" lapply(seq_along(...future.x_ii), FUN = function(jj) { ...future.x_jj <- ...future.x_ii[[jj]] { NULL ii <- NULL } ...future.env <- environment() local({ for (name in names(...future.x_jj)) { assign(name, ...future.x_jj[[name]], envir = ...future.env, inherits = FALSE) } }) tryCatch(ii, error = identity) }) } Lazy evaluation: FALSE Asynchronous evaluation: TRUE Local evaluation: TRUE Environment: R_GlobalEnv Capture standard output: TRUE Capture condition classes: 'condition' (excluding '<none>') Immediate condition classes: 'immediateCondition' Globals: 1 objects totaling 194 bytes (list '...future.x_ii' of 194 bytes) Packages: 1 packages ('doFuture') L'Ecuyer-CMRG RNG seed: <none> (seed = FALSE) Resolved: TRUE Value: <not collected> Conditions captured: <none> Early signaling: FALSE Owner process: c15bfa5a41f38e0182f75b847f5c7cba Class: 'ClusterFuture', 'MultiprocessFuture', 'Future' DEBUG: END TROUBLESHOOTING HELP Error in serialize(data, node$con) : error writing to connection Calls: <Anonymous> ... postNode -> sendData -> sendData.SOCKnode -> serialize Execution halted Flavor: r-oldrel-windows-x86_64