* using log directory 'd:/Rcompile/CRANpkg/local/4.6/doFuture.Rcheck' * using R Under development (unstable) (2025-05-03 r88188 ucrt) * using platform: x86_64-w64-mingw32 * R was compiled by gcc.exe (GCC) 14.2.0 GNU Fortran (GCC) 14.2.0 * running under: Windows Server 2022 x64 (build 20348) * using session charset: UTF-8 * checking for file 'doFuture/DESCRIPTION' ... OK * this is package 'doFuture' version '1.0.2' * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking whether package 'doFuture' can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking 'build' directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking code files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... [0s] OK * checking whether the package can be loaded with stated dependencies ... [0s] OK * checking whether the package can be unloaded cleanly ... [0s] OK * checking whether the namespace can be loaded with stated dependencies ... [0s] OK * checking whether the namespace can be unloaded cleanly ... [1s] OK * checking loading without being on the library search path ... [0s] OK * checking whether startup messages can be suppressed ... [1s] OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [4s] OK * checking Rd files ... [1s] OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking installed files from 'inst/doc' ... OK * checking files in 'vignettes' ... OK * checking examples ... [1s] OK * checking for unstated dependencies in 'tests' ... OK * checking tests ... [253s] 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' [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' [4s] Running the tests in 'tests/foreach_dofuture,cluster-missing-doFuture-pkg.R' failed. Complete output: > source("incl/start.R") Loading required package: foreach Loading required package: future R Under development (unstable) (2025-05-03 r88188 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_05_04_01_50_00_20595/RtmpYZkclo/RLIBS_25614370322e5', '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: + ## + ## 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: + ## + ## Note: This error is produced by the future backend when it recieves + ## the unexpected results. + res <- tryCatch({ + y <- foreach(ii = 1:3) %dofuture% ii + }, error = identity) + print(res) + stopifnot(inherits(res, "FutureError")) + } + parallel::stopCluster(cl) + cl <- NULL + + plan(sequential) + + message(sprintf("Test set #1 with cluster type %s ... DONE", sQuote(type))) + } ## for (type ...) Test set #1 with cluster type 'PSOCK' ... [12:21:41.179] doFuture2() ... [12:21:41.240] Number of chunks: 1 [12:21:41.240] Number of futures (= number of chunks): 1 [12:21:41.240] seed = FALSE [12:21:41.241] NULL [12:21:41.244] seed = FALSE [12:21:41.244] seed = FALSE [12:21:41.244] - %dofuture% R expression: [12:21:41.245] ii [12:21:41.245] - foreach iterator arguments: [1] 'ii' [12:21:41.245] - dummy globals (as locals): [1] 'ii' [12:21:41.246] - R expression (map-reduce expression adjusted for RNG): [12:21:41.246] { [12:21:41.246] NULL [12:21:41.246] "# doFuture():::doFuture2(): process chunk of elements" [12:21:41.246] lapply(seq_along(...future.x_ii), FUN = function(jj) { [12:21:41.246] ...future.x_jj <- ...future.x_ii[[jj]] [12:21:41.246] { [12:21:41.246] NULL [12:21:41.246] ii <- NULL [12:21:41.246] } [12:21:41.246] ...future.env <- environment() [12:21:41.246] local({ [12:21:41.246] for (name in names(...future.x_jj)) { [12:21:41.246] assign(name, ...future.x_jj[[name]], envir = ...future.env, [12:21:41.246] inherits = FALSE) [12:21:41.246] } [12:21:41.246] }) [12:21:41.246] NULL [12:21:41.246] tryCatch(ii, error = identity) [12:21:41.246] }) [12:21:41.246] } [12:21:41.247] - identifying globals and packages ... [12:21:41.247] - Argument 'globals': [12:21:41.247] logi TRUE [12:21:41.247] - attr(*, "add")= chr "...future.x_ii" [12:21:41.247] - attr(*, "ignore")= chr "ii" [12:21:41.250] - R expression (map-reduce expression searched for globals): [12:21:41.250] { [12:21:41.250] NULL [12:21:41.250] "# doFuture():::doFuture2(): process chunk of elements" [12:21:41.250] lapply(seq_along(...future.x_ii), FUN = function(jj) { [12:21:41.250] ...future.x_jj <- ...future.x_ii[[jj]] [12:21:41.250] { [12:21:41.250] NULL [12:21:41.250] ii <- NULL [12:21:41.250] } [12:21:41.250] ...future.env <- environment() [12:21:41.250] local({ [12:21:41.250] for (name in names(...future.x_jj)) { [12:21:41.250] assign(name, ...future.x_jj[[name]], envir = ...future.env, [12:21:41.250] inherits = FALSE) [12:21:41.250] } [12:21:41.250] }) [12:21:41.250] NULL [12:21:41.250] tryCatch(ii, error = identity) [12:21:41.250] }) [12:21:41.250] } [12:21:41.264] - R expression (%dofuture% expression searched for globals): [12:21:41.264] ii [12:21:41.266] - Globals in %dofuture% R expression not in map-reduce expression: [12:21:41.266] - Appending 0 globals only found in the vanilla %dofuture% expression: [12:21:41.267] - globals: [1] '...future.x_ii' [12:21:41.267] List of 1 [12:21:41.267] $ ...future.x_ii: num 42 [12:21:41.267] - attr(*, "where")=List of 1 [12:21:41.267] ..$ ...future.x_ii: [12:21:41.267] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [12:21:41.267] - attr(*, "resolved")= logi FALSE [12:21:41.267] - attr(*, "total_size")= num 39 [12:21:41.271] - packages: [1] 'doFuture' [12:21:41.271] - identifying globals and packages ... DONE [12:21:41.271] Launching 1 futures (chunks) ... [12:21:41.272] Chunk #1 of 1 ... [12:21:41.272] - Finding globals in 'args_list' for chunk #1 ... [12:21:41.273] [12:21:41.273] [12:21:41.273] - Finding globals in 'args_list' for chunk #1 ... DONE [12:21:41.274] - seeds: [12:21:41.282] Chunk #1 of 1 ... DONE [12:21:41.282] Launching 1 futures (chunks) ... DONE [12:21:41.283] - resolving futures [12:21:41.283] - gathering results & relaying conditions (except errors) Future UUID: 6c2fd98c93303f021bf84e8a226a1d34-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 '') 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: (seed = FALSE) Resolved: TRUE Value: Conditions captured: Early signaling: FALSE Owner process: 6c2fd98c93303f021bf84e8a226a1d34 Class: 'ClusterFuture', 'MultiprocessFuture', 'Future' DEBUG: END TROUBLESHOOTING HELP Error in serialize(data, node$con) : error writing to connection Calls: ... 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-05-03 r88188 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_05_04_01_50_00_20595/RtmpYZkclo/RLIBS_25614370322e5', '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: + ## + ## 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: + ## + ## Note: This error is produced by the future backend when it recieves + ## the unexpected results. + res <- tryCatch({ + y <- foreach(ii = 1:3) %dopar% ii + }, error = identity) + print(res) + stopifnot(inherits(res, "FutureError")) + } + parallel::stopCluster(cl) + cl <- NULL + + plan(sequential) + + message(sprintf("Test set #1 with cluster type %s ... DONE", sQuote(type))) + } ## for (type ...) Test set #1 with cluster type 'PSOCK' ... [12:23:36.739] doFuture() ... [12:23:36.741] - dummy globals (as locals): [1] 'ii' [12:23:36.741] - R expression: [12:23:36.741] { [12:23:36.741] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [12:23:36.741] "# also in nested calls " [12:23:36.741] doFuture::registerDoFuture() [12:23:36.741] "# doFuture():::doFuture(): process chunk of elements" [12:23:36.741] lapply(seq_along(...future.x_ii), FUN = function(jj) { [12:23:36.741] ...future.x_jj <- ...future.x_ii[[jj]] [12:23:36.741] { [12:23:36.741] NULL [12:23:36.741] ii <- NULL [12:23:36.741] } [12:23:36.741] ...future.env <- environment() [12:23:36.741] local({ [12:23:36.741] for (name in names(...future.x_jj)) { [12:23:36.741] assign(name, ...future.x_jj[[name]], envir = ...future.env, [12:23:36.741] inherits = FALSE) [12:23:36.741] } [12:23:36.741] }) [12:23:36.741] tryCatch(ii, error = identity) [12:23:36.741] }) [12:23:36.741] } [12:23:36.742] - identifying globals and packages ... [12:23:36.759] List of 1 [12:23:36.759] $ ...future.x_ii: NULL [12:23:36.759] - attr(*, "where")=List of 1 [12:23:36.759] ..$ ...future.x_ii: [12:23:36.759] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [12:23:36.759] - attr(*, "resolved")= logi FALSE [12:23:36.759] - attr(*, "total_size")= num 27 [12:23:36.767] - R expression: [12:23:36.767] { [12:23:36.767] "# doFuture():::doFuture(): Make sure that foreach uses 'doFuture'" [12:23:36.767] "# also in nested calls " [12:23:36.767] doFuture::registerDoFuture() [12:23:36.767] "# doFuture():::doFuture(): process chunk of elements" [12:23:36.767] lapply(seq_along(...future.x_ii), FUN = function(jj) { [12:23:36.767] ...future.x_jj <- ...future.x_ii[[jj]] [12:23:36.767] { [12:23:36.767] NULL [12:23:36.767] ii <- NULL [12:23:36.767] } [12:23:36.767] ...future.env <- environment() [12:23:36.767] local({ [12:23:36.767] for (name in names(...future.x_jj)) { [12:23:36.767] assign(name, ...future.x_jj[[name]], envir = ...future.env, [12:23:36.767] inherits = FALSE) [12:23:36.767] } [12:23:36.767] }) [12:23:36.767] tryCatch(ii, error = identity) [12:23:36.767] }) [12:23:36.767] } [12:23:36.768] - globals: [1] '...future.x_ii' [12:23:36.768] List of 1 [12:23:36.768] $ ...future.x_ii: NULL [12:23:36.768] - attr(*, "where")=List of 1 [12:23:36.768] ..$ ...future.x_ii: [12:23:36.768] - attr(*, "class")= chr [1:3] "FutureGlobals" "Globals" "list" [12:23:36.768] - attr(*, "resolved")= logi FALSE [12:23:36.768] - attr(*, "total_size")= num 27 [12:23:36.772] - packages: [1] 'doFuture' [12:23:36.772] - identifying globals and packages ... DONE [12:23:36.808] Number of chunks: 1 [12:23:36.809] Number of futures (= number of chunks): 1 [12:23:36.809] Launching 1 futures (chunks) ... [12:23:36.809] Chunk #1 of 1 ... [12:23:36.809] - Finding globals in 'args_list' chunk #1 ... [12:23:36.810] [12:23:36.810] [12:23:36.810] - Finding globals in 'args_list' for chunk #1 ... DONE [12:23:36.817] Chunk #1 of 1 ... DONE [12:23:36.818] Launching 1 futures (chunks) ... DONE [12:23:36.818] - resolving futures [12:23:36.818] - gathering results & relaying conditions (except errors) Future UUID: 3e10db7d2aff89ae83bf065d8d54f0c4-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 '') 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: (seed = FALSE) Resolved: TRUE Value: Conditions captured: Early signaling: FALSE Owner process: 3e10db7d2aff89ae83bf065d8d54f0c4 Class: 'ClusterFuture', 'MultiprocessFuture', 'Future' DEBUG: END TROUBLESHOOTING HELP Error in serialize(data, node$con) : error writing to connection Calls: ... postNode -> sendData -> sendData.SOCKnode -> serialize Execution halted * checking for unstated dependencies in vignettes ... OK * checking package vignettes ... OK * checking re-building of vignette outputs ... [4s] OK * checking PDF version of manual ... [21s] OK * checking HTML version of manual ... [2s] OK * DONE Status: 1 ERROR