CRAN Package Check Results for Package doFuture

Last updated on 2025-04-26 05:52:20 CEST.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.0.2 3.33 135.21 138.54 OK
r-devel-linux-x86_64-debian-gcc 1.0.2 2.17 106.29 108.46 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 309.00 313.00 ERROR
r-oldrel-macos-arm64 1.0.2 110.00 OK
r-oldrel-macos-x86_64 1.0.2 281.00 OK
r-oldrel-windows-x86_64 1.0.2 6.00 362.00 368.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' [62s] Running 'foreach_dofuture,errors.R' [10s] Running 'foreach_dofuture,globals.R' [7s] Running 'foreach_dofuture,nested_colon.R' [14s] Running 'foreach_dofuture,nested_dofuture.R' [15s] Running 'foreach_dofuture,rng.R' [4s] Running 'foreach_dofuture.R' [3s] Running 'foreach_dopar,cluster-missing-doFuture-pkg.R' [62s] Running 'foreach_dopar,doRNG,dopar.R' [2s] Running 'foreach_dopar,doRNG,dorng.R' [5s] Running 'foreach_dopar,errors.R' [8s] Running 'foreach_dopar,globals.R' [7s] Running 'foreach_dopar,nested_colon.R' [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' [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.17.0 > options(future.debug = FALSE) > > message("*** cluster() ...") *** cluster() ... > > message("Library paths: ", paste(sQuote(.libPaths()), collapse = ", ")) Library paths: 'D:/temp/2025_04_25_01_50_01_4420/Rtmp2j5PtJ/RLIBS_2ba5038caa67', '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' ... [17:15:55.046] doFuture2() ... [17:15:55.095] Number of chunks: 1 [17:15:55.096] Number of futures (= number of chunks): 1 [17:15:55.096] seed = FALSE [17:15:55.097] NULL [17:15:55.100] seed = FALSE [17:15:55.100] seed = FALSE [17:15:55.100] - %dofuture% R expression: [17:15:55.100] ii [17:15:55.101] - foreach iterator arguments: [1] 'ii' [17:15:55.101] - dummy globals (as locals): [1] 'ii' [17:15:55.101] - R expression (map-reduce expression adjusted for RNG): [17:15:55.102] { [17:15:55.102] NULL [17:15:55.102] "# doFuture():::doFuture2(): process chunk of elements" [17:15:55.102] lapply(seq_along(...future.x_ii), FUN = function(jj) { [17:15:55.102] ...future.x_jj <- ...future.x_ii[[jj]] [17:15:55.102] { [17:15:55.102] NULL [17:15:55.102] ii <- NULL [17:15:55.102] } [17:15:55.102] ...future.env <- environment() [17:15:55.102] local({ [17:15:55.102] for (name in names(...future.x_jj)) { [17:15:55.102] assign(name, ...future.x_jj[[name]], envir = ...future.env, [17:15:55.102] inherits = FALSE) [17:15:55.102] } [17:15:55.102] }) [17:15:55.102] NULL [17:15:55.102] tryCatch(ii, error = identity) [17:15:55.102] }) [17:15:55.102] } [17:15:55.102] - identifying globals and packages ... [17:15:55.103] - Argument 'globals': [17:15:55.103] logi TRUE [17:15:55.103] - attr(*, "add")= chr "...future.x_ii" [17:15:55.103] - attr(*, "ignore")= chr "ii" [17:15:55.106] - R expression (map-reduce expression searched for globals): [17:15:55.106] { [17:15:55.106] NULL [17:15:55.106] "# doFuture():::doFuture2(): process chunk of elements" [17:15:55.106] lapply(seq_along(...future.x_ii), FUN = function(jj) { [17:15:55.106] ...future.x_jj <- ...future.x_ii[[jj]] [17:15:55.106] { [17:15:55.106] NULL [17:15:55.106] ii <- NULL [17:15:55.106] } [17:15:55.106] ...future.env <- environment() [17:15:55.106] local({ [17:15:55.106] for (name in names(...future.x_jj)) { [17:15:55.106] assign(name, ...future.x_jj[[name]], envir = ...future.env, [17:15:55.106] inherits = FALSE) [17:15:55.106] } [17:15:55.106] }) [17:15:55.106] NULL [17:15:55.106] tryCatch(ii, error = identity) [17:15:55.106] }) [17:15:55.106] } [17:15:55.121] - R expression (%dofuture% expression searched for globals): [17:15:55.121] ii [17:15:55.123] - Globals in %dofuture% R expression not in map-reduce expression: [17:15:55.124] - Appending 0 globals only found in the vanilla %dofuture% expression: [17:15:55.124] - globals: [1] '...future.x_ii' [17:15:55.124] List of 1 [17:15:55.124] $ ...future.x_ii: num 42 [17:15:55.124] - attr(*, "where")=List of 1 [17:15:55.124] ..$ ...future.x_ii:<environment: R_EmptyEnv> [17:15:55.124] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [17:15:55.124] - attr(*, "resolved")= logi FALSE [17:15:55.124] - attr(*, "total_size")= num 39 [17:15:55.129] - packages: [1] 'doFuture' [17:15:55.129] - identifying globals and packages ... DONE [17:15:55.130] Launching 1 futures (chunks) ... [17:15:55.130] Chunk #1 of 1 ... [17:15:55.130] - Finding globals in 'args_list' for chunk #1 ... [17:15:55.131] [17:15:55.132] [17:15:55.132] - Finding globals in 'args_list' for chunk #1 ... DONE [17:15:55.132] - seeds: <none> [17:15:55.140] Chunk #1 of 1 ... DONE [17:15:55.140] Launching 1 futures (chunks) ... DONE [17:15:55.140] - resolving futures [17:15:55.140] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture2-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: 6aada08ce289d61d61fb3111d9b563ac-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: 6aada08ce289d61d61fb3111d9b563ac 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_25_01_50_01_4420/Rtmp2j5PtJ/RLIBS_2ba5038caa67', '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' ... [17:17:50.661] doFuture() ... [17:17:50.663] - dummy globals (as locals): [1] 'ii' [17:17:50.663] - R expression: [17:17:50.663] { [17:17:50.663] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [17:17:50.663] "# also in nested calls " [17:17:50.663] doFuture::registerDoFuture() [17:17:50.663] "# doFuture():::doFuture(): process chunk of elements" [17:17:50.663] lapply(seq_along(...future.x_ii), FUN = function(jj) { [17:17:50.663] ...future.x_jj <- ...future.x_ii[[jj]] [17:17:50.663] { [17:17:50.663] NULL [17:17:50.663] ii <- NULL [17:17:50.663] } [17:17:50.663] ...future.env <- environment() [17:17:50.663] local({ [17:17:50.663] for (name in names(...future.x_jj)) { [17:17:50.663] assign(name, ...future.x_jj[[name]], envir = ...future.env, [17:17:50.663] inherits = FALSE) [17:17:50.663] } [17:17:50.663] }) [17:17:50.663] tryCatch(ii, error = identity) [17:17:50.663] }) [17:17:50.663] } [17:17:50.664] - identifying globals and packages ... [17:17:50.677] List of 1 [17:17:50.677] $ ...future.x_ii: NULL [17:17:50.677] - attr(*, "where")=List of 1 [17:17:50.677] ..$ ...future.x_ii:<environment: R_EmptyEnv> [17:17:50.677] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [17:17:50.677] - attr(*, "resolved")= logi FALSE [17:17:50.677] - attr(*, "total_size")= num 27 [17:17:50.684] - R expression: [17:17:50.684] { [17:17:50.684] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [17:17:50.684] "# also in nested calls " [17:17:50.684] doFuture::registerDoFuture() [17:17:50.684] "# doFuture():::doFuture(): process chunk of elements" [17:17:50.684] lapply(seq_along(...future.x_ii), FUN = function(jj) { [17:17:50.684] ...future.x_jj <- ...future.x_ii[[jj]] [17:17:50.684] { [17:17:50.684] NULL [17:17:50.684] ii <- NULL [17:17:50.684] } [17:17:50.684] ...future.env <- environment() [17:17:50.684] local({ [17:17:50.684] for (name in names(...future.x_jj)) { [17:17:50.684] assign(name, ...future.x_jj[[name]], envir = ...future.env, [17:17:50.684] inherits = FALSE) [17:17:50.684] } [17:17:50.684] }) [17:17:50.684] tryCatch(ii, error = identity) [17:17:50.684] }) [17:17:50.684] } [17:17:50.685] - globals: [1] '...future.x_ii' [17:17:50.685] List of 1 [17:17:50.685] $ ...future.x_ii: NULL [17:17:50.685] - attr(*, "where")=List of 1 [17:17:50.685] ..$ ...future.x_ii:<environment: R_EmptyEnv> [17:17:50.685] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [17:17:50.685] - attr(*, "resolved")= logi FALSE [17:17:50.685] - attr(*, "total_size")= num 27 [17:17:50.689] - packages: [1] 'doFuture' [17:17:50.689] - identifying globals and packages ... DONE [17:17:50.733] Number of chunks: 1 [17:17:50.734] Number of futures (= number of chunks): 1 [17:17:50.734] Launching 1 futures (chunks) ... [17:17:50.734] Chunk #1 of 1 ... [17:17:50.735] - Finding globals in 'args_list' chunk #1 ... [17:17:50.736] [17:17:50.736] [17:17:50.736] - Finding globals in 'args_list' for chunk #1 ... DONE [17:17:50.744] Chunk #1 of 1 ... DONE [17:17:50.744] Launching 1 futures (chunks) ... DONE [17:17:50.745] - resolving futures [17:17:50.745] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: 2c743fbebca3c9b01a10afbd7a5c1b67-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: 2c743fbebca3c9b01a10afbd7a5c1b67 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' [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' [22s] Running 'foreach_dopar,options-for-export.R' [7s] Running 'foreach_dopar.R' [4s] Running 'makeChunks.R' [6s] Running 'options,nested.R' [5s] Running 'registerDoFuture.R' [3s] 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_25_01_50_00_4416/RtmpWM3B3M/RLIBS_29d983836d95', '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:50:09.023] doFuture2() ... [21:50:09.125] Number of chunks: 1 [21:50:09.125] Number of futures (= number of chunks): 1 [21:50:09.125] seed = FALSE [21:50:09.126] NULL [21:50:09.131] seed = FALSE [21:50:09.131] seed = FALSE [21:50:09.131] - %dofuture% R expression: [21:50:09.132] ii [21:50:09.132] - foreach iterator arguments: [1] 'ii' [21:50:09.133] - dummy globals (as locals): [1] 'ii' [21:50:09.133] - R expression (map-reduce expression adjusted for RNG): [21:50:09.134] { [21:50:09.134] NULL [21:50:09.134] "# doFuture():::doFuture2(): process chunk of elements" [21:50:09.134] lapply(seq_along(...future.x_ii), FUN = function(jj) { [21:50:09.134] ...future.x_jj <- ...future.x_ii[[jj]] [21:50:09.134] { [21:50:09.134] NULL [21:50:09.134] ii <- NULL [21:50:09.134] } [21:50:09.134] ...future.env <- environment() [21:50:09.134] local({ [21:50:09.134] for (name in names(...future.x_jj)) { [21:50:09.134] assign(name, ...future.x_jj[[name]], envir = ...future.env, [21:50:09.134] inherits = FALSE) [21:50:09.134] } [21:50:09.134] }) [21:50:09.134] NULL [21:50:09.134] tryCatch(ii, error = identity) [21:50:09.134] }) [21:50:09.134] } [21:50:09.134] - identifying globals and packages ... [21:50:09.135] - Argument 'globals': [21:50:09.135] logi TRUE [21:50:09.135] - attr(*, "add")= chr "...future.x_ii" [21:50:09.135] - attr(*, "ignore")= chr "ii" [21:50:09.138] - R expression (map-reduce expression searched for globals): [21:50:09.138] { [21:50:09.138] NULL [21:50:09.138] "# doFuture():::doFuture2(): process chunk of elements" [21:50:09.138] lapply(seq_along(...future.x_ii), FUN = function(jj) { [21:50:09.138] ...future.x_jj <- ...future.x_ii[[jj]] [21:50:09.138] { [21:50:09.138] NULL [21:50:09.138] ii <- NULL [21:50:09.138] } [21:50:09.138] ...future.env <- environment() [21:50:09.138] local({ [21:50:09.138] for (name in names(...future.x_jj)) { [21:50:09.138] assign(name, ...future.x_jj[[name]], envir = ...future.env, [21:50:09.138] inherits = FALSE) [21:50:09.138] } [21:50:09.138] }) [21:50:09.138] NULL [21:50:09.138] tryCatch(ii, error = identity) [21:50:09.138] }) [21:50:09.138] } [21:50:09.153] - R expression (%dofuture% expression searched for globals): [21:50:09.153] ii [21:50:09.156] - Globals in %dofuture% R expression not in map-reduce expression: [21:50:09.156] - Appending 0 globals only found in the vanilla %dofuture% expression: [21:50:09.156] - globals: [1] '...future.x_ii' [21:50:09.157] List of 1 [21:50:09.157] $ ...future.x_ii: num 42 [21:50:09.157] - attr(*, "where")=List of 1 [21:50:09.157] ..$ ...future.x_ii:<environment: R_EmptyEnv> [21:50:09.157] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [21:50:09.157] - attr(*, "resolved")= logi FALSE [21:50:09.157] - attr(*, "total_size")= num 39 [21:50:09.164] - packages: [1] 'doFuture' [21:50:09.164] - identifying globals and packages ... DONE [21:50:09.164] Launching 1 futures (chunks) ... [21:50:09.165] Chunk #1 of 1 ... [21:50:09.165] - Finding globals in 'args_list' for chunk #1 ... [21:50:09.167] [21:50:09.167] [21:50:09.168] - Finding globals in 'args_list' for chunk #1 ... DONE [21:50:09.168] - seeds: <none> [21:50:09.179] Chunk #1 of 1 ... DONE [21:50:09.179] Launching 1 futures (chunks) ... DONE [21:50:09.179] - resolving futures [21:50:09.179] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture2-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: 46b7f6c28021016fd137c038eb71f9c6-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: 46b7f6c28021016fd137c038eb71f9c6 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_25_01_50_00_4416/RtmpWM3B3M/RLIBS_29d983836d95', '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:52:22.637] doFuture() ... [21:52:22.641] - dummy globals (as locals): [1] 'ii' [21:52:22.642] - R expression: [21:52:22.643] { [21:52:22.643] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [21:52:22.643] "# also in nested calls " [21:52:22.643] doFuture::registerDoFuture() [21:52:22.643] "# doFuture():::doFuture(): process chunk of elements" [21:52:22.643] lapply(seq_along(...future.x_ii), FUN = function(jj) { [21:52:22.643] ...future.x_jj <- ...future.x_ii[[jj]] [21:52:22.643] { [21:52:22.643] NULL [21:52:22.643] ii <- NULL [21:52:22.643] } [21:52:22.643] ...future.env <- environment() [21:52:22.643] local({ [21:52:22.643] for (name in names(...future.x_jj)) { [21:52:22.643] assign(name, ...future.x_jj[[name]], envir = ...future.env, [21:52:22.643] inherits = FALSE) [21:52:22.643] } [21:52:22.643] }) [21:52:22.643] tryCatch(ii, error = identity) [21:52:22.643] }) [21:52:22.643] } [21:52:22.645] - identifying globals and packages ... [21:52:22.678] List of 1 [21:52:22.678] $ ...future.x_ii: NULL [21:52:22.678] - attr(*, "where")=List of 1 [21:52:22.678] ..$ ...future.x_ii:<environment: R_EmptyEnv> [21:52:22.678] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [21:52:22.678] - attr(*, "resolved")= logi FALSE [21:52:22.678] - attr(*, "total_size")= num 27 [21:52:22.692] - R expression: [21:52:22.693] { [21:52:22.693] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [21:52:22.693] "# also in nested calls " [21:52:22.693] doFuture::registerDoFuture() [21:52:22.693] "# doFuture():::doFuture(): process chunk of elements" [21:52:22.693] lapply(seq_along(...future.x_ii), FUN = function(jj) { [21:52:22.693] ...future.x_jj <- ...future.x_ii[[jj]] [21:52:22.693] { [21:52:22.693] NULL [21:52:22.693] ii <- NULL [21:52:22.693] } [21:52:22.693] ...future.env <- environment() [21:52:22.693] local({ [21:52:22.693] for (name in names(...future.x_jj)) { [21:52:22.693] assign(name, ...future.x_jj[[name]], envir = ...future.env, [21:52:22.693] inherits = FALSE) [21:52:22.693] } [21:52:22.693] }) [21:52:22.693] tryCatch(ii, error = identity) [21:52:22.693] }) [21:52:22.693] } [21:52:22.694] - globals: [1] '...future.x_ii' [21:52:22.695] List of 1 [21:52:22.695] $ ...future.x_ii: NULL [21:52:22.695] - attr(*, "where")=List of 1 [21:52:22.695] ..$ ...future.x_ii:<environment: R_EmptyEnv> [21:52:22.695] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [21:52:22.695] - attr(*, "resolved")= logi FALSE [21:52:22.695] - attr(*, "total_size")= num 27 [21:52:22.703] - packages: [1] 'doFuture' [21:52:22.703] - identifying globals and packages ... DONE [21:52:22.802] Number of chunks: 1 [21:52:22.803] Number of futures (= number of chunks): 1 [21:52:22.803] Launching 1 futures (chunks) ... [21:52:22.803] Chunk #1 of 1 ... [21:52:22.804] - Finding globals in 'args_list' chunk #1 ... [21:52:22.806] [21:52:22.806] [21:52:22.807] - Finding globals in 'args_list' for chunk #1 ... DONE [21:52:22.818] Chunk #1 of 1 ... DONE [21:52:22.818] Launching 1 futures (chunks) ... DONE [21:52:22.819] - resolving futures [21:52:22.819] - gathering results & relaying conditions (except errors) <FutureInterruptError: A future ('doFuture-1') of class ClusterFuture was interrupted, while running on 'localhost'> Future UUID: 9f79c9400b0674692bad939ab3f5cf44-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: 9f79c9400b0674692bad939ab3f5cf44 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