Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita16a42c

Browse files
authored
Merge pull request#29 from richfitz/gh-28
Fix CRAN-reported UBSAN issues
2 parents47ee91e +8cc17bf commita16a42c

File tree

16 files changed

+102
-72
lines changed

16 files changed

+102
-72
lines changed

‎.Rbuildignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@
2525
^\.github$
2626
^\.covrignore$
2727
^src/lmdb/mdb\.c\.orig$
28+
^_pkgdown\.yml$

‎.github/workflows/R-CMD-check.yaml‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ on:
44
push:
55
branches:[main, master]
66
pull_request:
7-
branches:[main, master]
87

9-
name:R-CMD-check
8+
name:R-CMD-check.yaml
9+
10+
permissions:read-all
1011

1112
jobs:
1213
R-CMD-check:
@@ -32,7 +33,7 @@ jobs:
3233
R_KEEP_PKG_SOURCE:yes
3334

3435
steps:
35-
-uses:actions/checkout@v3
36+
-uses:actions/checkout@v4
3637

3738
-uses:r-lib/actions/setup-pandoc@v2
3839

@@ -50,3 +51,4 @@ jobs:
5051
-uses:r-lib/actions/check-r-package@v2
5152
with:
5253
upload-snapshots:true
54+
build_args:'c("--no-manual","--compact-vignettes=gs+qpdf")'

‎.github/workflows/pkgdown.yaml‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ on:
44
push:
55
branches:[main, master]
66
pull_request:
7-
branches:[main, master]
87
release:
98
types:[published]
109
workflow_dispatch:
1110

12-
name:pkgdown
11+
name:pkgdown.yaml
12+
13+
permissions:read-all
1314

1415
jobs:
1516
pkgdown:
@@ -19,8 +20,10 @@ jobs:
1920
group:pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
2021
env:
2122
GITHUB_PAT:${{ secrets.GITHUB_TOKEN }}
23+
permissions:
24+
contents:write
2225
steps:
23-
-uses:actions/checkout@v3
26+
-uses:actions/checkout@v4
2427

2528
-uses:r-lib/actions/setup-pandoc@v2
2629

@@ -39,7 +42,7 @@ jobs:
3942

4043
-name:Deploy to GitHub pages 🚀
4144
if:github.event_name != 'pull_request'
42-
uses:JamesIves/github-pages-deploy-action@v4.4.1
45+
uses:JamesIves/github-pages-deploy-action@v4.5.0
4346
with:
4447
clean:false
4548
branch:gh-pages

‎.github/workflows/test-coverage.yaml‎

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ on:
44
push:
55
branches:[main, master]
66
pull_request:
7-
branches:[main, master]
87

9-
name:test-coverage
8+
name:test-coverage.yaml
9+
10+
permissions:read-all
1011

1112
jobs:
1213
test-coverage:
@@ -15,36 +16,47 @@ jobs:
1516
GITHUB_PAT:${{ secrets.GITHUB_TOKEN }}
1617

1718
steps:
18-
-uses:actions/checkout@v3
19+
-uses:actions/checkout@v4
1920

2021
-uses:r-lib/actions/setup-r@v2
2122
with:
2223
use-public-rspm:true
2324

2425
-uses:r-lib/actions/setup-r-dependencies@v2
2526
with:
26-
extra-packages:any::covr
27+
extra-packages:any::covr, any::xml2
2728
needs:coverage
2829

2930
-name:Test coverage
3031
run:|
31-
covr::codecov(
32+
cov <-covr::package_coverage(
3233
quiet = FALSE,
3334
clean = FALSE,
34-
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
35+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
3536
)
37+
print(cov)
38+
covr::to_cobertura(cov)
3639
shell:Rscript {0}
3740

41+
-uses:codecov/codecov-action@v5
42+
with:
43+
# Fail if error if not on PR, or if on PR and token is given
44+
fail_ci_if_error:${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
45+
files:./cobertura.xml
46+
plugins:noop
47+
disable_search:true
48+
token:${{ secrets.CODECOV_TOKEN }}
49+
3850
-name:Show testthat output
3951
if:always()
4052
run:|
4153
## --------------------------------------------------------------------
42-
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; ||true
54+
find'${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; ||true
4355
shell:bash
4456

4557
-name:Upload test results
4658
if:failure()
47-
uses:actions/upload-artifact@v3
59+
uses:actions/upload-artifact@v4
4860
with:
4961
name:coverage-test-failures
5062
path:${{ runner.temp }}/package

‎DESCRIPTION‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
Package: thor
22
Title: Interface to 'LMDB'
3-
Version: 1.1.6
3+
Version: 1.2.0
44
Authors@R: c(person("Rich", "FitzJohn", role = c("aut", "cre"),
55
email = "rich.fitzjohn@gmail.com"),
66
person("Howard", "Chu", role = c("aut", "cph")),
77
person("Symas Corporation", role = "cph"),
88
person("Martin", "Hedenfalk", role = c("aut", "cph")),
99
person("The OpenLDAP Foundation", role = "cph"))
1010
Description: Key-value store, implemented as a wrapper around 'LMDB';
11-
the "lightning memory-mapped database" <https://www.symas.com/lmdb>.
11+
the "lightning memory-mapped database" <https://www.symas.com/mdb>.
1212
'LMDB' is a transactional key value store that uses a memory map
1313
for efficient access. This package wraps the entire 'LMDB'
1414
interface (except duplicated keys), and provides objects for
1515
transactions and cursors.
1616
License: MIT + file LICENSE
17-
URL: https://github.com/richfitz/thor
17+
URL: https://github.com/richfitz/thor, https://richfitz.github.io/thor/
1818
BugReports: https://github.com/richfitz/thor/issues
1919
Imports:
2020
R6,

‎NEWS.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
##1.2.0
2+
3+
* Maintenance release to CRAN, fixing undefined behaviour reported by, and with a fix supplied by, Prof Brian Ripley at CRAN (#28)
4+
15
##1.1.0
26

37
* Bug fix release fixing several QA problems (#10,#13)

‎R/mdb_cursor.R‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ R6_mdb_cursor <- R6::R6Class(
7474
txn$.deps$add(self)
7575
},
7676

77-
finalize=function() {
78-
self$.invalidate()
79-
},
80-
8177
format=function() {
8278
format_thor(self)
8379
},
@@ -198,4 +194,9 @@ R6_mdb_cursor <- R6::R6Class(
198194
self$move_to(key)
199195
self$value(as_proxy,as_raw)
200196
}
197+
),
198+
private=list(
199+
finalize=function() {
200+
self$.invalidate()
201+
}
201202
))

‎R/mdb_env.R‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,6 @@ R6_mdb_env <- R6::R6Class(
335335
ptr
336336
},
337337

338-
finalize=function() {
339-
self$close()
340-
},
341-
342338
format=function() {
343339
format_thor(self)
344340
},
@@ -535,4 +531,9 @@ R6_mdb_env <- R6::R6Class(
535531
thor_list(cur_ptr,starts_with,as_raw,size)
536532
})
537533
}
534+
),
535+
private=list(
536+
finalize=function() {
537+
self$close()
538+
}
538539
))

‎R/mdb_helpers.R‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ invalidate_dependencies <- function(x) {
2828
}
2929

3030
format_thor<-function(x) {
31-
exclude<- c("initialize","finalize","format")
31+
exclude<- c("initialize","format")
3232
method_names<- setdiff(ls(x,pattern="^[^.]"),exclude)
3333
methods<- vapply(method_names,function(i) capture_args(x[[i]],i),
3434
character(1),USE.NAMES=FALSE)

‎R/mdb_txn.R‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,6 @@ R6_mdb_txn <- R6::R6Class(
109109
self$abort(FALSE)
110110
},
111111

112-
finalize=function() {
113-
if (!is.null(self$.ptr)) {
114-
self$abort()
115-
}
116-
},
117-
118112
format=function() {
119113
format_thor(self)
120114
},
@@ -229,4 +223,11 @@ R6_mdb_txn <- R6::R6Class(
229223
cmp=function(a,b) {
230224
mdb_cmp(self$.ptr,self$.db$.ptr,a,b)
231225
}
226+
),
227+
private=list(
228+
finalize=function() {
229+
if (!is.null(self$.ptr)) {
230+
self$abort()
231+
}
232+
}
232233
))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp