CRAN Package Check Results for Package doFuture

Last updated on 2025-04-16 09:52:57 CEST.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.0.2 3.71 134.90 138.61 OK
r-devel-linux-x86_64-debian-gcc 1.0.2 2.42 108.36 110.78 OK
r-devel-linux-x86_64-fedora-clang 1.0.2 233.43 OK
r-devel-linux-x86_64-fedora-gcc 1.0.2 228.34 OK
r-devel-windows-x86_64 1.0.2 5.00 309.00 314.00 ERROR
r-patched-linux-x86_64 1.0.2 3.41 130.84 134.25 OK
r-release-linux-x86_64 1.0.2 3.04 130.90 133.94 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 302.00 306.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 5.00 352.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' [9s] 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' [3s] 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-13 r88141 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.16.3 > options(future.debug = FALSE) > > message("*** cluster() ...") *** cluster() ... > > message("Library paths: ", paste(sQuote(.libPaths()), collapse = ", ")) Library paths: 'D:/temp/2025_04_15_01_50_00_1004/RtmpsvquUb/RLIBS_a40835a94cab', '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' ... [16:51:32.536] doFuture2() ... [16:51:32.597] Number of chunks: 1 [16:51:32.598] Number of futures (= number of chunks): 1 [16:51:32.598] seed = FALSE [16:51:32.598] NULL [16:51:32.601] seed = FALSE [16:51:32.602] seed = FALSE [16:51:32.602] - %dofuture% R expression: [16:51:32.602] ii [16:51:32.603] - foreach iterator arguments: [1] 'ii' [16:51:32.603] - dummy globals (as locals): [1] 'ii' [16:51:32.603] - R expression (map-reduce expression adjusted for RNG): [16:51:32.604] { [16:51:32.604] NULL [16:51:32.604] "# doFuture():::doFuture2(): process chunk of elements" [16:51:32.604] lapply(seq_along(...future.x_ii), FUN = function(jj) { [16:51:32.604] ...future.x_jj <- ...future.x_ii[[jj]] [16:51:32.604] { [16:51:32.604] NULL [16:51:32.604] ii <- NULL [16:51:32.604] } [16:51:32.604] ...future.env <- environment() [16:51:32.604] local({ [16:51:32.604] for (name in names(...future.x_jj)) { [16:51:32.604] assign(name, ...future.x_jj[[name]], envir = ...future.env, [16:51:32.604] inherits = FALSE) [16:51:32.604] } [16:51:32.604] }) [16:51:32.604] NULL [16:51:32.604] tryCatch(ii, error = identity) [16:51:32.604] }) [16:51:32.604] } [16:51:32.604] - identifying globals and packages ... [16:51:32.605] - Argument 'globals': [16:51:32.605] logi TRUE [16:51:32.605] - attr(*, "add")= chr "...future.x_ii" [16:51:32.605] - attr(*, "ignore")= chr "ii" [16:51:32.608] - R expression (map-reduce expression searched for globals): [16:51:32.608] { [16:51:32.608] NULL [16:51:32.608] "# doFuture():::doFuture2(): process chunk of elements" [16:51:32.608] lapply(seq_along(...future.x_ii), FUN = function(jj) { [16:51:32.608] ...future.x_jj <- ...future.x_ii[[jj]] [16:51:32.608] { [16:51:32.608] NULL [16:51:32.608] ii <- NULL [16:51:32.608] } [16:51:32.608] ...future.env <- environment() [16:51:32.608] local({ [16:51:32.608] for (name in names(...future.x_jj)) { [16:51:32.608] assign(name, ...future.x_jj[[name]], envir = ...future.env, [16:51:32.608] inherits = FALSE) [16:51:32.608] } [16:51:32.608] }) [16:51:32.608] NULL [16:51:32.608] tryCatch(ii, error = identity) [16:51:32.608] }) [16:51:32.608] } [16:51:32.628] - R expression (%dofuture% expression searched for globals): [16:51:32.628] ii [16:51:32.630] - Globals in %dofuture% R expression not in map-reduce expression: [16:51:32.631] - Appending 0 globals only found in the vanilla %dofuture% expression: [16:51:32.631] - globals: [1] '...future.x_ii' [16:51:32.631] List of 1 [16:51:32.631] $ ...future.x_ii: num 42 [16:51:32.631] - attr(*, "where")=List of 1 [16:51:32.631] ..$ ...future.x_ii:<environment: R_EmptyEnv> [16:51:32.631] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [16:51:32.631] - attr(*, "resolved")= logi FALSE [16:51:32.631] - attr(*, "total_size")= num 39 [16:51:32.636] - packages: [1] 'doFuture' [16:51:32.636] - identifying globals and packages ... DONE [16:51:32.636] Launching 1 futures (chunks) ... [16:51:32.636] Chunk #1 of 1 ... [16:51:32.637] - Finding globals in 'args_list' for chunk #1 ... [16:51:32.637] [16:51:32.638] [16:51:32.638] - Finding globals in 'args_list' for chunk #1 ... DONE [16:51:32.638] - seeds: <none> [16:51:32.644] Chunk #1 of 1 ... DONE [16:51:32.644] Launching 1 futures (chunks) ... DONE [16:51:32.644] - resolving futures [16:51:32.645] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture2-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: f921a5a77a6c79f3fe1b4472c31af23d-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: f921a5a77a6c79f3fe1b4472c31af23d 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-13 r88141 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.16.3 > options(future.debug = FALSE) > > message("*** cluster() ...") *** cluster() ... > > registerDoFuture() > > message("Library paths: ", paste(sQuote(.libPaths()), collapse = ", ")) Library paths: 'D:/temp/2025_04_15_01_50_00_1004/RtmpsvquUb/RLIBS_a40835a94cab', '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' ... [16:53:27.595] doFuture() ... [16:53:27.598] - dummy globals (as locals): [1] 'ii' [16:53:27.599] - R expression: [16:53:27.599] { [16:53:27.599] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [16:53:27.599] "# also in nested calls " [16:53:27.599] doFuture::registerDoFuture() [16:53:27.599] "# doFuture():::doFuture(): process chunk of elements" [16:53:27.599] lapply(seq_along(...future.x_ii), FUN = function(jj) { [16:53:27.599] ...future.x_jj <- ...future.x_ii[[jj]] [16:53:27.599] { [16:53:27.599] NULL [16:53:27.599] ii <- NULL [16:53:27.599] } [16:53:27.599] ...future.env <- environment() [16:53:27.599] local({ [16:53:27.599] for (name in names(...future.x_jj)) { [16:53:27.599] assign(name, ...future.x_jj[[name]], envir = ...future.env, [16:53:27.599] inherits = FALSE) [16:53:27.599] } [16:53:27.599] }) [16:53:27.599] tryCatch(ii, error = identity) [16:53:27.599] }) [16:53:27.599] } [16:53:27.600] - identifying globals and packages ... [16:53:27.629] List of 1 [16:53:27.629] $ ...future.x_ii: NULL [16:53:27.629] - attr(*, "where")=List of 1 [16:53:27.629] ..$ ...future.x_ii:<environment: R_EmptyEnv> [16:53:27.629] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [16:53:27.629] - attr(*, "resolved")= logi FALSE [16:53:27.629] - attr(*, "total_size")= num 27 [16:53:27.638] - R expression: [16:53:27.638] { [16:53:27.638] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [16:53:27.638] "# also in nested calls " [16:53:27.638] doFuture::registerDoFuture() [16:53:27.638] "# doFuture():::doFuture(): process chunk of elements" [16:53:27.638] lapply(seq_along(...future.x_ii), FUN = function(jj) { [16:53:27.638] ...future.x_jj <- ...future.x_ii[[jj]] [16:53:27.638] { [16:53:27.638] NULL [16:53:27.638] ii <- NULL [16:53:27.638] } [16:53:27.638] ...future.env <- environment() [16:53:27.638] local({ [16:53:27.638] for (name in names(...future.x_jj)) { [16:53:27.638] assign(name, ...future.x_jj[[name]], envir = ...future.env, [16:53:27.638] inherits = FALSE) [16:53:27.638] } [16:53:27.638] }) [16:53:27.638] tryCatch(ii, error = identity) [16:53:27.638] }) [16:53:27.638] } [16:53:27.639] - globals: [1] '...future.x_ii' [16:53:27.639] List of 1 [16:53:27.639] $ ...future.x_ii: NULL [16:53:27.639] - attr(*, "where")=List of 1 [16:53:27.639] ..$ ...future.x_ii:<environment: R_EmptyEnv> [16:53:27.639] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [16:53:27.639] - attr(*, "resolved")= logi FALSE [16:53:27.639] - attr(*, "total_size")= num 27 [16:53:27.644] - packages: [1] 'doFuture' [16:53:27.645] - identifying globals and packages ... DONE [16:53:27.698] Number of chunks: 1 [16:53:27.698] Number of futures (= number of chunks): 1 [16:53:27.699] Launching 1 futures (chunks) ... [16:53:27.699] Chunk #1 of 1 ... [16:53:27.699] - Finding globals in 'args_list' chunk #1 ... [16:53:27.700] [16:53:27.701] [16:53:27.701] - Finding globals in 'args_list' for chunk #1 ... DONE [16:53:27.709] Chunk #1 of 1 ... DONE [16:53:27.710] Launching 1 futures (chunks) ... DONE [16:53:27.710] - resolving futures [16:53:27.710] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: 9079a098653a3c5f404fc51ebe32cf99-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: 9079a098653a3c5f404fc51ebe32cf99 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' [9s] Running 'foreach_dofuture,globals.R' [7s] Running 'foreach_dofuture,nested_colon.R' [13s] 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' [7s] Running 'foreach_dopar,globals.R' [7s] Running 'foreach_dopar,nested_colon.R' [12s] Running 'foreach_dopar,nested_dopar.R' [15s] Running 'foreach_dopar,options-for-export.R' [5s] Running 'foreach_dopar.R' [3s] Running 'makeChunks.R' [4s] Running 'options,nested.R' [3s] Running 'registerDoFuture.R' [2s] Running 'times.R' [2s] Running 'utils.R' [1s] Running 'withDoRNG.R' [3s] 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.16.3 > options(future.debug = FALSE) > > message("*** cluster() ...") *** cluster() ... > > message("Library paths: ", paste(sQuote(.libPaths()), collapse = ", ")) Library paths: 'D:/temp/2025_04_14_01_50_00_13770/RtmpSaTnCP/RLIBS_d1848006cc8', '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' ... [07:34:04.902] doFuture2() ... [07:34:04.973] Number of chunks: 1 [07:34:04.973] Number of futures (= number of chunks): 1 [07:34:04.974] seed = FALSE [07:34:04.974] NULL [07:34:04.978] seed = FALSE [07:34:04.978] seed = FALSE [07:34:04.978] - %dofuture% R expression: [07:34:04.978] ii [07:34:04.979] - foreach iterator arguments: [1] 'ii' [07:34:04.979] - dummy globals (as locals): [1] 'ii' [07:34:04.980] - R expression (map-reduce expression adjusted for RNG): [07:34:04.980] { [07:34:04.980] NULL [07:34:04.980] "# doFuture():::doFuture2(): process chunk of elements" [07:34:04.980] lapply(seq_along(...future.x_ii), FUN = function(jj) { [07:34:04.980] ...future.x_jj <- ...future.x_ii[[jj]] [07:34:04.980] { [07:34:04.980] NULL [07:34:04.980] ii <- NULL [07:34:04.980] } [07:34:04.980] ...future.env <- environment() [07:34:04.980] local({ [07:34:04.980] for (name in names(...future.x_jj)) { [07:34:04.980] assign(name, ...future.x_jj[[name]], envir = ...future.env, [07:34:04.980] inherits = FALSE) [07:34:04.980] } [07:34:04.980] }) [07:34:04.980] NULL [07:34:04.980] tryCatch(ii, error = identity) [07:34:04.980] }) [07:34:04.980] } [07:34:04.981] - identifying globals and packages ... [07:34:04.981] - Argument 'globals': [07:34:04.981] logi TRUE [07:34:04.981] - attr(*, "add")= chr "...future.x_ii" [07:34:04.981] - attr(*, "ignore")= chr "ii" [07:34:04.984] - R expression (map-reduce expression searched for globals): [07:34:04.984] { [07:34:04.984] NULL [07:34:04.984] "# doFuture():::doFuture2(): process chunk of elements" [07:34:04.984] lapply(seq_along(...future.x_ii), FUN = function(jj) { [07:34:04.984] ...future.x_jj <- ...future.x_ii[[jj]] [07:34:04.984] { [07:34:04.984] NULL [07:34:04.984] ii <- NULL [07:34:04.984] } [07:34:04.984] ...future.env <- environment() [07:34:04.984] local({ [07:34:04.984] for (name in names(...future.x_jj)) { [07:34:04.984] assign(name, ...future.x_jj[[name]], envir = ...future.env, [07:34:04.984] inherits = FALSE) [07:34:04.984] } [07:34:04.984] }) [07:34:04.984] NULL [07:34:04.984] tryCatch(ii, error = identity) [07:34:04.984] }) [07:34:04.984] } [07:34:05.005] - R expression (%dofuture% expression searched for globals): [07:34:05.005] ii [07:34:05.007] - Globals in %dofuture% R expression not in map-reduce expression: [07:34:05.008] - Appending 0 globals only found in the vanilla %dofuture% expression: [07:34:05.008] - globals: [1] '...future.x_ii' [07:34:05.008] List of 1 [07:34:05.008] $ ...future.x_ii: num 42 [07:34:05.008] - attr(*, "where")=List of 1 [07:34:05.008] ..$ ...future.x_ii:<environment: R_EmptyEnv> [07:34:05.008] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [07:34:05.008] - attr(*, "resolved")= logi FALSE [07:34:05.008] - attr(*, "total_size")= num 39 [07:34:05.013] - packages: [1] 'doFuture' [07:34:05.013] - identifying globals and packages ... DONE [07:34:05.013] Launching 1 futures (chunks) ... [07:34:05.013] Chunk #1 of 1 ... [07:34:05.014] - Finding globals in 'args_list' for chunk #1 ... [07:34:05.015] [07:34:05.015] [07:34:05.015] - Finding globals in 'args_list' for chunk #1 ... DONE [07:34:05.016] - seeds: <none> [07:34:05.023] Chunk #1 of 1 ... DONE [07:34:05.024] Launching 1 futures (chunks) ... DONE [07:34:05.024] - resolving futures [07:34:05.024] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture2-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: b135dccf53522c9c0e67adbe02157800-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: b135dccf53522c9c0e67adbe02157800 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.16.3 > options(future.debug = FALSE) > > message("*** cluster() ...") *** cluster() ... > > registerDoFuture() > > message("Library paths: ", paste(sQuote(.libPaths()), collapse = ", ")) Library paths: 'D:/temp/2025_04_14_01_50_00_13770/RtmpSaTnCP/RLIBS_d1848006cc8', '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' ... [07:35:59.016] doFuture() ... [07:35:59.019] - dummy globals (as locals): [1] 'ii' [07:35:59.019] - R expression: [07:35:59.020] { [07:35:59.020] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [07:35:59.020] "# also in nested calls " [07:35:59.020] doFuture::registerDoFuture() [07:35:59.020] "# doFuture():::doFuture(): process chunk of elements" [07:35:59.020] lapply(seq_along(...future.x_ii), FUN = function(jj) { [07:35:59.020] ...future.x_jj <- ...future.x_ii[[jj]] [07:35:59.020] { [07:35:59.020] NULL [07:35:59.020] ii <- NULL [07:35:59.020] } [07:35:59.020] ...future.env <- environment() [07:35:59.020] local({ [07:35:59.020] for (name in names(...future.x_jj)) { [07:35:59.020] assign(name, ...future.x_jj[[name]], envir = ...future.env, [07:35:59.020] inherits = FALSE) [07:35:59.020] } [07:35:59.020] }) [07:35:59.020] tryCatch(ii, error = identity) [07:35:59.020] }) [07:35:59.020] } [07:35:59.021] - identifying globals and packages ... [07:35:59.040] List of 1 [07:35:59.040] $ ...future.x_ii: NULL [07:35:59.040] - attr(*, "where")=List of 1 [07:35:59.040] ..$ ...future.x_ii:<environment: R_EmptyEnv> [07:35:59.040] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [07:35:59.040] - attr(*, "resolved")= logi FALSE [07:35:59.040] - attr(*, "total_size")= num 27 [07:35:59.050] - R expression: [07:35:59.050] { [07:35:59.050] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [07:35:59.050] "# also in nested calls " [07:35:59.050] doFuture::registerDoFuture() [07:35:59.050] "# doFuture():::doFuture(): process chunk of elements" [07:35:59.050] lapply(seq_along(...future.x_ii), FUN = function(jj) { [07:35:59.050] ...future.x_jj <- ...future.x_ii[[jj]] [07:35:59.050] { [07:35:59.050] NULL [07:35:59.050] ii <- NULL [07:35:59.050] } [07:35:59.050] ...future.env <- environment() [07:35:59.050] local({ [07:35:59.050] for (name in names(...future.x_jj)) { [07:35:59.050] assign(name, ...future.x_jj[[name]], envir = ...future.env, [07:35:59.050] inherits = FALSE) [07:35:59.050] } [07:35:59.050] }) [07:35:59.050] tryCatch(ii, error = identity) [07:35:59.050] }) [07:35:59.050] } [07:35:59.051] - globals: [1] '...future.x_ii' [07:35:59.051] List of 1 [07:35:59.051] $ ...future.x_ii: NULL [07:35:59.051] - attr(*, "where")=List of 1 [07:35:59.051] ..$ ...future.x_ii:<environment: R_EmptyEnv> [07:35:59.051] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [07:35:59.051] - attr(*, "resolved")= logi FALSE [07:35:59.051] - attr(*, "total_size")= num 27 [07:35:59.055] - packages: [1] 'doFuture' [07:35:59.056] - identifying globals and packages ... DONE [07:35:59.106] Number of chunks: 1 [07:35:59.107] Number of futures (= number of chunks): 1 [07:35:59.107] Launching 1 futures (chunks) ... [07:35:59.107] Chunk #1 of 1 ... [07:35:59.108] - Finding globals in 'args_list' chunk #1 ... [07:35:59.109] [07:35:59.109] [07:35:59.109] - Finding globals in 'args_list' for chunk #1 ... DONE [07:35:59.116] Chunk #1 of 1 ... DONE [07:35:59.117] Launching 1 futures (chunks) ... DONE [07:35:59.117] - resolving futures [07:35:59.117] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: 6a5727f0ebc703db365a0bb563ccb81d-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: 6a5727f0ebc703db365a0bb563ccb81d 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' [19s] Running 'foreach_dofuture,nested_dofuture.R' [20s] Running 'foreach_dofuture,rng.R' [6s] 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' [10s] 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' [5s] Running 'options,nested.R' [5s] 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.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.16.3 > options(future.debug = FALSE) > > message("*** cluster() ...") *** cluster() ... > > message("Library paths: ", paste(sQuote(.libPaths()), collapse = ", ")) Library paths: 'D:/temp/2025_04_14_01_50_00_13770/RtmpIdS59e/RLIBS_2f7d439d546a5', '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' ... [20:42:53.520] doFuture2() ... [20:42:53.601] Number of chunks: 1 [20:42:53.602] Number of futures (= number of chunks): 1 [20:42:53.602] seed = FALSE [20:42:53.603] NULL [20:42:53.605] seed = FALSE [20:42:53.606] seed = FALSE [20:42:53.606] - %dofuture% R expression: [20:42:53.606] ii [20:42:53.607] - foreach iterator arguments: [1] 'ii' [20:42:53.607] - dummy globals (as locals): [1] 'ii' [20:42:53.608] - R expression (map-reduce expression adjusted for RNG): [20:42:53.608] { [20:42:53.608] NULL [20:42:53.608] "# doFuture():::doFuture2(): process chunk of elements" [20:42:53.608] lapply(seq_along(...future.x_ii), FUN = function(jj) { [20:42:53.608] ...future.x_jj <- ...future.x_ii[[jj]] [20:42:53.608] { [20:42:53.608] NULL [20:42:53.608] ii <- NULL [20:42:53.608] } [20:42:53.608] ...future.env <- environment() [20:42:53.608] local({ [20:42:53.608] for (name in names(...future.x_jj)) { [20:42:53.608] assign(name, ...future.x_jj[[name]], envir = ...future.env, [20:42:53.608] inherits = FALSE) [20:42:53.608] } [20:42:53.608] }) [20:42:53.608] NULL [20:42:53.608] tryCatch(ii, error = identity) [20:42:53.608] }) [20:42:53.608] } [20:42:53.609] - identifying globals and packages ... [20:42:53.609] - Argument 'globals': [20:42:53.609] logi TRUE [20:42:53.609] - attr(*, "add")= chr "...future.x_ii" [20:42:53.609] - attr(*, "ignore")= chr "ii" [20:42:53.612] - R expression (map-reduce expression searched for globals): [20:42:53.612] { [20:42:53.612] NULL [20:42:53.612] "# doFuture():::doFuture2(): process chunk of elements" [20:42:53.612] lapply(seq_along(...future.x_ii), FUN = function(jj) { [20:42:53.612] ...future.x_jj <- ...future.x_ii[[jj]] [20:42:53.612] { [20:42:53.612] NULL [20:42:53.612] ii <- NULL [20:42:53.612] } [20:42:53.612] ...future.env <- environment() [20:42:53.612] local({ [20:42:53.612] for (name in names(...future.x_jj)) { [20:42:53.612] assign(name, ...future.x_jj[[name]], envir = ...future.env, [20:42:53.612] inherits = FALSE) [20:42:53.612] } [20:42:53.612] }) [20:42:53.612] NULL [20:42:53.612] tryCatch(ii, error = identity) [20:42:53.612] }) [20:42:53.612] } [20:42:53.631] - R expression (%dofuture% expression searched for globals): [20:42:53.631] ii [20:42:53.633] - Globals in %dofuture% R expression not in map-reduce expression: [20:42:53.633] - Appending 0 globals only found in the vanilla %dofuture% expression: [20:42:53.633] - globals: [1] '...future.x_ii' [20:42:53.634] List of 1 [20:42:53.634] $ ...future.x_ii: num 42 [20:42:53.634] - attr(*, "where")=List of 1 [20:42:53.634] ..$ ...future.x_ii:<environment: R_EmptyEnv> [20:42:53.634] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [20:42:53.634] - attr(*, "resolved")= logi FALSE [20:42:53.634] - attr(*, "total_size")= num 39 [20:42:53.638] - packages: [1] 'doFuture' [20:42:53.638] - identifying globals and packages ... DONE [20:42:53.638] Launching 1 futures (chunks) ... [20:42:53.639] Chunk #1 of 1 ... [20:42:53.639] - Finding globals in 'args_list' for chunk #1 ... [20:42:53.640] [20:42:53.640] [20:42:53.641] - Finding globals in 'args_list' for chunk #1 ... DONE [20:42:53.641] - seeds: <none> [20:42:53.649] Chunk #1 of 1 ... DONE [20:42:53.649] Launching 1 futures (chunks) ... DONE [20:42:53.650] - resolving futures [20:42:53.650] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture2-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: 57681bbe04ebd3e8aafb9853e3303803-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: 57681bbe04ebd3e8aafb9853e3303803 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.16.3 > options(future.debug = FALSE) > > message("*** cluster() ...") *** cluster() ... > > registerDoFuture() > > message("Library paths: ", paste(sQuote(.libPaths()), collapse = ", ")) Library paths: 'D:/temp/2025_04_14_01_50_00_13770/RtmpIdS59e/RLIBS_2f7d439d546a5', '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' ... [20:45:06.902] doFuture() ... [20:45:06.906] - dummy globals (as locals): [1] 'ii' [20:45:06.907] - R expression: [20:45:06.908] { [20:45:06.908] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [20:45:06.908] "# also in nested calls " [20:45:06.908] doFuture::registerDoFuture() [20:45:06.908] "# doFuture():::doFuture(): process chunk of elements" [20:45:06.908] lapply(seq_along(...future.x_ii), FUN = function(jj) { [20:45:06.908] ...future.x_jj <- ...future.x_ii[[jj]] [20:45:06.908] { [20:45:06.908] NULL [20:45:06.908] ii <- NULL [20:45:06.908] } [20:45:06.908] ...future.env <- environment() [20:45:06.908] local({ [20:45:06.908] for (name in names(...future.x_jj)) { [20:45:06.908] assign(name, ...future.x_jj[[name]], envir = ...future.env, [20:45:06.908] inherits = FALSE) [20:45:06.908] } [20:45:06.908] }) [20:45:06.908] tryCatch(ii, error = identity) [20:45:06.908] }) [20:45:06.908] } [20:45:06.909] - identifying globals and packages ... [20:45:06.952] List of 1 [20:45:06.952] $ ...future.x_ii: NULL [20:45:06.952] - attr(*, "where")=List of 1 [20:45:06.952] ..$ ...future.x_ii:<environment: R_EmptyEnv> [20:45:06.952] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [20:45:06.952] - attr(*, "resolved")= logi FALSE [20:45:06.952] - attr(*, "total_size")= num 27 [20:45:06.966] - R expression: [20:45:06.966] { [20:45:06.966] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [20:45:06.966] "# also in nested calls " [20:45:06.966] doFuture::registerDoFuture() [20:45:06.966] "# doFuture():::doFuture(): process chunk of elements" [20:45:06.966] lapply(seq_along(...future.x_ii), FUN = function(jj) { [20:45:06.966] ...future.x_jj <- ...future.x_ii[[jj]] [20:45:06.966] { [20:45:06.966] NULL [20:45:06.966] ii <- NULL [20:45:06.966] } [20:45:06.966] ...future.env <- environment() [20:45:06.966] local({ [20:45:06.966] for (name in names(...future.x_jj)) { [20:45:06.966] assign(name, ...future.x_jj[[name]], envir = ...future.env, [20:45:06.966] inherits = FALSE) [20:45:06.966] } [20:45:06.966] }) [20:45:06.966] tryCatch(ii, error = identity) [20:45:06.966] }) [20:45:06.966] } [20:45:06.967] - globals: [1] '...future.x_ii' [20:45:06.968] List of 1 [20:45:06.968] $ ...future.x_ii: NULL [20:45:06.968] - attr(*, "where")=List of 1 [20:45:06.968] ..$ ...future.x_ii:<environment: R_EmptyEnv> [20:45:06.968] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [20:45:06.968] - attr(*, "resolved")= logi FALSE [20:45:06.968] - attr(*, "total_size")= num 27 [20:45:06.976] - packages: [1] 'doFuture' [20:45:06.976] - identifying globals and packages ... DONE [20:45:07.060] Number of chunks: 1 [20:45:07.061] Number of futures (= number of chunks): 1 [20:45:07.061] Launching 1 futures (chunks) ... [20:45:07.061] Chunk #1 of 1 ... [20:45:07.062] - Finding globals in 'args_list' chunk #1 ... [20:45:07.063] [20:45:07.063] [20:45:07.064] - Finding globals in 'args_list' for chunk #1 ... DONE [20:45:07.074] Chunk #1 of 1 ... DONE [20:45:07.075] Launching 1 futures (chunks) ... DONE [20:45:07.075] - resolving futures [20:45:07.076] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: 5caf9623c9bee83ab289b80628c41bb2-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: 5caf9623c9bee83ab289b80628c41bb2 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