CRAN Package Check Results for Package doFuture

Last updated on 2025-04-25 03:50:56 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.44 101.42 103.86 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 313.00 318.00 ERROR
r-patched-linux-x86_64 1.0.2 3.61 131.41 135.02 OK
r-release-linux-x86_64 1.0.2 2.64 131.01 133.65 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 340.00 344.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 353.00 358.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' [3s] Running 'foreach_dopar,doRNG,dorng.R' [6s] 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' [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-21 r88169 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_22_01_50_00_9946/RtmpaWOelG/RLIBS_2d7106299139e', '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' ... [17:07:59.236] doFuture2() ... [17:07:59.295] Number of chunks: 1 [17:07:59.295] Number of futures (= number of chunks): 1 [17:07:59.295] seed = FALSE [17:07:59.296] NULL [17:07:59.298] seed = FALSE [17:07:59.298] seed = FALSE [17:07:59.298] - %dofuture% R expression: [17:07:59.299] ii [17:07:59.299] - foreach iterator arguments: [1] 'ii' [17:07:59.299] - dummy globals (as locals): [1] 'ii' [17:07:59.300] - R expression (map-reduce expression adjusted for RNG): [17:07:59.300] { [17:07:59.300] NULL [17:07:59.300] "# doFuture():::doFuture2(): process chunk of elements" [17:07:59.300] lapply(seq_along(...future.x_ii), FUN = function(jj) { [17:07:59.300] ...future.x_jj <- ...future.x_ii[[jj]] [17:07:59.300] { [17:07:59.300] NULL [17:07:59.300] ii <- NULL [17:07:59.300] } [17:07:59.300] ...future.env <- environment() [17:07:59.300] local({ [17:07:59.300] for (name in names(...future.x_jj)) { [17:07:59.300] assign(name, ...future.x_jj[[name]], envir = ...future.env, [17:07:59.300] inherits = FALSE) [17:07:59.300] } [17:07:59.300] }) [17:07:59.300] NULL [17:07:59.300] tryCatch(ii, error = identity) [17:07:59.300] }) [17:07:59.300] } [17:07:59.300] - identifying globals and packages ... [17:07:59.300] - Argument 'globals': [17:07:59.301] logi TRUE [17:07:59.301] - attr(*, "add")= chr "...future.x_ii" [17:07:59.301] - attr(*, "ignore")= chr "ii" [17:07:59.303] - R expression (map-reduce expression searched for globals): [17:07:59.304] { [17:07:59.304] NULL [17:07:59.304] "# doFuture():::doFuture2(): process chunk of elements" [17:07:59.304] lapply(seq_along(...future.x_ii), FUN = function(jj) { [17:07:59.304] ...future.x_jj <- ...future.x_ii[[jj]] [17:07:59.304] { [17:07:59.304] NULL [17:07:59.304] ii <- NULL [17:07:59.304] } [17:07:59.304] ...future.env <- environment() [17:07:59.304] local({ [17:07:59.304] for (name in names(...future.x_jj)) { [17:07:59.304] assign(name, ...future.x_jj[[name]], envir = ...future.env, [17:07:59.304] inherits = FALSE) [17:07:59.304] } [17:07:59.304] }) [17:07:59.304] NULL [17:07:59.304] tryCatch(ii, error = identity) [17:07:59.304] }) [17:07:59.304] } [17:07:59.319] - R expression (%dofuture% expression searched for globals): [17:07:59.319] ii [17:07:59.321] - Globals in %dofuture% R expression not in map-reduce expression: [17:07:59.321] - Appending 0 globals only found in the vanilla %dofuture% expression: [17:07:59.322] - globals: [1] '...future.x_ii' [17:07:59.322] List of 1 [17:07:59.322] $ ...future.x_ii: num 42 [17:07:59.322] - attr(*, "where")=List of 1 [17:07:59.322] ..$ ...future.x_ii:<environment: R_EmptyEnv> [17:07:59.322] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [17:07:59.322] - attr(*, "resolved")= logi FALSE [17:07:59.322] - attr(*, "total_size")= num 39 [17:07:59.327] - packages: [1] 'doFuture' [17:07:59.327] - identifying globals and packages ... DONE [17:07:59.327] Launching 1 futures (chunks) ... [17:07:59.327] Chunk #1 of 1 ... [17:07:59.328] - Finding globals in 'args_list' for chunk #1 ... [17:07:59.329] [17:07:59.329] [17:07:59.329] - Finding globals in 'args_list' for chunk #1 ... DONE [17:07:59.330] - seeds: <none> [17:07:59.337] Chunk #1 of 1 ... DONE [17:07:59.337] Launching 1 futures (chunks) ... DONE [17:07:59.338] - resolving futures [17:07:59.338] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture2-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: 01455be85a2c442c11fa7fe9ede07c73-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: 01455be85a2c442c11fa7fe9ede07c73 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-21 r88169 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_22_01_50_00_9946/RtmpaWOelG/RLIBS_2d7106299139e', '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' ... [17:09:55.626] doFuture() ... [17:09:55.628] - dummy globals (as locals): [1] 'ii' [17:09:55.629] - R expression: [17:09:55.629] { [17:09:55.629] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [17:09:55.629] "# also in nested calls " [17:09:55.629] doFuture::registerDoFuture() [17:09:55.629] "# doFuture():::doFuture(): process chunk of elements" [17:09:55.629] lapply(seq_along(...future.x_ii), FUN = function(jj) { [17:09:55.629] ...future.x_jj <- ...future.x_ii[[jj]] [17:09:55.629] { [17:09:55.629] NULL [17:09:55.629] ii <- NULL [17:09:55.629] } [17:09:55.629] ...future.env <- environment() [17:09:55.629] local({ [17:09:55.629] for (name in names(...future.x_jj)) { [17:09:55.629] assign(name, ...future.x_jj[[name]], envir = ...future.env, [17:09:55.629] inherits = FALSE) [17:09:55.629] } [17:09:55.629] }) [17:09:55.629] tryCatch(ii, error = identity) [17:09:55.629] }) [17:09:55.629] } [17:09:55.630] - identifying globals and packages ... [17:09:55.647] List of 1 [17:09:55.647] $ ...future.x_ii: NULL [17:09:55.647] - attr(*, "where")=List of 1 [17:09:55.647] ..$ ...future.x_ii:<environment: R_EmptyEnv> [17:09:55.647] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [17:09:55.647] - attr(*, "resolved")= logi FALSE [17:09:55.647] - attr(*, "total_size")= num 27 [17:09:55.655] - R expression: [17:09:55.656] { [17:09:55.656] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [17:09:55.656] "# also in nested calls " [17:09:55.656] doFuture::registerDoFuture() [17:09:55.656] "# doFuture():::doFuture(): process chunk of elements" [17:09:55.656] lapply(seq_along(...future.x_ii), FUN = function(jj) { [17:09:55.656] ...future.x_jj <- ...future.x_ii[[jj]] [17:09:55.656] { [17:09:55.656] NULL [17:09:55.656] ii <- NULL [17:09:55.656] } [17:09:55.656] ...future.env <- environment() [17:09:55.656] local({ [17:09:55.656] for (name in names(...future.x_jj)) { [17:09:55.656] assign(name, ...future.x_jj[[name]], envir = ...future.env, [17:09:55.656] inherits = FALSE) [17:09:55.656] } [17:09:55.656] }) [17:09:55.656] tryCatch(ii, error = identity) [17:09:55.656] }) [17:09:55.656] } [17:09:55.656] - globals: [1] '...future.x_ii' [17:09:55.657] List of 1 [17:09:55.657] $ ...future.x_ii: NULL [17:09:55.657] - attr(*, "where")=List of 1 [17:09:55.657] ..$ ...future.x_ii:<environment: R_EmptyEnv> [17:09:55.657] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [17:09:55.657] - attr(*, "resolved")= logi FALSE [17:09:55.657] - attr(*, "total_size")= num 27 [17:09:55.661] - packages: [1] 'doFuture' [17:09:55.662] - identifying globals and packages ... DONE [17:09:55.719] Number of chunks: 1 [17:09:55.720] Number of futures (= number of chunks): 1 [17:09:55.720] Launching 1 futures (chunks) ... [17:09:55.720] Chunk #1 of 1 ... [17:09:55.721] - Finding globals in 'args_list' chunk #1 ... [17:09:55.722] [17:09:55.722] [17:09:55.722] - Finding globals in 'args_list' for chunk #1 ... DONE [17:09:55.728] Chunk #1 of 1 ... DONE [17:09:55.728] Launching 1 futures (chunks) ... DONE [17:09:55.729] - resolving futures [17:09:55.729] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: 5d997bbde012798e283f7b2351cb7707-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: 5d997bbde012798e283f7b2351cb7707 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' [63s] Running 'foreach_dofuture,errors.R' [12s] Running 'foreach_dofuture,globals.R' [9s] Running 'foreach_dofuture,nested_colon.R' [16s] Running 'foreach_dofuture,nested_dofuture.R' [18s] Running 'foreach_dofuture,rng.R' [5s] Running 'foreach_dofuture.R' [4s] Running 'foreach_dopar,cluster-missing-doFuture-pkg.R' [62s] Running 'foreach_dopar,doRNG,dopar.R' [3s] Running 'foreach_dopar,doRNG,dorng.R' [6s] Running 'foreach_dopar,errors.R' [8s] Running 'foreach_dopar,globals.R' [8s] Running 'foreach_dopar,nested_colon.R' [14s] Running 'foreach_dopar,nested_dopar.R' [18s] 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' [3s] Running 'times.R' [3s] 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.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_23_01_50_01_29948/RtmpkB04HZ/RLIBS_1bf543ab21844', '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' ... [16:53:46.990] doFuture2() ... [16:53:47.061] Number of chunks: 1 [16:53:47.061] Number of futures (= number of chunks): 1 [16:53:47.062] seed = FALSE [16:53:47.062] NULL [16:53:47.066] seed = FALSE [16:53:47.066] seed = FALSE [16:53:47.066] - %dofuture% R expression: [16:53:47.067] ii [16:53:47.067] - foreach iterator arguments: [1] 'ii' [16:53:47.067] - dummy globals (as locals): [1] 'ii' [16:53:47.068] - R expression (map-reduce expression adjusted for RNG): [16:53:47.068] { [16:53:47.068] NULL [16:53:47.068] "# doFuture():::doFuture2(): process chunk of elements" [16:53:47.068] lapply(seq_along(...future.x_ii), FUN = function(jj) { [16:53:47.068] ...future.x_jj <- ...future.x_ii[[jj]] [16:53:47.068] { [16:53:47.068] NULL [16:53:47.068] ii <- NULL [16:53:47.068] } [16:53:47.068] ...future.env <- environment() [16:53:47.068] local({ [16:53:47.068] for (name in names(...future.x_jj)) { [16:53:47.068] assign(name, ...future.x_jj[[name]], envir = ...future.env, [16:53:47.068] inherits = FALSE) [16:53:47.068] } [16:53:47.068] }) [16:53:47.068] NULL [16:53:47.068] tryCatch(ii, error = identity) [16:53:47.068] }) [16:53:47.068] } [16:53:47.069] - identifying globals and packages ... [16:53:47.069] - Argument 'globals': [16:53:47.069] logi TRUE [16:53:47.069] - attr(*, "add")= chr "...future.x_ii" [16:53:47.069] - attr(*, "ignore")= chr "ii" [16:53:47.073] - R expression (map-reduce expression searched for globals): [16:53:47.073] { [16:53:47.073] NULL [16:53:47.073] "# doFuture():::doFuture2(): process chunk of elements" [16:53:47.073] lapply(seq_along(...future.x_ii), FUN = function(jj) { [16:53:47.073] ...future.x_jj <- ...future.x_ii[[jj]] [16:53:47.073] { [16:53:47.073] NULL [16:53:47.073] ii <- NULL [16:53:47.073] } [16:53:47.073] ...future.env <- environment() [16:53:47.073] local({ [16:53:47.073] for (name in names(...future.x_jj)) { [16:53:47.073] assign(name, ...future.x_jj[[name]], envir = ...future.env, [16:53:47.073] inherits = FALSE) [16:53:47.073] } [16:53:47.073] }) [16:53:47.073] NULL [16:53:47.073] tryCatch(ii, error = identity) [16:53:47.073] }) [16:53:47.073] } [16:53:47.088] - R expression (%dofuture% expression searched for globals): [16:53:47.089] ii [16:53:47.090] - Globals in %dofuture% R expression not in map-reduce expression: [16:53:47.091] - Appending 0 globals only found in the vanilla %dofuture% expression: [16:53:47.091] - globals: [1] '...future.x_ii' [16:53:47.091] List of 1 [16:53:47.091] $ ...future.x_ii: num 42 [16:53:47.091] - attr(*, "where")=List of 1 [16:53:47.091] ..$ ...future.x_ii:<environment: R_EmptyEnv> [16:53:47.091] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [16:53:47.091] - attr(*, "resolved")= logi FALSE [16:53:47.091] - attr(*, "total_size")= num 39 [16:53:47.096] - packages: [1] 'doFuture' [16:53:47.097] - identifying globals and packages ... DONE [16:53:47.097] Launching 1 futures (chunks) ... [16:53:47.097] Chunk #1 of 1 ... [16:53:47.098] - Finding globals in 'args_list' for chunk #1 ... [16:53:47.098] [16:53:47.099] [16:53:47.099] - Finding globals in 'args_list' for chunk #1 ... DONE [16:53:47.099] - seeds: <none> [16:53:47.108] Chunk #1 of 1 ... DONE [16:53:47.108] Launching 1 futures (chunks) ... DONE [16:53:47.109] - resolving futures [16:53:47.109] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture2-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: 967d3a91df573a1ae68b9722d8b34bd1-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: 967d3a91df573a1ae68b9722d8b34bd1 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_23_01_50_01_29948/RtmpkB04HZ/RLIBS_1bf543ab21844', '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' ... [16:55:52.503] doFuture() ... [16:55:52.506] - dummy globals (as locals): [1] 'ii' [16:55:52.507] - R expression: [16:55:52.507] { [16:55:52.507] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [16:55:52.507] "# also in nested calls " [16:55:52.507] doFuture::registerDoFuture() [16:55:52.507] "# doFuture():::doFuture(): process chunk of elements" [16:55:52.507] lapply(seq_along(...future.x_ii), FUN = function(jj) { [16:55:52.507] ...future.x_jj <- ...future.x_ii[[jj]] [16:55:52.507] { [16:55:52.507] NULL [16:55:52.507] ii <- NULL [16:55:52.507] } [16:55:52.507] ...future.env <- environment() [16:55:52.507] local({ [16:55:52.507] for (name in names(...future.x_jj)) { [16:55:52.507] assign(name, ...future.x_jj[[name]], envir = ...future.env, [16:55:52.507] inherits = FALSE) [16:55:52.507] } [16:55:52.507] }) [16:55:52.507] tryCatch(ii, error = identity) [16:55:52.507] }) [16:55:52.507] } [16:55:52.508] - identifying globals and packages ... [16:55:52.527] List of 1 [16:55:52.527] $ ...future.x_ii: NULL [16:55:52.527] - attr(*, "where")=List of 1 [16:55:52.527] ..$ ...future.x_ii:<environment: R_EmptyEnv> [16:55:52.527] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [16:55:52.527] - attr(*, "resolved")= logi FALSE [16:55:52.527] - attr(*, "total_size")= num 27 [16:55:52.536] - R expression: [16:55:52.536] { [16:55:52.536] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [16:55:52.536] "# also in nested calls " [16:55:52.536] doFuture::registerDoFuture() [16:55:52.536] "# doFuture():::doFuture(): process chunk of elements" [16:55:52.536] lapply(seq_along(...future.x_ii), FUN = function(jj) { [16:55:52.536] ...future.x_jj <- ...future.x_ii[[jj]] [16:55:52.536] { [16:55:52.536] NULL [16:55:52.536] ii <- NULL [16:55:52.536] } [16:55:52.536] ...future.env <- environment() [16:55:52.536] local({ [16:55:52.536] for (name in names(...future.x_jj)) { [16:55:52.536] assign(name, ...future.x_jj[[name]], envir = ...future.env, [16:55:52.536] inherits = FALSE) [16:55:52.536] } [16:55:52.536] }) [16:55:52.536] tryCatch(ii, error = identity) [16:55:52.536] }) [16:55:52.536] } [16:55:52.537] - globals: [1] '...future.x_ii' [16:55:52.537] List of 1 [16:55:52.537] $ ...future.x_ii: NULL [16:55:52.537] - attr(*, "where")=List of 1 [16:55:52.537] ..$ ...future.x_ii:<environment: R_EmptyEnv> [16:55:52.537] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [16:55:52.537] - attr(*, "resolved")= logi FALSE [16:55:52.537] - attr(*, "total_size")= num 27 [16:55:52.542] - packages: [1] 'doFuture' [16:55:52.542] - identifying globals and packages ... DONE [16:55:52.595] Number of chunks: 1 [16:55:52.595] Number of futures (= number of chunks): 1 [16:55:52.595] Launching 1 futures (chunks) ... [16:55:52.596] Chunk #1 of 1 ... [16:55:52.596] - Finding globals in 'args_list' chunk #1 ... [16:55:52.597] [16:55:52.597] [16:55:52.597] - Finding globals in 'args_list' for chunk #1 ... DONE [16:55:52.605] Chunk #1 of 1 ... DONE [16:55:52.605] Launching 1 futures (chunks) ... DONE [16:55:52.605] - resolving futures [16:55:52.605] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: 242b48e82026362e703705623dc7510f-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: 242b48e82026362e703705623dc7510f 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' [20s] 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' [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' [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_23_01_50_00_29948/Rtmpw3HLvJ/RLIBS_2dbb423bd7dce', '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' ... [21:05:08.311] doFuture2() ... [21:05:08.399] Number of chunks: 1 [21:05:08.400] Number of futures (= number of chunks): 1 [21:05:08.400] seed = FALSE [21:05:08.401] NULL [21:05:08.404] seed = FALSE [21:05:08.404] seed = FALSE [21:05:08.404] - %dofuture% R expression: [21:05:08.405] ii [21:05:08.405] - foreach iterator arguments: [1] 'ii' [21:05:08.405] - dummy globals (as locals): [1] 'ii' [21:05:08.406] - R expression (map-reduce expression adjusted for RNG): [21:05:08.406] { [21:05:08.406] NULL [21:05:08.406] "# doFuture():::doFuture2(): process chunk of elements" [21:05:08.406] lapply(seq_along(...future.x_ii), FUN = function(jj) { [21:05:08.406] ...future.x_jj <- ...future.x_ii[[jj]] [21:05:08.406] { [21:05:08.406] NULL [21:05:08.406] ii <- NULL [21:05:08.406] } [21:05:08.406] ...future.env <- environment() [21:05:08.406] local({ [21:05:08.406] for (name in names(...future.x_jj)) { [21:05:08.406] assign(name, ...future.x_jj[[name]], envir = ...future.env, [21:05:08.406] inherits = FALSE) [21:05:08.406] } [21:05:08.406] }) [21:05:08.406] NULL [21:05:08.406] tryCatch(ii, error = identity) [21:05:08.406] }) [21:05:08.406] } [21:05:08.407] - identifying globals and packages ... [21:05:08.407] - Argument 'globals': [21:05:08.407] logi TRUE [21:05:08.407] - attr(*, "add")= chr "...future.x_ii" [21:05:08.407] - attr(*, "ignore")= chr "ii" [21:05:08.411] - R expression (map-reduce expression searched for globals): [21:05:08.411] { [21:05:08.411] NULL [21:05:08.411] "# doFuture():::doFuture2(): process chunk of elements" [21:05:08.411] lapply(seq_along(...future.x_ii), FUN = function(jj) { [21:05:08.411] ...future.x_jj <- ...future.x_ii[[jj]] [21:05:08.411] { [21:05:08.411] NULL [21:05:08.411] ii <- NULL [21:05:08.411] } [21:05:08.411] ...future.env <- environment() [21:05:08.411] local({ [21:05:08.411] for (name in names(...future.x_jj)) { [21:05:08.411] assign(name, ...future.x_jj[[name]], envir = ...future.env, [21:05:08.411] inherits = FALSE) [21:05:08.411] } [21:05:08.411] }) [21:05:08.411] NULL [21:05:08.411] tryCatch(ii, error = identity) [21:05:08.411] }) [21:05:08.411] } [21:05:08.433] - R expression (%dofuture% expression searched for globals): [21:05:08.433] ii [21:05:08.436] - Globals in %dofuture% R expression not in map-reduce expression: [21:05:08.437] - Appending 0 globals only found in the vanilla %dofuture% expression: [21:05:08.437] - globals: [1] '...future.x_ii' [21:05:08.438] List of 1 [21:05:08.438] $ ...future.x_ii: num 42 [21:05:08.438] - attr(*, "where")=List of 1 [21:05:08.438] ..$ ...future.x_ii:<environment: R_EmptyEnv> [21:05:08.438] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [21:05:08.438] - attr(*, "resolved")= logi FALSE [21:05:08.438] - attr(*, "total_size")= num 39 [21:05:08.446] - packages: [1] 'doFuture' [21:05:08.447] - identifying globals and packages ... DONE [21:05:08.447] Launching 1 futures (chunks) ... [21:05:08.447] Chunk #1 of 1 ... [21:05:08.448] - Finding globals in 'args_list' for chunk #1 ... [21:05:08.450] [21:05:08.451] [21:05:08.451] - Finding globals in 'args_list' for chunk #1 ... DONE [21:05:08.451] - seeds: <none> [21:05:08.463] Chunk #1 of 1 ... DONE [21:05:08.464] Launching 1 futures (chunks) ... DONE [21:05:08.464] - resolving futures [21:05:08.464] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture2-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: a17d4b1dac691e8883360a1482701388-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: a17d4b1dac691e8883360a1482701388 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_23_01_50_00_29948/Rtmpw3HLvJ/RLIBS_2dbb423bd7dce', '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' ... [21:07:20.193] doFuture() ... [21:07:20.196] - dummy globals (as locals): [1] 'ii' [21:07:20.197] - R expression: [21:07:20.198] { [21:07:20.198] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [21:07:20.198] "# also in nested calls " [21:07:20.198] doFuture::registerDoFuture() [21:07:20.198] "# doFuture():::doFuture(): process chunk of elements" [21:07:20.198] lapply(seq_along(...future.x_ii), FUN = function(jj) { [21:07:20.198] ...future.x_jj <- ...future.x_ii[[jj]] [21:07:20.198] { [21:07:20.198] NULL [21:07:20.198] ii <- NULL [21:07:20.198] } [21:07:20.198] ...future.env <- environment() [21:07:20.198] local({ [21:07:20.198] for (name in names(...future.x_jj)) { [21:07:20.198] assign(name, ...future.x_jj[[name]], envir = ...future.env, [21:07:20.198] inherits = FALSE) [21:07:20.198] } [21:07:20.198] }) [21:07:20.198] tryCatch(ii, error = identity) [21:07:20.198] }) [21:07:20.198] } [21:07:20.199] - identifying globals and packages ... [21:07:20.221] List of 1 [21:07:20.221] $ ...future.x_ii: NULL [21:07:20.221] - attr(*, "where")=List of 1 [21:07:20.221] ..$ ...future.x_ii:<environment: R_EmptyEnv> [21:07:20.221] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [21:07:20.221] - attr(*, "resolved")= logi FALSE [21:07:20.221] - attr(*, "total_size")= num 27 [21:07:20.229] - R expression: [21:07:20.229] { [21:07:20.229] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [21:07:20.229] "# also in nested calls " [21:07:20.229] doFuture::registerDoFuture() [21:07:20.229] "# doFuture():::doFuture(): process chunk of elements" [21:07:20.229] lapply(seq_along(...future.x_ii), FUN = function(jj) { [21:07:20.229] ...future.x_jj <- ...future.x_ii[[jj]] [21:07:20.229] { [21:07:20.229] NULL [21:07:20.229] ii <- NULL [21:07:20.229] } [21:07:20.229] ...future.env <- environment() [21:07:20.229] local({ [21:07:20.229] for (name in names(...future.x_jj)) { [21:07:20.229] assign(name, ...future.x_jj[[name]], envir = ...future.env, [21:07:20.229] inherits = FALSE) [21:07:20.229] } [21:07:20.229] }) [21:07:20.229] tryCatch(ii, error = identity) [21:07:20.229] }) [21:07:20.229] } [21:07:20.230] - globals: [1] '...future.x_ii' [21:07:20.231] List of 1 [21:07:20.231] $ ...future.x_ii: NULL [21:07:20.231] - attr(*, "where")=List of 1 [21:07:20.231] ..$ ...future.x_ii:<environment: R_EmptyEnv> [21:07:20.231] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [21:07:20.231] - attr(*, "resolved")= logi FALSE [21:07:20.231] - attr(*, "total_size")= num 27 [21:07:20.237] - packages: [1] 'doFuture' [21:07:20.237] - identifying globals and packages ... DONE [21:07:20.309] Number of chunks: 1 [21:07:20.310] Number of futures (= number of chunks): 1 [21:07:20.310] Launching 1 futures (chunks) ... [21:07:20.310] Chunk #1 of 1 ... [21:07:20.310] - Finding globals in 'args_list' chunk #1 ... [21:07:20.311] [21:07:20.312] [21:07:20.312] - Finding globals in 'args_list' for chunk #1 ... DONE [21:07:20.319] Chunk #1 of 1 ... DONE [21:07:20.319] Launching 1 futures (chunks) ... DONE [21:07:20.320] - resolving futures [21:07:20.320] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: e3357d392de2bed0ce80c1dba8ebcdc9-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: e3357d392de2bed0ce80c1dba8ebcdc9 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