Skip to content

Instantly share code, notes, and snippets.

@bschilder
Last active August 28, 2022 21:21
Show Gist options
  • Save bschilder/af3960b7d7b911274198e3febae535a9 to your computer and use it in GitHub Desktop.
Save bschilder/af3960b7d7b911274198e3febae535a9 to your computer and use it in GitHub Desktop.
`devtools::build_man`

devtools::build_man

devtools::build_manual()
Error in `value[[3L]]()`:
! Failed to build manual
Run `rlang::last_error()` to see where the error occurred.

This seems to occur on:

  • MacOS
  • Linux Docker container

devtools has a recurring issues that the developer don't seem to be offering a solution to:

r-lib/devtools#2289

Found this suggestion, but caused another set of problems in itself:

tinytex::tlmgr_install("makeindex")
tlmgr install makeindex
You don't have permission to change the installation in any way,
specifically, the directory /usr/local/texlive/2022basic/tlpkg/ is not writable.
Please run this program as administrator, or contact your local admin.
tlmgr: An error has occurred. See above messages. Exiting.
tlmgr install makeindex
You don't have permission to change the installation in any way,
specifically, the directory /usr/local/texlive/2022basic/tlpkg/ is not writable.
Please run this program as administrator, or contact your local admin.
tlmgr: An error has occurred. See above messages. Exiting.

Ok, so let's make this directory and all of its contents writeable:

sudo chmod -R u=rwx,go=rwx /usr/local/texlive/2022basic/tlpkg/

Cool, a new error. Looks like tlmgr needs to be updated.

tlmgr install makeindex
===============================================================================
tlmgr itself needs to be updated.
Please do this via either
  tlmgr update --self
or by getting the latest updater for Unix-ish systems:
  https://mirror.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.sh
and/or Windows systems:
  https://mirror.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.exe
Then continue with other updates as usual.
===============================================================================
tlmgr: Terminating; please see warning above!
tlmgr: package repository https://mirror.ox.ac.uk/sites/ctan.org/systems/texlive/tlnet (not verified: gpg unavailable)
tlmgr install makeindex
===============================================================================
tlmgr itself needs to be updated.
Please do this via either
  tlmgr update --self
or by getting the latest updater for Unix-ish systems:
  https://mirror.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.sh
and/or Windows systems:
  https://mirror.ctan.org/systems/texlive/tlnet/update-tlmgr-latest.exe
Then continue with other updates as usual.
===============================================================================
tlmgr: Terminating; please see warning above!
tlmgr: package repository https://anorien.csc.warwick.ac.uk/mirrors/CTAN/systems/texlive/tlnet (not verified: gpg unavailable)

Tried to update tlmgr, but this just caused more errors:

tlmgr update --self

tlmgr: package repository https://mirror.apps.cam.ac.uk/pub/tex-archive/systems/texlive/tlnet (not verified: gpg unavailable)
tlmgr: saving backups to /usr/local/texlive/2022basic/tlpkg/backups
[1/2, ??:??/??:??] update: texlive.infra [343k] (62297 -> 63645) ... LICENSE.CTAN: Can't unlink already-existing object
LICENSE.TL: Can't unlink already-existing object
release-texlive.txt: Can't unlink already-existing object
texmf-dist/scripts/texlive/mktexlsr: Can't unlink already-existing object
texmf-dist/scripts/texlive/tl-errmess.vbs: Can't unlink already-existing object
texmf-dist/scripts/texlive/tlmgr.pl: Can't unlink already-existing object
texmf-dist/scripts/texlive/tlmgrgui.pl: Can't unlink already-existing object
texmf-dist/scripts/texlive/uninstall-win32.pl: Can't unlink already-existing object
texmf-dist/scripts/texlive/uninstq.vbs: Can't unlink already-existing object
texmf-dist/web2c/fmtutil-hdr.cnf: Can't unlink already-existing object
texmf-dist/web2c/updmap-hdr.cfg: Can't unlink already-existing object
tar: Error exit delayed from previous errors.
TLUtils::untar: tar xf /var/folders/zq/h7mtybc533b1qzkys_ttgpth0000gn/T/wLo2jph8rE/33SfXVZgjP/texlive.infra.tar failed (in /usr/local/texlive/2022basic)
TLPDB::_install_data: untar failed for https://mirror.apps.cam.ac.uk/pub/tex-archive/systems/texlive/tlnet/archive/texlive.infra.tar.xz
tlmgr: Installation of new version of texlive.infra failed, trying to unwind.
LICENSE.CTAN: Can't unlink already-existing object
LICENSE.TL: Can't unlink already-existing object
release-texlive.txt: Can't unlink already-existing object
texmf-dist/scripts/texlive/mktexlsr: Can't unlink already-existing object
texmf-dist/scripts/texlive/tl-errmess.vbs: Can't unlink already-existing object
texmf-dist/scripts/texlive/tlmgr.pl: Can't unlink already-existing object
texmf-dist/scripts/texlive/tlmgrgui.pl: Can't unlink already-existing object
texmf-dist/scripts/texlive/uninstall-win32.pl: Can't unlink already-existing object
texmf-dist/scripts/texlive/uninstq.vbs: Can't unlink already-existing object
texmf-dist/web2c/fmtutil-hdr.cnf: Can't unlink already-existing object
texmf-dist/web2c/updmap-hdr.cfg: Can't unlink already-existing object
tar: Error exit delayed from previous errors.
TLUtils::untar: tar xf /var/folders/zq/h7mtybc533b1qzkys_ttgpth0000gn/T/wLo2jph8rE/TpcGGN8M2F/texlive.infra.r62297.tar failed (in /usr/local/texlive/2022basic)
tlmgr: Restoring of old package did NOT succeed.
tlmgr: Error message from unpack: untar failed
tlmgr: Most likely repair: run tlmgr install texlive.infra and hope.
done
[2/2, 00:00/00:00] update: texlive.infra.universal-darwin [302k] (61925 -> 62358) ... bin/universal-darwin/mktexlsr: Could not remove symlink bin/universal-darwin/mktexlsr
bin/universal-darwin/tlmgr: Could not remove symlink bin/universal-darwin/tlmgr
tar: Error exit delayed from previous errors.
TLUtils::untar: tar xf /var/folders/zq/h7mtybc533b1qzkys_ttgpth0000gn/T/wLo2jph8rE/kQg9T_3hn1/texlive.infra.universal-darwin.tar failed (in /usr/local/texlive/2022basic)
TLPDB::_install_data: untar failed for https://mirror.apps.cam.ac.uk/pub/tex-archive/systems/texlive/tlnet/archive/texlive.infra.universal-darwin.tar.xz
tlmgr: Installation of new version of texlive.infra.universal-darwin failed, trying to unwind.
bin/universal-darwin/mktexlsr: Could not remove symlink bin/universal-darwin/mktexlsr
bin/universal-darwin/tlmgr: Could not remove symlink bin/universal-darwin/tlmgr
tar: Error exit delayed from previous errors.
TLUtils::untar: tar xf /var/folders/zq/h7mtybc533b1qzkys_ttgpth0000gn/T/wLo2jph8rE/Ts5JCCKtaH/texlive.infra.universal-darwin.r61925.tar failed (in /usr/local/texlive/2022basic)
tlmgr: Restoring of old package did NOT succeed.
tlmgr: Error message from unpack: untar failed
tlmgr: Most likely repair: run tlmgr install texlive.infra.universal-darwin and hope.
done
tlmgr: The file README has disappeared from the critical package texlive.infra but is still present in dehyph:texmf-dist/tex/generic/dehyph/README dvipdfmx:texmf-dist/fonts/cmap/dvipdfmx/README koma-script:texmf-dist/doc/latex/koma-script/README mfware:texmf-dist/mft/base/README texlive-msg-translations:tlpkg/translations/README texlive-scripts:texmf-dist/fonts/map/dvips/tetex/README
tlmgr: action update returned an error; continuing.
tlmgr: An error has occurred. See above messages. Exiting.

Let's try upgrading again but with root permissions:

sudo tlmgr update --self
tlmgr: package repository https://mirror.ox.ac.uk/sites/ctan.org/systems/texlive/tlnet (not verified: gpg unavailable)
tlmgr: saving backups to /usr/local/texlive/2022basic/tlpkg/backups
[1/2, ??:??/??:??] update: texlive.infra [343k] (62297 -> 63645) ... done
[2/2, 00:00/00:00] update: texlive.infra.universal-darwin [302k] (61925 -> 62358) ... done
running mktexlsr ...
done running mktexlsr.
tlmgr: package log updated: /usr/local/texlive/2022basic/texmf-var/web2c/tlmgr.log
tlmgr: command log updated: /usr/local/texlive/2022basic/texmf-var/web2c/tlmgr-commands.log

This produces less messages, but ultimately can't do the job due to something about gpg unavailable

Solution

A Google Search for brew install tlmgr brings up texlive. Why not, let's try it.

Takes a while to install all its deps (hopefully one of them will fulfill the requirements):

brew install texlive

Shockingly, this seems to have done it!!!! Sucess!!

devtools::build_manual()
....
.... <very long output>
....
Output written on Rd2.pdf (16 pages, 134921 bytes).
Transcript written on Rd2.log.
Saving output to ‘/Users/schilder/Desktop/echoverse/echolocatoR_2.0.0.pdf’ ...
Done

Session info

R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Monterey 12.4

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] echodata_0.99.12  data.table_1.14.2

loaded via a namespace (and not attached):
 [1] zip_2.2.0         Rcpp_1.0.9        pillar_1.8.1      compiler_4.2.1    tools_4.2.1      
 [6] digest_0.6.29     pkgload_1.3.0     memoise_2.0.1     lifecycle_1.0.1   tibble_3.1.8     
[11] pkgconfig_2.0.3   rlang_1.0.4       openxlsx_4.2.5    DBI_1.1.3         cli_3.3.0        
[16] rstudioapi_0.14   parallel_4.2.1    fastmap_1.1.0     stringr_1.4.1     dplyr_1.0.9      
[21] httr_1.4.4        generics_0.1.3    vctrs_0.4.1       htmlwidgets_1.5.4 hms_1.1.2        
[26] DT_0.24           tidyselect_1.1.2  glue_1.6.2        R6_2.5.1          fansi_1.0.3      
[31] piggyback_0.1.4   tidyr_1.2.0       tzdb_0.3.0        purrr_0.3.4       readr_2.1.2      
[36] magrittr_2.0.3    ellipsis_0.3.2    htmltools_0.5.3   assertthat_0.2.1  utf8_1.2.2       
[41] stringi_1.7.8     cachem_1.0.6     
@bschilder
Copy link
Author

Some photographic proof this actually worked:

Screenshot 2022-08-28 at 22 11 39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment