Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address CRAN package check macOS issues #10

Closed
riccardoporreca opened this issue Feb 25, 2020 · 1 comment · Fixed by #11
Closed

Address CRAN package check macOS issues #10

riccardoporreca opened this issue Feb 25, 2020 · 1 comment · Fixed by #11
Assignees

Comments

@riccardoporreca
Copy link
Member

riccardoporreca commented Feb 25, 2020

Before submitting a new version of rTRNG to CRAN, we should address the macOS errors on the CRAN package check page.

In particular, the following issues are reported

Some tests are failing on macOS

══ testthat results ═══════════════════════════════════════════════════════════
[ OK: 581 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 30 ]
1. Failure: $split errors for out-of-range subsequence indices (@test-TRNG.Engine.R#264)
...

In fact we have exactly 30 warnings when running tests in Ubuntu for the same test reported here

test-TRNG.Engine.R:264: warning: $split errors for out-of-range subsequence indices
`e$split(p, 0L)` generated an S3 error and you are testing the error message.
* The error has class = c("std::invalid_argument", "C++Error", "error", "condition")
* Testing with `class` is more robust than testing with `regexp`.
* Do you want `expect_error(..., class = "std::invalid_argument")`?

Most likely this is detected as a failure under macOS, and fixing the expectation as hinted in the warning message might solve the issue.

Re-building the vignettes fails on macOS (and Solaris)

This happens for C++ code chunks using sourceCpp()

Library not loaded: rTRNG.so
@riccardoporreca riccardoporreca self-assigned this Feb 25, 2020
riccardoporreca added a commit that referenced this issue Mar 3, 2020
* Use matrix expansion instead of explicit matrix of jobs.
riccardoporreca added a commit that referenced this issue Mar 3, 2020
* New exported function `try`ing a minimal `sourceCpp()`.
* Should fix macOS check issues (re)building the vignettes (#10).
@riccardoporreca
Copy link
Member Author

riccardoporreca commented Mar 3, 2020

  • Making sure no warnings are triggered by the unit tests committed with e4ac407

  • MacOS checks enabled on TravisCI with e529adf, revealing the issues with building vignettes

  • Issues with building / linking against rTRNG in C++ code chunks (and similarly in packages) addressed by conditionally evaluating them based on a check for a minimal sourceCpp() example => d9e24dd fixes the issues macOS issues on Travis. The general approach is to keep this optional and document it properly.

riccardoporreca added a commit that referenced this issue Mar 3, 2020
and how to use `check_rTRNG_linking()` in general to explicitly check.
riccardoporreca added a commit that referenced this issue Mar 3, 2020
This was referenced Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant