ropensci / jsonvalidate

:heavy_check_mark::interrobang: Validate JSON
https://docs.ropensci.org/jsonvalidate
Other
49 stars 14 forks source link

Latest CRAN headaches #51

Closed richfitz closed 3 years ago

richfitz commented 3 years ago

Solaris has an ancient version of V8 (of course) so try forcing ES5 in the generated schemas.

The builder for r-devel-linux-x86_64-fedora-clang segfaults (!) which is surprising given we contain no compiled code. It's possible that the ES5 change will fix it (see trace below from r-hub) but we can't replicate the segfault anywhere. Most likely it is due to a certain professor creating an overly complicated installation of V8 (see https://www.stats.ox.ac.uk/pub/bdr/Rconfig/r-devel-linux-x86_64-fedora-clang which has a very low chance of being recreated anywhere outside that machine).

Details ``` > rhub::check("jsonvalidate_1.3.1.tar.gz", platform = "fedora-clang-devel") ─ Uploading package ─ Preparing build, see status at https://builder.r-hub.io/status/jsonvalidate_1.3.1.tar.gz-3d8c3523dc6c4225a768e3eeab08ba48 -^C ─ Build started ─ Downloading and unpacking package file ─ Querying system requirements ─ Installing system requirements ─ Starting Docker container ─ Querying package dependencies ─ Installing package dependencies ─ Running R CMD check About to run xvfb-run R CMD check jsonvalidate_1.3.1.tar.gz Error : Bioconductor does not yet build and check packages for R version 4.2; see https://bioconductor.org/install ─ using log directory ‘/home/docker/jsonvalidate.Rcheck’ ─ using R Under development (unstable) (2021-10-18 r81073) ─ using platform: x86_64-pc-linux-gnu (64-bit) ─ using session charset: UTF-8 ✔ checking for file ‘jsonvalidate/DESCRIPTION’ ─ this is package ‘jsonvalidate’ version ‘1.3.1’ ─ package encoding: UTF-8 ✔ checking package namespace information ✔ checking package dependencies ✔ checking if this is a source package ✔ checking if there is a namespace ✔ checking for executable files ✔ checking for hidden files and directories ✔ checking for portable file names ✔ checking for sufficient/correct file permissions ✔ checking whether package ‘jsonvalidate’ can be installed ✔ checking installed package size (9.3s) ✔ checking package directory ✔ checking ‘build’ directory ✔ checking DESCRIPTION meta-information ✔ checking top-level files ✔ checking for left-over files ✔ checking index information ✔ checking package subdirectories ✔ checking R files for non-ASCII characters ✔ checking R files for syntax errors ✔ checking whether the package can be loaded ✔ checking whether the package can be loaded with stated dependencies ✔ checking whether the package can be unloaded cleanly ✔ checking whether the namespace can be loaded with stated dependencies ✔ checking whether the namespace can be unloaded cleanly ✔ checking loading without being on the library search path ✔ checking dependencies in R code ✔ checking S3 generic/method consistency ✔ checking replacement functions ✔ checking foreign function calls ✔ checking R code for possible problems ✔ checking Rd files ✔ checking Rd metadata ✔ checking Rd cross-references ✔ checking for missing documentation entries ✔ checking for code/documentation mismatches ✔ checking Rd \usage sections ✔ checking Rd contents ✔ checking for unstated dependencies in examples ✔ checking installed files from ‘inst/doc’ ✔ checking files in ‘vignettes’ E checking examples (9.2s) Running examples in ‘jsonvalidate-Ex.R’ failed The error most likely occurred in: > ### Name: json_validate > ### Title: Validate a json file > ### Aliases: json_validate > > ### ** Examples > > # A simple schema example: > schema <- '{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Product", + "description": "A product from Acme\'s catalog", + "type": "object", + "properties": { + "id": { + "description": "The unique identifier for a product", + "type": "integer" + }, + "name": { + "description": "Name of the product", + "type": "string" + }, + "price": { + "type": "number", + "minimum": 0, + "exclusiveMinimum": true + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1, + "uniqueItems": true + } + }, + "required": ["id", "name", "price"] + }' > > # Test if some (invalid) json conforms to the schema > jsonvalidate::json_validate("{}", schema, verbose = TRUE) Error in context_eval(join(src), private$context, serialize) : SyntaxError: Use of const in strict mode. Calls: ... -> evaluate_js -> get_str_output -> context_eval Execution halted ✔ checking for unstated dependencies in ‘tests’ ─ checking tests E Running ‘testthat.R’ Running the tests in ‘tests/testthat.R’ failed. Last 13 lines of output: 2. │ └─testthat:::expect_condition_matching(...) 3. │ └─testthat:::quasi_capture(...) 4. │ ├─testthat:::.capture(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo)) 7. └─jsonvalidate::json_validator(schema, engine = "ajv") 8. └─jsonvalidate:::jsonvalidate_js() 9. └─ct$source(system.file("bundle.js", package = "jsonvalidate")) 10. └─V8:::evaluate_js(readLines(file, encoding = "UTF-8", warn = FALSE)) 11. ├─V8:::get_str_output(...) 12. └─V8:::context_eval(join(src), private$context, serialize) [ FAIL 32 | WARN 0 | SKIP 0 | PASS 30 ] Error: Test failures Execution halted ✔ checking for unstated dependencies in vignettes ✔ checking package vignettes in ‘inst/doc’ ─ checking running R code from vignettes ‘jsonvalidate.Rmd’ using ‘UTF-8’... OK NONE W checking re-building of vignette outputs Error(s) in re-building vignettes: ... --- re-building ‘jsonvalidate.Rmd’ using rmarkdown Quitting from lines 121-122 (jsonvalidate.Rmd) Error: processing vignette 'jsonvalidate.Rmd' failed with diagnostics: SyntaxError: Use of const in strict mode. --- failed re-building ‘jsonvalidate.Rmd’ SUMMARY: processing the following file failed: ‘jsonvalidate.Rmd’ Error: Vignette re-building failed. Execution halted ✔ checking PDF version of manual ─ Done with R CMD check ─ Saving artifacts ```