Skip to content

Commit e11031e

Browse files
Merge branch 'release/1.34.0'
2 parents 1c4c733 + e7399de commit e11031e

31 files changed

+3771
-1742
lines changed

.github/workflows/covr.yaml

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ jobs:
66
covr:
77
if: "! contains(github.event.head_commit.message, '[ci skip]')"
88

9-
timeout-minutes: 45
9+
timeout-minutes: 120
1010

11-
runs-on: ubuntu-22.04
11+
runs-on: ubuntu-latest
1212

1313
name: covr
1414

@@ -17,48 +17,39 @@ jobs:
1717

1818
env:
1919
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
20-
RSPM: https://packagemanager.rstudio.com/cran/__linux__/jammy/latest
20+
R_KEEP_PKG_SOURCE: yes
2121
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
22+
## Test in other locale (optional)
23+
LANGUAGE: ${{ matrix.config.language }}
2224
## R CMD check
25+
_R_CHECK_CRAN_INCOMING_: false
2326
_R_CHECK_LENGTH_1_CONDITION_: true
2427
_R_CHECK_LENGTH_1_LOGIC2_: true
2528
_R_CHECK_MATRIX_DATA_: true
26-
_R_CHECK_CRAN_INCOMING_: false
29+
_R_CHECK_SUGGESTS_ONLY_: true
30+
_R_CHECK_THINGS_IN_TEMP_DIR_: true
31+
RCMDCHECK_ERROR_ON: note
32+
## Specific to futures
33+
R_FUTURE_RNG_ONMISUSE: error
2734

2835
steps:
2936
- uses: actions/checkout@v4
3037

31-
- uses: r-lib/actions/setup-pandoc@v2
32-
3338
- uses: r-lib/actions/setup-r@v2
3439
with:
35-
r-version: release
40+
use-public-rspm: true
3641

37-
- name: Query dependencies
38-
run: |
39-
install.packages('remotes')
40-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
41-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
42-
shell: Rscript {0}
43-
44-
- name: Cache R packages
45-
uses: actions/cache@v3
42+
- uses: r-lib/actions/setup-r-dependencies@v2
4643
with:
47-
path: ${{ env.R_LIBS_USER }}
48-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
49-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
50-
51-
- name: Install system dependencies
52-
env:
53-
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
54-
run: |
55-
Rscript -e "remotes::install_github('r-hub/sysreqs')"
56-
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
57-
sudo -s eval "$sysreqs"
44+
extra-packages: |
45+
any::rcmdcheck
46+
any::remotes
47+
any::sessioninfo
48+
any::covr
49+
needs: check
5850

5951
- name: Install dependencies
6052
run: |
61-
install.packages(c("covr", "sessioninfo"))
6253
remotes::install_deps(dependencies = TRUE)
6354
install.packages(".", repos=NULL, type="source")
6455
shell: Rscript {0}
@@ -76,7 +67,8 @@ jobs:
7667
## https://app.codecov.io/gh/<org>/<repo>/settings
7768
## 2. Set 'CODECOV_TOKEN' in GitHub Secrets:
7869
## https://github.com/<org>/<repo>/settings/environments/
79-
coverage <- covr::package_coverage()
70+
coverage <- covr::package_coverage(quiet = FALSE)
8071
print(coverage)
8172
covr::codecov(coverage = coverage, token="${{secrets.CODECOV_TOKEN}}")
8273
shell: Rscript {0}
74+

.github/workflows/future_tests.yaml

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
timeout-minutes: 30
1010

11-
runs-on: ubuntu-22.04
11+
runs-on: ubuntu-latest
1212

1313
name: future.plan=${{ matrix.future.plan }}
1414

@@ -26,7 +26,6 @@ jobs:
2626

2727
env:
2828
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
29-
RSPM: https://packagemanager.rstudio.com/cran/__linux__/jammy/latest
3029
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
3130
## R CMD check
3231
_R_CHECK_LENGTH_1_LOGIC2_: true
@@ -42,35 +41,28 @@ jobs:
4241

4342
- uses: r-lib/actions/setup-r@v2
4443
with:
45-
r-version: release
44+
use-public-rspm: true
4645

