Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ script.R
^revdep$
^talk$
\.cache$
^MAINTENANCE\.md$
5 changes: 2 additions & 3 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
on:
push:
branches: master
branches: main
pull_request:
branches:
- master
- main

name: format_check

Expand All @@ -21,4 +21,3 @@ jobs:

- name: Check for a non-empty diff
run: git diff-files -U --exit-code

10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Package: cpp11
Title: A C++11 Interface for R's C Interface
Version: 0.4.0.9000
Version: 0.4.2.9000
Authors@R:
c(person(given = "Jim",
family = "Hester",
role = c("aut", "cre"),
email = "[email protected]",
role = "aut",
comment = c(ORCID = "0000-0002-2739-7082")),
person(given = "Romain",
family = "François",
role = "ctb"),
role = c("aut", "cre"),
email = "[email protected]"),
person(given = "Benjamin",
family = "Kietzman",
role = "ctb"),
Expand Down Expand Up @@ -58,5 +58,5 @@ Config/Needs/cpp11/cpp_register:
vctrs
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.1
RoxygenNote: 7.1.2
SystemRequirements: C++11
49 changes: 49 additions & 0 deletions MAINTENANCE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
## Current state

The state of cpp11 is pretty stable, it seems to have the features we need for most of our projects using C++.

## Known outstanding issues

### Running the cpp11test tests

Most of the test suite is in a sub-package, cpp11test.
Probably the best way to run these tests is to install the development version of cpp11 and then run `devtools::test()` to run the cpp11test test suite.

If tests failures occur the output from Catch isn't always easy to interpret.
I have a branch of testthat https://github.com/jimhester/testthat/tree/catch-detailed-output that should make things easier to understand.
I contributed those changes to the main testthat, but something changed after merging the more detailed output was lost, I unfortunately never had the time to track down the cause and fix it.

In addition getting a debugger to catch when errors happen can be fiddly when running the cpp11test tests, something about the way that Catch redirects stderr / stdout interacts with the debugger.

The GitHub Actions workflow has some additional logic to handle running the cpp11 tests https://github.com/r-lib/cpp11/blob/fd8ef97d006db847f7f17166cf52e1e0383b2d35/.github/workflows/R-CMD-check.yaml#L95-L102, https://github.com/r-lib/cpp11/blob/fd8ef97d006db847f7f17166cf52e1e0383b2d35/.github/workflows/R-CMD-check.yaml#L117-L124.

### False positive URL checks for git repositories in the vignettes

If you run `urlchecker::url_check()` on the repo you will see the following false positives.

```
! Warning: vignettes/motivations.Rmd:363:11 Moved
git clone https://github.com/r-lib/cpp11.git
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
https://github.com/r-lib/cpp11
! Warning: vignettes/motivations.Rmd:354:11 Moved
git clone https://github.com/RcppCore/Rcpp.git
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
https://github.com/RcppCore/Rcpp
>
```

These only happen with the urlchecker package, they can be safely ignored and the real CRAN checks will not show them.


### Ensure you use `Sys.setenv("CPP11_EVAL" = "true"); devtools::submit_cran()` when submitting.

If you forget to set `CPP_EVAL = "true"` then the vignette chunks will not run properly and the vignettes will not be rendered properly.

## Future directions

Some work could be spent in smoothing out the `cpp_source()` / knitr chunk experience.
Our main focus and use cases were in R packages, so that usage is more tested.
Because we don't typically use cpp11 in non package contexts those use cases may not be as nice.

For similar reasons the matrix support might be somewhat lacking, as the majority of our use cases do not deal with numeric matrices.
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# cpp11 (development version)

* `cpp_source()` errors on non-existent file (#261).

# cpp11 0.4.2

* Romain François is now the maintainer.

# cpp11 0.4.1

* Fix crash related to unwind protect optimization (#244)

# cpp11 0.4.0

## New Features
Expand Down
3 changes: 3 additions & 0 deletions R/source.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
#' @export
cpp_source <- function(file, code = NULL, env = parent.frame(), clean = TRUE, quiet = TRUE, cxx_std = Sys.getenv("CXX_STD", "CXX11"), dir = tempfile()) {
stop_unless_installed(c("brio", "callr", "cli", "decor", "desc", "glue", "tibble", "vctrs"))
if (!missing(file) && !file.exists(file)) {
stop("Can't find `file` at this path:\n", file, "\n", call. = FALSE)
}

dir.create(dir, showWarnings = FALSE, recursive = TRUE)
dir.create(file.path(dir, "R"), showWarnings = FALSE)
Expand Down
2 changes: 1 addition & 1 deletion R/vendor.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#'
#' **Note**: vendoring places the responsibility of updating the code on
#' **you**. Bugfixes and new features in cpp11 will not be available for your
#' code until you run `vector_cpp11()` again.
#' code until you run `cpp_vendor()` again.
#'
#' @inheritParams cpp_register
#' @return The file path to the vendored code (invisibly).
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- badges: start -->
[![R-CMD-check](https://github.com/r-lib/cpp11/workflows/R-CMD-check/badge.svg)](https://github.com/r-lib/cpp11/actions)
[![codecov](https://codecov.io/gh/r-lib/cpp11/branch/master/graph/badge.svg?token=EEWYoCYxQ2)](https://codecov.io/gh/r-lib/cpp11)
[![codecov](https://app.codecov.io/gh/r-lib/cpp11/branch/main/graph/badge.svg?token=EEWYoCYxQ2)](https://app.codecov.io/gh/r-lib/cpp11)
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![CRAN status](https://www.r-pkg.org/badges/version/cpp11)](https://CRAN.R-project.org/package=cpp11)
<!-- badges: end -->
Expand Down
Loading