stan-dev / rstantools

Tools for Developing R Packages Interfacing with Stan
https://mc-stan.org/rstantools
GNU General Public License v3.0
51 stars 21 forks source link

configure files in packages made with rstan_create_package() produces a note when running R CMD check #82

Closed AngusMcLure closed 3 years ago

AngusMcLure commented 3 years ago

Minor issue, with an easy fix.

rstantools version: 2.1.1 R version: 4.0.3 Platform: OS X

When checking a package that I set up using rstan_create_package, I got a warning (new to R 4.0?) prompting me to add the checkbashisms script to my $PATH. I did this, resolving the warning, but producing a new NOTE:

checking top-level files ... NOTE
script configure does not appear to have a #! interpreter line

I eliminated the NOTE (both on my local OS X build and on win-builder) by making small changes to configure and conigure.win automatically generated by rstan_create_package. The default configure is:

# Generated by rstantools.  Do not edit by hand.

#! /bin/sh
"${R_HOME}/bin/Rscript" -e "rstantools::rstan_config()"

Noting, but disobeying the imperative not to edit, I reordered the first two lines so that the #! lines is at the top. i.e.:

#! /bin/sh
# Generated by rstantools.  Do not edit by hand.
"${R_HOME}/bin/Rscript" -e "rstantools::rstan_config()"

I did the same for configure.win

The package now passes devtools::check() and devtools::check_win_release()

jgabry commented 3 years ago

Thanks for letting us know about this and sharing the fix. Glad you were able to workaround it. The edit of reordering the first two lines seems fine to me, so I guess we should just go ahead and do that in rstantools. @bgoodri Is that fine by you too?

AngusMcLure commented 3 years ago

No problem. Thanks for all your work in building, developing and maintaining these tools.

bgoodri commented 3 years ago

Yeah, we can put the # Generated by rstantools ... thing on the second line to avoid the need for the checkbashisms script.

On Tue, Dec 1, 2020 at 6:41 PM Jonah Gabry notifications@github.com wrote:

Thanks for letting us know about this and sharing the fix. Glad you were able to workaround it. The edit of reordering the first two lines seems fine to me, so I guess we should just go ahead and do that in rstantools. @bgoodri https://github.com/bgoodri Is that fine by you too?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstantools/issues/82#issuecomment-736891225, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZ2XKSH3QIN4XQSQB2EQ43SSV5K5ANCNFSM4UJV2ZJA .