47-
- name: Query R package dependencies
48-
run: |
49-
install.packages('remotes')
50-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
51-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
52-
shell: Rscript {0}
53-
54-
- name: Cache R packages
55-
uses: actions/cache@v3
46+
- uses: r-lib/actions/setup-r-dependencies@v2
5647
with:
57-
path: ${{ env.R_LIBS_USER }}
58-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
59-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
48+
extra-packages: |
49+
any::rcmdcheck
50+
any::remotes
51+
any::sessioninfo
52+
any::covr
53+
needs: check
6054

61-
- name: Install R package system dependencies (Linux)
62-
if: runner.os == 'Linux'
63-
env:
64-
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
55+
- name: Install dependencies
6556
run: |
66-
Rscript -e "remotes::install_github('r-hub/sysreqs')"
67-
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
68-
sudo -s eval "$sysreqs"
57+
remotes::install_deps(dependencies = TRUE)
58+
install.packages(".", repos=NULL, type="source")
59+
shell: Rscript {0}
6960

70-
- name: Install R package dependencies
61+
- name: Session info
7162
run: |
72-
remotes::install_deps(dependencies = TRUE)
73-
install.packages(".", repos=NULL, type="source") ## needed by parallel workers
63+
options(width = 100)
64+
pkgs <- installed.packages()[, "Package"]
65+
sessioninfo::session_info(pkgs, include_base = TRUE)
7466
shell: Rscript {0}
7567

7668
- name: Install 'future.tests' and any backend R packages

.github/workflows/revdepcheck-top.yaml

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
timeout-minutes: 30
1010

11-
runs-on: ubuntu-22.04
11+
runs-on: ubuntu-latest
1212

1313
name: ${{ matrix.config.pkg }} (${{ matrix.config.r }}) ${{ matrix.config.label }}
1414

@@ -51,36 +51,21 @@ jobs:
5151
- uses: r-lib/actions/setup-r@v2
5252
with:
5353
r-version: ${{ matrix.config.r }}
54+
use-public-rspm: true
5455

55-
- name: Query dependencies
56-
run: |
57-
install.packages('remotes')
58-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
59-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
60-
shell: Rscript {0}
61-
62-
- name: Cache R packages
63-
if: runner.os != 'Windows'
64-
uses: actions/cache@v3
56+
- uses: r-lib/actions/setup-r-dependencies@v2
6557
with:
66-
path: ${{ env.R_LIBS_USER }}
67-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
68-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
69-
70-
- name: Install system dependencies (Linux)
71-
if: runner.os == 'Linux'
72-
env:
73-
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
74-
run: |
75-
Rscript -e "remotes::install_github('r-hub/sysreqs')"
76-
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
77-
sudo -s eval "$sysreqs"
58+
extra-packages: |
59+
any::rcmdcheck
60+
any::remotes
61+
any::sessioninfo
62+
any::covr
63+
needs: check
7864

7965
- name: Install dependencies
8066
run: |
8167
remotes::install_deps(dependencies = TRUE)
82-
remotes::install_cran("rcmdcheck")
83-
install.packages(".", repos=NULL, type="source") ## needed by parallel workers
68+
install.packages(".", repos=NULL, type="source")
8469
install.packages("${{ matrix.config.pkg }}", dependencies=TRUE)
8570
shell: Rscript {0}
8671

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Package: future
2-
Version: 1.33.2
2+
Version: 1.34.0
33
Title: Unified Parallel and Distributed Processing in R for Everyone
44
Imports:
55
digest,
66
globals (>= 0.16.1),
77
listenv (>= 0.8.0),
88
parallel,
9-
parallelly (>= 1.34.0),
9+
parallelly (>= 1.38.0),
1010
utils
1111
Suggests:
1212
methods,
@@ -40,5 +40,5 @@ ByteCompile: TRUE
4040
URL: https://future.futureverse.org, https://github.com/HenrikBengtsson/future
4141
BugReports: https://github.com/HenrikBengtsson/future/issues
4242
Encoding: UTF-8
43-
RoxygenNote: 7.3.1
43+
RoxygenNote: 7.3.2
4444
Roxygen: list(markdown = TRUE)

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ importFrom(parallelly,isNodeAlive)
180180
importFrom(parallelly,makeClusterMPI)
181181
importFrom(parallelly,makeClusterPSOCK)
182182
importFrom(parallelly,makeNodePSOCK)
183+
importFrom(parallelly,serializedSize)
183184
importFrom(parallelly,supportsMulticore)
184185
importFrom(utils,capture.output)
185186
importFrom(utils,file_test)

