R version 4.2.2: devtools::build_manual() fails

Hi, I posted my problem with the devtools::build_manual() command already a while ago; cf. R 4.2.0: devtools::build_manual() fails. Unfortunately, the problem (which was not there for me in the past) persists. Here's my reprex (remark: running devtools::check() beforehand indicated everything to be fine with my R package). Would anyone have any suggestions for me, please? Many thanks.

devtools::build_manual()
#> Error in `package_file()`:
#> ! Could not find package root.
#> ℹ Is '.' inside a package?

#> Backtrace:
#>     ▆
#>  1. └─devtools::build_manual()
#>  2.   └─devtools::as.package(pkg)
#>  3.     └─devtools::package_file(path = x)
#>  4.       └─cli::cli_abort(c("Could not find package root.", i = "Is {.path {base_path}} inside a package?"))
#>  5.         └─rlang::abort(...)

Created on 2022-12-02 with reprex v2.0.2

You need to show us a reproducible example, e.g. your package that fails if it is open source.

Hmmmh, I am confused, sorry. How could I possibly make my test package "myTestPackage", which contains a single function (and works perfectly fine), available to you? Post all the source files, DESCRIPTION, NAMESPACE and functions.R, here in this forum? Any help appreciated. Many thanks.

You can put it in a public GitHub or GitLab repository. You can also create a .tar.gz or .zip file for it and upload it to any file sharing service. Or you could write an R script that creates it and share the script here.

As a followup to Gabor's post. Two good file sharing services are mediafire and dropbox (much more than just a file sharing service).

I had a similar problem and wanted to share my solution in case I can save anyone time. I was getting the exact same error as in this post when running devtools::build_manual(). Running the following line fixed the issue:

tinytex::tlmgr_install("makeindex")

Details and Example
I could reproduce the error with the following steps. I am on Ubuntu 20.04 LTS and had this error with several versions of R including 3.6.3 and 4.2.2.

  1. Install base R as suggested on CRAN
  2. Install RStudio from .deb file
  3. Create new project in RStudio, select new package, and modify the default hello.R function to include some Roxygen comments.
  4. Install devtools (this took a while because the install kept failing because of missing ubuntu dependencies, just install them all as needed. Includes but not limited to: libssl-dev, libcurl4-openssl-dev, libfontconfig1-dev, etc)
  5. Run devtools:build_manual(), and I get the error that "Failed to build manual", Error in value[3L].

This took a long while to fix because the error message was not informative. devtools::check(), build(), and document() all worked fine. devtools::check_man() returned "No issues detected". I installed tinytex and made sure tinytex::is_tinytex() returned TRUE. I could not find any informative errors anywhere.

Eventually I noticed that Sys.which("makeindex") returned only "". That is when I tried tinytex::tlmgr_install("makeindex"), and after running that, the build_manual() succeeds.

1 Like

This topic was automatically closed after 45 days. New replies are no longer allowed.


If you have a query related to it or one of the replies, start a new topic and refer back with a link.