Skip to content

Commit

Permalink
Merge pull request #54 from ropensci/i51-cran-update
Browse files Browse the repository at this point in the history
  • Loading branch information
richfitz authored Nov 3, 2021
2 parents cb76f76 + 6fc2b17 commit 4d9f6dc
Show file tree
Hide file tree
Showing 14 changed files with 2,384 additions and 13,078 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
^doc$
^Meta$
^\.github$
^revdep$
^docker$
7 changes: 4 additions & 3 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}

env:
Expand Down Expand Up @@ -53,8 +54,8 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
key: ${{ matrix.config.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ matrix.config.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
Expand Down Expand Up @@ -82,5 +83,5 @@ jobs:
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results
path: check
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ js/node_modules
js/bundle*js
doc
Meta
.idea
revdep
9 changes: 6 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
Package: jsonvalidate
Title: Validate 'JSON' Schema
Version: 1.3.1
Version: 1.3.2
Authors@R: c(person("Rich", "FitzJohn", role = c("aut", "cre"),
email = "[email protected]"),
person("Rob", "Ashton", role = "aut"),
person("Alex", "Hill", role = "ctb"),
person("Alicia", "Schep", role = "ctb"),
person("Ian", "Lyttle", role = "ctb"),
person("Kara", "Woo", role = "ctb"),
person("Mathias", "Buus", role = "cph"),
person("Evgeny", "Poberezkin", role = "cph"))
person("Mathias", "Buus", role = c("aut", "cph"),
comment = "Author of bundled imjv library"),
person("Evgeny", "Poberezkin", role = c("aut", "cph"),
comment = "Author of bundled Ajv library"))
Maintainer: Rich FitzJohn <[email protected]>
Description: Uses the node library 'is-my-json-valid' or 'ajv' to
validate 'JSON' against a 'JSON' schema. Drafts 04, 06 and 07 of
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## jsonvalidate 1.3.2

* Always uses ES5 version of Ajv, which allows use in both current and "legacy" V8 (#51)

## jsonvalidate 1.3.0

* Upgrade to ajv version 8.5.0
Expand Down
30 changes: 30 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM ubuntu:18.04
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y \
dirmngr \
software-properties-common \
wget && \
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc && \
add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/" && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
gfortran \
liblapack-dev \
libblas-dev \
libcairo2-dev \
libcurl4-openssl-dev \
libfontconfig1-dev \
libssl-dev \
libv8-dev \
libxml2-dev \
r-base

RUN apt-get install -y --no-install-recommends locales && \
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \
locale-gen en_US.utf8 && \
/usr/sbin/update-locale LANG=en_US.UTF-8

ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8

RUN Rscript -e 'install.packages(c("jsonvalidate", "testthat"))'
76 changes: 76 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# docker/es5 support

This dockerfile exists to make it easier to test that things still work in an es5 environment, as that is still fairly common (notably Solaris, but also ubuntu 18.04 LTS and RHEL 7).

From the root directory of jsonvalidate source, run

```
docker build --tag richfitz/jsonvalidate:es5 docker
```

to build the image; this should not take that long. It installs the current r-release along with the CRAN versions of jsonvalidate and testthat (which ensures all core dependencies are present).

Once setup, you can bring up a container with:

```
docker run --rm -it -v $PWD:/src:ro richfitz/jsonvalidate:es5 bash
```

which mounts the current directory read-only into the container at `/src`. That version of the source (rather than the CRAN one installed in the base image) can be installed with `R CMD INSTALL /src`

To run the whole test suite run:

```
Rscript -e 'testthat::test_local("/src")'
```

More simply, to just confirm that the bundle is valid you can do

```
Rscript -e 'V8::new_context()$source("/src/inst/bundle.js")'
```

which will error if the bundle is invalid.

To do a full reverse dependencies check with old libv8, you can bring up R in this container:

```
docker run --rm -it -v $PWD:/src:ro richfitz/jsonvalidate:es5 bash
```

Then install revdepcheck itself

```
install.packages("remotes")
remotes::install_github("r-lib/revdepcheck", upgrade = TRUE)
```

Additional packages that we need, for some reason these did not get installed automatically though we'd have expected them to (see [this issue](https://github.com/r-lib/revdepcheck/issues/209))

```
install.packages(c(
"cinterpolate",
"deSolve",
"devtools",
"golem",
"inTextSummaryTable",
"patientProfilesVis",
"reticulate",
"rlist",
"shiny",
"shinyBS",
"shinydashboard",
"shinyjs",
"tableschema.r",
"xml2"))
```

At this point you will need to cycle the R session because the package DB will be corrupted by all the installations.

Finally we can run the reverse dependency check:

```
unlink("/tmp/src", recursive = TRUE)
file.copy("/src", "/tmp", recursive = TRUE)
revdepcheck::revdep_check("/tmp/src", num_workers = 4)
```
Loading

0 comments on commit 4d9f6dc

Please sign in to comment.