NEWS.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
# Version 1.34.0 [2024-07-29]
2+
3+
## New Features
4+
5+
* Added support for backend maintainers to specify "cleanup" hook
6+
functions on future strategies, which are called when switching
7+
future plan. These hook functions are specified via the optional
8+
`cleanup` attribute, cf. `attr(cluster, "cleanup")`.
9+
10+
## Performance
11+
12+
* Size calculation of globals is now done using the much faster
13+
`parallelly::serializedSize()`.
14+
15+
## Bug Fixes
16+
17+
* `resolved()` for `ClusterFuture`:s would produce `Error:
18+
'inherits(future, "Future")' is not TRUE` instead of an intended,
19+
informative error message that the connection to the parallel
20+
worker is broken.
21+
22+
123
# Version 1.33.2 [2024-03-23]
224

325
## Performance

R/ClusterFuture-class.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ resolved.ClusterFuture <- function(x, run = TRUE, timeout = NULL, ...) {
280280
isValid <- isConnectionValid(con)
281281
if (!isValid) {
282282
ex <- simpleError("Connection to the worker is corrupt")
283-
msg <- post_mortem_cluster_failure(ex, when = "checking resolved from", node = node, future = future)
284-
stop(FutureError(msg, future = future))
283+
msg <- post_mortem_cluster_failure(ex, when = "checking resolved from", node = node, future = x)
284+
stop(FutureError(msg, future = x))
285285
}
286286

287287
if (is.null(timeout)) {

R/cluster.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,7 @@ cluster <- function(..., persistent = FALSE, workers = availableWorkers(), envir
4646
}
4747
class(cluster) <- c("cluster", "multiprocess", "future", "function")
4848
attr(cluster, "init") <- TRUE
49+
attr(cluster, "cleanup") <- function() {
50+
ClusterRegistry(action = "stop")
51+
}
4952
attr(cluster, "tweakable") <- quote(c(makeClusterPSOCK_args(), "persistent"))

R/multisession.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#'
3838
#' @return
3939
#' A \link{MultisessionFuture}.
40-
#' If `workers == 1`, then all processing using done in the
40+
#' If `workers == 1`, then all processing is done in the
4141
#' current/main \R session and we therefore fall back to using a
4242
#' lazy future. To override this fallback, use `workers = I(1)`.
4343
#'
@@ -81,4 +81,7 @@ multisession <- function(..., workers = availableCores(), lazy = FALSE, rscript_
8181
}
8282
class(multisession) <- c("multisession", "cluster", "multiprocess", "future", "function")
8383
attr(multisession, "init") <- TRUE
84+
attr(multisession, "cleanup") <- function() {
85+
ClusterRegistry(action = "stop")
86+
}
8487
attr(multisession, "untweakable") <- c("persistent")

R/options.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@
188188
#' R_FUTURE_OUTPUT_WINDOWS_REENCODE
189189
#' future.journal
190190
#' R_FUTURE_JOURNAL
191+
#' R_FUTURE_GLOBALS_OBJECTSIZE_METHOD
192+
#' future.globals.objectSize.method
191193
#'
192194
#' @name future.options
193195
NULL
@@ -356,4 +358,8 @@ update_package_options <- function(debug = FALSE) {
356358
## SETTINGS USED FOR DEPRECATING FEATURES
357359
## future 1.22.0:
358360
update_package_option("future.globals.keepWhere", mode = "logical", debug = debug)
361+
362+
## future 1.34.0:
363+
update_package_option("future.globals.objectSize.method", mode = "character", debug = debug)
364+
update_package_option("future.plan.cleanup.legacy", mode = "logical", debug = debug)
359365
}

0 commit comments

Comments
 (0)