-
Notifications
You must be signed in to change notification settings - Fork 763
Closed
Description
Running devtools::check() on a project that uses Rcpp fails if the NAMESPACE file does not exist:
> devtools::check()
Updating wsim.lsm documentation
Loading wsim.lsm
Error in Rcpp::compileAttributes() :
pkgdir must refer to the directory containing an R package
To generate the NAMESPACE file, I need to run devtools::document(). But this also invokes Rcpp, which in turn fails because the NAMESPACE file does not exist:
> devtools::document()
Updating wsim.lsm documentation
Loading wsim.lsm
Error in Rcpp::compileAttributes() :
pkgdir must refer to the directory containing an R package
It's not enough to run touch NAMESPACE before build, because Roxygen2 will only replace a NAMESPACE file that it generated. For now, I papered this over with a hackish Makefile:
NAMESPACE:
echo "# Generated by roxygen2: do not edit by hand" > NAMESPACE
check: NAMESPACE
Rscript -e "devtools::check()"
But I wonder if devtools could take care of this somehow? Since NAMESPACE is autogenerated by Roxygen2, I don't want to commit it to the repository.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels