Skip to content

Commit 24bcd67

Browse files
Futures now muffle any packageStartupMessage conditions produced when pre-loading and pre-attaching packages [#803]
1 parent 7ec0897 commit 24bcd67

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future
2-
Version: 1.58.0-9025
2+
Version: 1.58.0-9026
33
Title: Unified Parallel and Distributed Processing in R for Everyone
44
Depends:
55
R (>= 3.2.0)

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
the default for `plan(multisession)` work also on computers with a
88
large number of CPU cores (e.g. 192 and 256 cores) while leaving 16
99
connection slots available for other needs.
10+
11+
* Futures now muffle any `packageStartupMessage` conditions produced
12+
when pre-loading and pre-attaching packages, e.g. as specified by
13+
the `packages` argument or those needed by global objects.
1014

1115
## Performance
1216

R/backend_api-evalFuture.R

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@ attachPackages <- function(packages) {
2929
## call library(), which attaches the package. /HB 2016-06-16
3030
lib.loc <- .libPaths()
3131
tryCatch({
32-
for (pkg in packages) {
33-
loadNamespace(pkg)
34-
library(pkg, character.only = TRUE, lib.loc = lib.loc, warn.conflicts = FALSE, quietly = FALSE, mask.ok = character(0L), exclude = character(0L), attach.required = TRUE)
35-
}
36-
NULL
32+
withCallingHandlers({
33+
for (pkg in packages) {
34+
loadNamespace(pkg)
35+
library(pkg, character.only = TRUE, lib.loc = lib.loc, warn.conflicts = FALSE, quietly = FALSE, mask.ok = character(0L), exclude = character(0L), attach.required = TRUE)
36+
}
37+
NULL
38+
}, packageStartupMessage = function(m) {
39+
invokeRestart("muffleMessage")
40+
})
3741
}, error = identity)
3842
} ## attachPackages()
3943

0 commit comments

Comments
 (0)