Skip to content

Commit 7553740

Browse files
committed
Added CRAN release checklist.
1 parent c7ee3cd commit 7553740

File tree

2 files changed

+237
-0
lines changed

2 files changed

+237
-0
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ create_md.R
1111
SO_Answers/*
1212
^codecov\.yml$
1313
^_pkgdown\.yml$
14+
^CRAN_RELEASE_CHECKLIST.md$

CRAN_RELEASE_CHECKLIST.md

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
# CRAN Release Checklist (RcppAlgos)
2+
3+
This checklist is optimized for small patch releases and CRAN pretests
4+
(CITATION readability, URL validity, clean tarball contents).
5+
6+
---
7+
8+
## 0) Before you start
9+
10+
- [ ] Confirm you are on a clean release branch (no WIP for the next large release).
11+
- [ ] `git status` is clean (or only includes intentional release edits).
12+
- [ ] Review staged changes (ignore pkgdown output as needed):
13+
- [ ] `git diff --stat`
14+
- [ ] `git diff <prev_tag>..HEAD -- . ':(exclude)docs'`
15+
16+
---
17+
18+
## 1) Versioning + changelog
19+
20+
- [ ] Bump version in `DESCRIPTION` (e.g., `2.9.4``2.9.5`).
21+
- [ ] Update `NEWS.md` with a new top entry.
22+
- [ ] Update `man/NEWS.Rd` (if shipped) to match `NEWS.md`.
23+
24+
---
25+
26+
## 2) CITATION (CRAN incoming pretest requirement)
27+
28+
- [ ] Update `inst/CITATION`.
29+
- [ ] Ensure `inst/CITATION` contains **no dynamic calls** that require the package
30+
to be installed/available (e.g., no `packageVersion()`, `Sys.Date()`,
31+
`utils::packageDescription()`, `citation()`, etc.).
32+
- [ ] Ensure URLs are canonical (e.g., trailing slashes where applicable).
33+
- [ ] Local verification:
34+
- [ ] `R -q -e "tools::checkRdaFiles('.')"` (optional)
35+
- [ ] Build + check tarball (see section 5) and confirm no:
36+
- “Reading CITATION file fails … when package is not installed.”
37+
38+
---
39+
40+
## 3) URLs + metadata
41+
42+
- [ ] Run URL checks (fix true errors):
43+
- [ ] `R -q -e "urlchecker::url_check()"`
44+
- [ ] Fix:
45+
- [ ] Invalid fragments (bad `#...` URLs)
46+
- [ ] True 404s
47+
- [ ] Permanent redirects (301) by switching to canonical URL (often add trailing slash)
48+
- [ ] Confirm `DESCRIPTION` includes canonical URLs (pkgdown + GitHub), e.g.:
49+
- [ ] `URL: https://jwood000.github.io/RcppAlgos/, https://github.com/jwood000/RcppAlgos`
50+
- [ ] `BugReports: https://github.com/jwood000/RcppAlgos/issues`
51+
52+
---
53+
54+
## 4) Build hygiene (.Rbuildignore)
55+
56+
- [ ] Ensure non-package files are excluded in `.Rbuildignore`, at minimum:
57+
- [ ] `^docs$` (pkgdown output)
58+
- [ ] `^_pkgdown\.yml$`
59+
- [ ] `^CRAN_RELEASE_CHECKLIST\.md$`
60+
- [ ] Any local tooling directories (e.g., `^ai_git_helpers$`)
61+
- [ ] Confirm `R CMD build` tarball does not include website/config extras.
62+
63+
---
64+
65+
## 5) Local checks (must be clean)
66+
67+
Run checks from a clean state.
68+
69+
- [ ] `R CMD build .`
70+
- [ ] `R CMD check RcppAlgos_<version>.tar.gz --as-cran`
71+
72+
Verify:
73+
- [ ] No ERRORs or WARNINGs.
74+
- [ ] Any NOTEs are understood/acceptable (avoid new NOTES if possible).
75+
- [ ] In particular:
76+
- [ ] CITATION readable in incoming feasibility checks
77+
- [ ] No invalid URLs (especially malformed GitHub links)
78+
- [ ] No new “non-standard file/directory found at top level”
79+
80+
---
81+
82+
## 6) pkgdown site (optional for CRAN, recommended for releases)
83+
84+
If maintaining the site for each release:
85+
86+
- [ ] Update `_pkgdown.yml` as needed (bootstrap, url).
87+
- [ ] `R -q -e "pkgdown::build_site()"`
88+
- [ ] Commit site output under `docs/` (if that is the repo policy).
89+
- [ ] If pkgdown warns about missing alt text, consider fixing in README/vignettes.
90+
91+
---
92+
93+
## 7) External builders
94+
95+
- [ ] Win-builder:
96+
- [ ] devel
97+
- [ ] release
98+
- [ ] oldrelease
99+
- [ ] (Recommended) CI matrix / GitHub Actions:
100+
- [ ] at least Linux + macOS
101+
- [ ] include r-devel somewhere if practical
102+
103+
---
104+
105+
## 8) Final review + tagging
106+
107+
- [ ] Review final diff (excluding docs):
108+
- [ ] `git diff <prev_tag>..HEAD -- . ':(exclude)docs'`
109+
- [ ] Confirm `DESCRIPTION` fields (at least):
110+
- [ ] `Version`
111+
- [ ] `URL` (canonical)
112+
- [ ] `BugReports`
113+
- [ ] Create release tag:
114+
- [ ] `git tag -a v<version> -m "CRAN patch release <version>"`
115+
- [ ] `git push --tags`
116+
117+
---
118+
119+
## 9) CRAN submission
120+
121+
- [ ] Prepare `cran-comments.md` (if used), include:
122+
- [ ] Summary of changes
123+
- [ ] Any NOTE explanations (if any remain)
124+
- [ ] Mention that CITATION/URL issues from incoming pretests were corrected
125+
- [ ] Submit via `devtools::submit_cran()` or CRAN web form.
126+
127+
---
128+
129+
## Quick commands (copy/paste)
130+
131+
### Diff ignoring pkgdown output
132+
133+
```sh
134+
git diff <old> <new> -- . ':(exclude)docs'
135+
```
136+
137+
### Build + check
138+
139+
```sh
140+
R CMD build .
141+
R CMD check RcppAlgos_*.tar.gz --as-cran
142+
```
143+
144+
### URL check
145+
146+
```r
147+
urlchecker::url_check()
148+
```
149+
150+
### pkgdown
151+
152+
```r
153+
pkgdown::build_site()
154+
```
155+
156+
## Docker UBSan (r-devel-ubsan-clang) sanity check (recommended for C++ changes)
157+
158+
This is a quick way to catch undefined behavior (UB) that may not show up in
159+
regular checks. Uses the rocker image: `rocker/r-devel-ubsan-clang`.
160+
161+
### 1) Start Docker
162+
- [ ] Open Docker Desktop and ensure it is running.
163+
164+
### 2) Run the container (mount repo)
165+
> `--rm` removes the container when you exit; the repo is mounted in.
166+
167+
```sh
168+
docker run --platform linux/amd64 -m=10g --cap-add SYS_PTRACE \
169+
--name=r-devel-ubsan-clang \
170+
-v ~/RcppAlgos:/RSource/RcppAlgos \
171+
--rm -ti rocker/r-devel-ubsan-clang /bin/bash
172+
```
173+
174+
### 3) Install system deps (inside container)
175+
176+
```sh
177+
apt-get update
178+
apt-get install -y libgmp3-dev
179+
```
180+
181+
### 4) Install R deps (inside container)
182+
183+
```sh
184+
R -e 'install.packages(c("cpp11","gmp","testthat","microbenchmark","numbers","partitions"), repos="https://cloud.r-project.org")'
185+
R -e 'install.packages("RcppBigIntAlgos", repos="https://cloud.r-project.org")'
186+
```
187+
188+
### 5) Build + check package (inside container)
189+
190+
```sh
191+
R CMD build /RSource/RcppAlgos
192+
Rdevel CMD check --no-examples --no-vignettes RcppAlgos_*.tar.gz
193+
```
194+
195+
Notes:
196+
197+
* Use `--no-examples --no-vignettes` for speed. Remove these flags when debugging
198+
vignette/example-related issues.
199+
* If you are investigating memory/UB issues deeply, consider running without
200+
`--no-vignettes` to widen coverage.
201+
202+
---
203+
204+
## Debugging UBSan traces (addr2line)
205+
206+
Sometimes UBSan prints stack frames with offsets into the shared object, e.g.:
207+
208+
`/RcppAlgos.Rcheck/RcppAlgos/libs/RcppAlgos.so+0x3034db`
209+
210+
You can map these offsets back to source lines using `addr2line`.
211+
212+
### 1) Locate the compiled shared object and the offset
213+
214+
Example:
215+
216+
* SO: `/RcppAlgos.Rcheck/RcppAlgos/libs/RcppAlgos.so`
217+
* Offset: `0x3034db`
218+
219+
### 2) Convert offset to file:line
220+
221+
```sh
222+
addr2line -e /RcppAlgos.Rcheck/RcppAlgos/libs/RcppAlgos.so -f -C 0x3034db
223+
```
224+
225+
Recommended:
226+
227+
* `-f` prints function name
228+
* `-C` demangles C++ symbols
229+
230+
### 3) If symbolization is missing / warnings appear
231+
232+
If you see messages like:
233+
`WARNING: Failed to use and restart external symbolizer!`
234+
235+
Try installing/ensuring LLVM symbolizer tools are present, then re-run.
236+
(Exact package names can vary across base images.)

0 commit comments

Comments
 (0)