Skip to content

Commit bae53d3

Browse files
BUG FIX: future(..., packages = "missing-package") did result in an error despite requesting a non-installed package
1 parent 6dbda9b commit bae53d3

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
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.68.0-9014
2+
Version: 1.68.0-9015
33
Title: Unified Parallel and Distributed Processing in R for Everyone
44
Depends:
55
R (>= 3.2.0)

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
1 unknown future arguments: 'interrupts'" for third-party future
1818
backends.
1919

20+
* `future(..., packages = "missing-package")` did result in an error
21+
despite requesting a non-installed package.
22+
2023
## Deprecated and Defunct
2124

2225
* Remove argument `earlySignal` from `future()`, `futureAssign()`,

R/backend_api-evalFuture.R

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,9 +667,12 @@ evalFutureInternal <- function(data) {
667667
## -----------------------------------------------------------------
668668
## Load and attached backend packages
669669
## -----------------------------------------------------------------
670-
withCallingHandlers({
670+
res <- withCallingHandlers({
671671
attachPackages(backendPackages)
672672
}, condition = onEvalCondition)
673+
if (inherits(res, "error")) {
674+
stop(FutureEvalError(sprintf("Failed to attach one or more future-backend packages: %s", conditionMessage(res))))
675+
}
673676

674677

675678
## -----------------------------------------------------------------
@@ -682,9 +685,12 @@ evalFutureInternal <- function(data) {
682685
...future.mc.cores.old <- getOption("mc.cores")
683686

684687
## Load and attached packages
685-
withCallingHandlers({
688+
res <- withCallingHandlers({
686689
attachPackages(packages)
687690
}, condition = onEvalCondition)
691+
if (inherits(res, "error")) {
692+
stop(FutureEvalError(sprintf("Failed to attach one or more packages: %s", conditionMessage(res))))
693+
}
688694

689695
## Note, we record R options and environment variables _after_
690696
## loading and attaching packages, in case they set options/env vars

0 commit comments

Comments
 (0)