Error installing Rcpp from Posit Package Manager

I'm not sure if this is a Posit Package Manager issue or an renv issue, but when I try to install Rcpp using renv 1.1.4 on MacOS, it is attempting to install Rcpp 1.3 instead of 1.0.14, and then errors with ERROR: a 'NAMESPACE' file is required. While renv::install('Rcpp') errors out, I can get a successful installation with renv::install('Rcpp@1.0.14').

The version numbers for Rcpp on Posit Package Manager look odd, where I see 1.3 as an archived version, but the latest version number appears lower at 1.0.14. I don't see version 1.3 when I look at the CRAN archive here: Index of /src/contrib/Archive/Rcpp. Maybe this is the source of the issue.

> renv::install('Rcpp')
# Downloading packages -------------------------------------------------------
- Downloading Rcpp from CRAN ...                OK [file is up to date]
Successfully downloaded 1 package in 41 milliseconds.

The following package(s) will be installed:
- Rcpp [1.3]
These packages will be installed into "~/Downloads/temp/test-rmysql/renv/library/macos/R-4.4/aarch64-apple-darwin20".

Do you want to proceed? [Y/n]: Y

# Installing packages --------------------------------------------------------
- Installing Rcpp ...                           FAILED
Error: Error installing package 'Rcpp':
================================

* installing *source* package ‘Rcpp’ ...
** using staged installation
checking for C++ compiler default output... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ -arch arm64 -std=gnu++17 accepts -g... yes
rm: conftest.dSYM: is a directory
checking how to run the C++ preprocessor... clang++ -arch arm64 -std=gnu++17 -E
Building MyLib in inst/lib...
clang++ -arch arm64 -std=gnu++17 -falign-functions=64 -Wall -g -O2 -I/opt/R/arm64/include -I/opt/homebrew/include -I../inst/lib  -c -o Adder.o Adder.cpp
clang++ -arch arm64 -std=gnu++17 -falign-functions=64 -Wall -g -O2 -I/opt/R/arm64/include -I/opt/homebrew/include -I../inst/lib  -c -o Multiplier.o Multiplier.cpp
ar r libMyLib.a Adder.o Multiplier.o
ar: creating archive libMyLib.a
ranlib libMyLib.a
Copying source files to inst/doc...
configure: creating ./config.status
config.status: creating src/Makevars
ERROR: a 'NAMESPACE' file is required
* removing ‘/Users/lmendelowitz/Downloads/temp/test-rmysql/renv/staging/1/Rcpp’
install of package 'Rcpp' failed [error code 1]
Traceback (most recent calls last):
12: renv::install("Rcpp")
11: renv_install_impl(records) at install.R#250
10: if (staged)
      renv_install_staged(records)
    else
      renv_install_default(records) at install.R#294
 9: renv_install_default(records) at install.R#314
 8: handler(package, renv_install_package(record)) at install.R#417
 7: handler(package, renv_install_package(record)) at install.R#417
 6: withCallingHandlers(
      renv_install_package_impl(record),
      error = function(e) writef("FAILED")
    ) at install.R#450
 5: withCallingHandlers(
      renv_install_package_impl(record),
      error = function(e) writef("FAILED")
    ) at install.R#450
 4: if (copyable)
      renv_file_copy(path, installpath, overwrite = TRUE)
    else
      r_cmd_install(package, path) at install.R#661
 3: if (!identical(status, 0L))
      r_exec_error(package, output, "install", status) at r.R#234
 2: abort(all) at r.R#52
 1: stop(fallback) at abort.R#44
> sessionInfo()
R version 4.4.3 (2025-02-28)
Platform: aarch64-apple-darwin20
Running under: macOS Sequoia 15.5

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

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

time zone: America/New_York
tzcode source: internal

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

loaded via a namespace (and not attached):
[1] compiler_4.4.3 tools_4.4.3    renv_1.1.3
> options('repos')
$repos
                                         CRAN
"https://packagemanager.posit.co/cran/latest"
> renv::diagnostics()
Diagnostics Report [renv 1.1.3]
===============================


# Session Info ---------------------------------------------------------------
R version 4.4.3 (2025-02-28)
Platform: aarch64-apple-darwin20
Running under: macOS Sequoia 15.5

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

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

time zone: America/New_York
tzcode source: internal

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

loaded via a namespace (and not attached):
[1] compiler_4.4.3 tools_4.4.3    renv_1.1.3

# Project --------------------------------------------------------------------
Project path: "~/Downloads/temp/test-rmysql"

# Status ---------------------------------------------------------------------
No issues found -- the project is in a consistent state.

# Packages -------------------------------------------------------------------
           Library Source Lockfile Source Path Dependency
KernSmooth 2.23-26   CRAN     <NA>   <NA>  [2]       <NA>
MASS        7.3-64   CRAN     <NA>   <NA>  [2]       <NA>
Matrix       1.7-2   CRAN     <NA>   <NA>  [2]       <NA>
Rcpp        1.0.14   RSPM     <NA>   <NA>  [1]       <NA>
boot        1.3-31   CRAN     <NA>   <NA>  [2]       <NA>
class       7.3-23   CRAN     <NA>   <NA>  [2]       <NA>
cluster      2.1.8   CRAN     <NA>   <NA>  [2]       <NA>
codetools   0.2-20   CRAN     <NA>   <NA>  [2]       <NA>
foreign     0.8-88   CRAN     <NA>   <NA>  [2]       <NA>
lattice     0.22-6   CRAN     <NA>   <NA>  [2]       <NA>
mgcv         1.9-1   CRAN     <NA>   <NA>  [2]       <NA>
nlme       3.1-167   CRAN     <NA>   <NA>  [2]       <NA>
nnet        7.3-20   CRAN     <NA>   <NA>  [2]       <NA>
renv         1.1.3   RSPM    1.1.3   RSPM  [1]     direct
rpart       4.1.24   CRAN     <NA>   <NA>  [2]       <NA>
spatial     7.3-18   CRAN     <NA>   <NA>  [2]       <NA>
survival     3.8-3   CRAN     <NA>   <NA>  [2]       <NA>
utils         <NA>   <NA>     <NA>   <NA>  [2]   indirect

[1]: /Users/lmendelowitz/Downloads/temp/test-rmysql/renv/library/macos/R-4.4/aarch64-apple-darwin20
[2]: /Users/lmendelowitz/Library/Caches/org.R-project.R/R/renv/sandbox/macos/R-4.4/aarch64-apple-darwin20/f7156815


# ABI ------------------------------------------------------------------------
- No ABI problems were detected in the set of installed packages.

# User Profile ---------------------------------------------------------------
[1] Source  Package Require Version Dev
<0 rows> (or 0-length row.names)

# Settings -------------------------------------------------------------------
List of 13
 $ bioconductor.version     : NULL
 $ external.libraries       : chr(0)
 $ ignored.packages         : chr(0)
 $ package.dependency.fields: chr [1:3] "Imports" "Depends" "LinkingTo"
 $ ppm.enabled              : NULL
 $ ppm.ignored.urls         : chr(0)
 $ r.version                : NULL
 $ snapshot.type            : chr "implicit"
 $ use.cache                : logi TRUE
 $ vcs.ignore.cellar        : logi TRUE
 $ vcs.ignore.library       : logi TRUE
 $ vcs.ignore.local         : logi TRUE
 $ vcs.manage.ignores       : logi TRUE

# Options --------------------------------------------------------------------
List of 9
 $ defaultPackages                     : chr [1:6] "datasets" "utils" "grDevices" "graphics" ...
 $ download.file.method                : NULL
 $ download.file.extra                 : NULL
 $ install.packages.compile.from.source: chr "interactive"
 $ pkgType                             : chr "both"
 $ repos                               : Named chr "https://packagemanager.posit.co/cran/latest"
  ..- attr(*, "names")= chr "CRAN"
 $ renv.consent                        : logi TRUE
 $ renv.project.path                   : chr "/Users/lmendelowitz/Downloads/temp/test-rmysql"
 $ renv.verbose                        : logi TRUE

# Environment Variables ------------------------------------------------------
HOME                        = /Users/lmendelowitz
LANG                        = en_US.UTF-8
MAKE                        = make
R_LIBS                      = <NA>
R_LIBS_SITE                 = /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/site-library
R_LIBS_USER                 = /Users/lmendelowitz/Downloads/temp/test-rmysql/renv/library/macos/R-4.4/aarch64-apple-darwin20
RENV_DEFAULT_R_ENVIRON      = <NA>
RENV_DEFAULT_R_ENVIRON_USER = <NA>
RENV_DEFAULT_R_LIBS         = <NA>
RENV_DEFAULT_R_LIBS_SITE    = /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/site-library
RENV_DEFAULT_R_LIBS_USER    = /Users/lmendelowitz/Library/R/arm64/4.4/library
RENV_DEFAULT_R_PROFILE      = <NA>
RENV_DEFAULT_R_PROFILE_USER = <NA>
RENV_PATHS_CELLAR           = /Users/lmendelowitz/renv_local_sources
RENV_PATHS_LOCAL            = /Users/lmendelowitz/renv_local_sources
RENV_PROJECT                = /Users/lmendelowitz/Downloads/temp/test-rmysql

# PATH -----------------------------------------------------------------------
- /Users/lmendelowitz/perl5/bin
- /Users/lmendelowitz/.pyenv/plugins/pyenv-virtualenv/shims
- /Users/lmendelowitz/.pyenv/shims
- /Users/lmendelowitz/.pyenv/bin
- /Users/lmendelowitz/.rbenv/shims
- /usr/local/opt/gnu-sed/libexec/gnubin
- /opt/homebrew/opt/findutils/libexec/gnubin
- /Users/lmendelowitz/.local/bin
- /opt/homebrew/bin
- /opt/homebrew/sbin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /Library/TeX/texbin
- /Users/lmendelowitz/perl5/bin
- /Users/lmendelowitz/.pyenv/plugins/pyenv-virtualenv/shims
- /Users/lmendelowitz/.pyenv/bin
- /Users/lmendelowitz/.rbenv/shims
- /usr/local/opt/gnu-sed/libexec/gnubin
- /opt/homebrew/opt/findutils/libexec/gnubin
- /Users/lmendelowitz/.local/bin
- /opt/homebrew/bin
- /opt/homebrew/sbin
- /opt/homebrew/opt/fzf/bin

# Cache ----------------------------------------------------------------------
There are a total of 626 packages installed in the renv cache.
Cache path: "~/Library/Caches/org.R-project.R/R/renv/cache/v5/macos/R-4.4/aarch64-apple-darwin20"

@greg Are you able to help out with this one? I keep running into this issue, and you were very helpful with a previous issue I had with the public Posit Package Manager which I posted here. Thanks in advance for the help!

Hey @Lmendy, thanks for the report. Those odd Rcpp versions 1.1/1.2/1.3 showing in the archive in Posit Package Manager is a known issue, but we hadn't seen any actual user impact until now. Those versions are actually legitimate Rcpp packages, but from a super old iteration of Rcpp that had been removed from CRAN long ago. They should definitely be removed though, but we just haven't gotten around to it yet.

For the renv issue, I tested a renv::install("Rcpp") with renv 1.1.4 on macOS, R 4.5, and can't reproduce. I'm still getting the latest actual Rcpp 1.0.14 version that's listed in PACKAGES.

> options(repos = "https://p3m.dev/cran/latest")
> install.packages("renv")
trying URL 'https://p3m.dev/cran/latest/bin/macosx/big-sur-arm64/contrib/4.5/renv_1.1.4.tgz'
Content type 'binary/octet-stream' length 2309241 bytes (2.2 MB)
==================================================
downloaded 2.2 MB


The downloaded binary packages are in
/var/folders/ml/4pc8nz755db_40h56sry7cqm0000gp/T//RtmpFkLGgT/downloaded_packages
> renv::install("Rcpp")
# Downloading packages -------------------------------------------------------
- Downloading Rcpp from https://p3m.dev/cran/latest ... OK [2.1 Mb in 0.68s]
Successfully downloaded 1 package in 3.6 seconds.

The following package(s) will be installed:
- Rcpp [1.0.14]
These packages will be installed into "/Library/Frameworks/R.framework/Versions/4.5-arm64/Resources/library".

Do you want to proceed? [Y/n]: 

Any idea on what else I might have to do to reproduce?