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

[Bug]: R CMD CHECK failure #1116

Closed
3 tasks done
pawelru opened this issue Apr 12, 2024 · 3 comments · Fixed by #1117
Closed
3 tasks done

[Bug]: R CMD CHECK failure #1116

pawelru opened this issue Apr 12, 2024 · 3 comments · Fixed by #1117
Assignees
Labels
bug Something isn't working core

Comments

@pawelru
Copy link
Contributor

pawelru commented Apr 12, 2024

What happened?

This is observed in GRAN CI as well as locally running rcmdcheck::rcmdcheck()

* checking running R code from vignettes ...
  ‘generate_tmc_test_data.Rmd’ using ‘UTF-8’... OK
  ‘quickstart_substitute.Rmd’ using ‘UTF-8’... failed
  ‘teal-modules-clinical.Rmd’ using ‘UTF-8’... OK
 ERROR
Errors in running code in vignettes:
when running code in ‘quickstart_substitute.Rmd’
  ...
+     b)

> non_evaluated_expression
a + b

> eval(non_evaluated_expression)

  When sourcing ‘quickstart_substitute.R’:
Error: object 'a' not found
Execution halted

sessionInfo()

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines.

Security Policy

  • I agree to follow this project's Security Policy.
@pawelru pawelru added the bug Something isn't working label Apr 12, 2024
@donyunardi
Copy link
Contributor

I mentioned this particular one here:
#983 (comment)

I'll take a look.

@donyunardi donyunardi self-assigned this Apr 12, 2024
@donyunardi
Copy link
Contributor

donyunardi commented Apr 12, 2024

The code chunk in question is intentionally designed to produce an error, so the author has set error = TRUE for that chunk.

```{r, error = TRUE}
non_evaluated_expression <- substitute(expr = a + b)
non_evaluated_expression
eval(non_evaluated_expression)
```

However, it appears that knitr 1.46 does not recognize the error = TRUE chunk option in the quickstart_substitute.Rmd vignette and still returns the evaluation as an error.

If I revert knitr back to version 1.45, rcmdcheck passed.

Full log
r$> rcmdcheck::rcmdcheck()
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────────────────────
✔  checking for file.../DESCRIPTION’ (423ms)
─  preparingteal.modules.clinical: (1.3s)
✔  checking DESCRIPTION meta-information ...installing the package to build vignettes (629ms)
✔  creating vignettes (39.4s)
─  checking for LF line-endings in source and make files and shell scripts (603ms)
─  checking for empty or unneeded directoriesbuildingteal.modules.clinical_0.9.0.9017.tar.gz’
   
── R CMD check ─────────────────────────────────────────────────────────────────────────────────────────────────────────
─  using log directory/private/var/folders/2q/3msvdr052rbctgldyf85xy240000gp/T/RtmpUgogsi/file156aa71c59dc8/teal.modules.clinical.Rcheck’ (678ms)
─  using R version 4.3.3 (2024-02-29)
─  using platform: x86_64-apple-darwin20 (64-bit)
─  R was compiled by
       Apple clang version 14.0.0 (clang-1400.0.29.202)
       GNU Fortran (GCC) 12.2.0running under: macOS Ventura 13.6.3using session charset: UTF-8checking for fileteal.modules.clinical/DESCRIPTION’ (1.2s)
─  this is packageteal.modules.clinicalversion0.9.0.9017’
─  package encoding: UTF-8checking package namespace information ...checking package dependencies (3.7s)
✔  checking if this is a source package ...checking if there is a namespacechecking for executable files (4.5s)
✔  checking for hidden files and directories ...checking for portable file names ...checking for sufficient/correct file permissions ...checking whether packageteal.modules.clinicalcan be installed (30.7s)
✔  checking installed package size ...checking package directorycheckingbuilddirectory ...checking DESCRIPTION meta-information (549ms)
✔  checking top-level fileschecking for left-over fileschecking index information (441ms)
✔  checking package subdirectories (818ms)
✔  checking R files for non-ASCII characters ...checking R files for syntax errors ...checking whether the package can be loaded (3.3s)
✔  checking whether the package can be loaded with stated dependencies (3.2s)
✔  checking whether the package can be unloaded cleanly (4.3s)
✔  checking whether the namespace can be loaded with stated dependencies (4.6s)
✔  checking whether the namespace can be unloaded cleanly (4.8s)
✔  checking startup messages can be suppressed (9.4s)
✔  checking dependencies in R code (6.8s)
✔  checking S3 generic/method consistency (5.1s)
✔  checking replacement functions (6.3s)
✔  checking foreign function calls (11.5s)
✔  checking R code for possible problems (35s)
✔  checking Rd files (2.2s)
✔  checking Rd metadata ...checking Rd cross-references (957ms)
✔  checking for missing documentation entries (4.8s)
✔  checking for code/documentation mismatches (15.2s)
✔  checking Rd \usage sections (6.5s)
✔  checking Rd contents (948ms)
✔  checking for unstated dependencies in examples (1.1s)
✔  checking contents ofdatadirectory ...checking data for non-ASCII characters (806ms)
✔  checking LazyDatachecking data for ASCII and uncompressed saves (458ms)
✔  checking installed files frominst/doc...checking files invignettes...checking examples (15.4s)
✔  checking for unstated dependencies intests...checking tests (437ms)
✔  Runningtestthat.R’ (15.8s)
✔  checking for unstated dependencies in vignettes (617ms)
✔  checking package vignettes ininst/doc...checking running R code from vignettesgenerate_tmc_test_data.RmdusingUTF-8... OKquickstart_substitute.RmdusingUTF-8... OKteal-modules-clinical.RmdusingUTF-8... OK
    NONEchecking re-building of vignette outputs (17.8s)
✔  checking PDF version of manual (18s)
   
   
── R CMD check results ─────────────────────────────────────────────────────────── teal.modules.clinical 0.9.0.9017 ────
Duration: 4m 3.1s

0 errors| 0 warnings| 0 notesr$> packageVersion("knitr")
[1] ‘1.45

@shajoezhu @pawelru do you get the same behavior?
If so, we should log a bug in knitr.

In the meantime, we can ignore this Rmd during build (add to .Rbuildignore).
What do you guys think?

@pawelru
Copy link
Contributor Author

pawelru commented Apr 15, 2024

I'm far from calling this a knitr error but I think I have seen something similar already in teal.data -> insightsengineering/teal.data#307

Just submitted a PR. Please check it out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants