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

devtools' reference output for examples #1655

Closed
helix123 opened this issue Nov 11, 2017 · 8 comments
Closed

devtools' reference output for examples #1655

helix123 opened this issue Nov 11, 2017 · 8 comments

Comments

@helix123
Copy link
Contributor

@helix123 helix123 commented Nov 11, 2017

When I was about to use the examples' output (examples from .Rd files) as a reference output, I noticed that the reference output produced by devtools is different to what a plain R CMD check produces. Notably, the file pkg_name-Ex.Rout (to be stored at /tests/Examples/pkg_name-Ex.Rout.save) contains a bunch of line like these which are not in the same file generated by R CMD check:

base::assign(".ExTimings", "pkg_name-Ex.timings", pos = 'CheckExEnv')
base::cat("name\tuser\tsystem\telapsed\n", file=base::get(".ExTimings", pos = 'CheckExEnv'))
base::assign(".format_ptime",
+ function(x) {
+   if(!is.na(x[4L])) x[1L] <- x[1L] + x[4L]
+   if(!is.na(x[5L])) x[2L] <- x[2L] + x[5L]
+   options(OutDec = '.')
+   format(x[1L:3L], digits = 7L)
+ },
+ pos = 'CheckExEnv')

### * </HEADER>

...

base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
base::cat("data_name", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")

...

base::assign(".ptime", proc.time(), pos = "CheckExEnv")

Consequently when the file generated by devtool's check is used as reference output, a lot of differences are found.

I use devtools 1.13.4 (2017-11-09 CRAN (R 3.4.2)).

Here are some examples from the wild:
https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-debian-clang/VeryLargeIntegers-00check.html

https://github.com/igraph/rigraph_revdep_checks/blob/master/revdep_logs/BDgraph/BDgraph-Ex.Rout

@jimhester
Copy link
Member

@jimhester jimhester commented Feb 13, 2018

This behavior is likely changed in devel devtools, which uses the rcmdcheck package to run R CMD check. If it is not fixed I would encourage you to open this issue in that repository.

@helix123
Copy link
Contributor Author

@helix123 helix123 commented Jun 16, 2018

Yes, still present. Raised an issue for rcmdcheck.

@gaborcsardi
Copy link
Contributor

@gaborcsardi gaborcsardi commented Sep 6, 2018

So, this is actually a devtools issue, because devtools always uses --timings, so maybe it needs an argument to make this optional?

args <- c("--timings", args)

@gaborcsardi gaborcsardi reopened this Sep 6, 2018
@jimhester
Copy link
Member

@jimhester jimhester commented Sep 6, 2018

Seems like we should hoist the "--timings" to the default for args, so you can turn it off if desired.

@gaborcsardi
Copy link
Contributor

@gaborcsardi gaborcsardi commented Sep 6, 2018

Yeah, that's good, too.

@jimhester jimhester closed this in b1ea984 Sep 6, 2018
@jimhester
Copy link
Member

@jimhester jimhester commented Sep 6, 2018

Ok if you check with devtools::check(args = NULL) this should now turn off the timings.

@gaborcsardi
Copy link
Contributor

@gaborcsardi gaborcsardi commented Sep 6, 2018

And you also need cran = FALSE, because --as-cran also turns on the timings.

AmundsenJunior added a commit to AmundsenJunior/devtools that referenced this issue Sep 11, 2018
So it can be turned off if desired

Fixes r-lib#1655
@lock
Copy link

@lock lock bot commented Mar 5, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Mar 5, 2019
HughParsonage added a commit to HughParsonage/devtools that referenced this issue Jul 2, 2019
So it can be turned off if desired

Fixes r-lib#1655
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants