Skip to content

Error: Error installing package 'protolite': #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
benjcowley opened this issue Sep 23, 2024 · 1 comment
Open

Error: Error installing package 'protolite': #172

benjcowley opened this issue Sep 23, 2024 · 1 comment

Comments

@benjcowley
Copy link

Hi, seem to have an issue when trying to build using renv, I've had a google around but the only fixes I've seen seem to apply to fixing this on a local machine rather than with this build pack. Any ideas how to go about fixing this?

` - Installing protolite ... FAILED
Error: Error installing package 'protolite':
=====================================

   * installing *source* package ‘protolite’ ...
   ** package ‘protolite’ successfully unpacked and MD5 sums checked
   ** using staged installation
   Package protobuf was not found in the pkg-config search path.
   Perhaps you should add the directory containing `protobuf.pc'
   to the PKG_CONFIG_PATH environment variable
   No package 'protobuf' found
   Using PKG_CFLAGS=
   Using PKG_LIBS=-lprotobuf
   Found C++17 compiler: g++ -std=gnu++17 -g -O2
   ------------------------------[ ANTICONF ]-----------------------------
   Configuration failed to find protobuf. Try installing:
    * deb: libprotobuf-dev (Debian, Ubuntu, etc)
    * rpm: protobuf-devel (Fedora, EPEL)
    * brew: protobuf (OSX)
   If protobuf is already installed, check that 'pkg-config' is in your
   PATH and PKG_CONFIG_PATH contains a protobuf.pc file. If pkg-config
   is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
   R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
   ----------------------------[ ERROR MESSAGE ]----------------------------
   <stdin>:1:10: fatal error: google/protobuf/message.h: No such file or directory
   compilation terminated.
   ------------------------------------------------------------------------
   ERROR: configuration failed for package ‘protolite’
   * removing ‘/app/renv/staging/1/protolite’
   install of package 'protolite' failed [error code 1]
   Traceback (most recent calls last):
   13: renv::restore()
   12: renv_restore_run_actions(project, diff, current, lockfile, rebuild)
   11: renv_install_impl(records)
   10: renv_install_staged(records)
    9: renv_install_default(records)
    8: handler(package, renv_install_package(record))
    7: renv_install_package(record)
    6: withCallingHandlers(renv_install_package_impl(record), error = function(e) writef("FAILED"))
    5: renv_install_package_impl(record)
    4: r_cmd_install(package, path)
    3: r_exec_error(package, output, "install", status)
    2: abort(all)
    1: stop(fallback)
   Execution halted

! Push rejected, failed to compile R (shiny) app.
! Push failed`

@virtualstaticvoid
Copy link
Owner

Hi @benjcowley

The error is likely due to missing the libprotobuf-dev system dependency.

You can install libprotobuf-dev by adding an Aptfile to the root of your project directory which lists the dependency, as described in the README under Installing Binary Dependencies.

See the aptfile test for an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants