R-nvim / R.nvim

Neovim plugin to edit R files
GNU General Public License v3.0
128 stars 15 forks source link

Why build nvimcom: Nvimcom not installed #159

Closed VtheRtech closed 6 days ago

VtheRtech commented 1 week ago

Hello I keep getting this error message when I try running my R.nvim

12:34:36 AM msg_show.echo   RDebugInfo before_rns.R stdout: * checking for file ‘/home/pretender/.local/share/nvim/lazy/R.nvim/nvimcom/DESCRIPTION’ ... OK
* preparing ‘nvimcom’:
* checking DESCRIPTION meta-information ...
 OK
* cleaning src
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building ‘nvimcom_0.9.42.tar.gz’

before_rns.R stderr: Warning in system2(command, args, stdout = NULL, stderr = NULL, ...) :  error in running command

.build_packages() exit status 0
* installing to library ‘/home/pretender/R/x86_64-pc-linux-gnu-library/4.3’* installing *source* package ‘nvimcom’ ...** using staged installation
** libs
sh: line 1: make: command not found
Error in system(paste(MAKE, p1(paste("-f", shQuote(makefiles))), "compilers"),  :   error in running command
* removing ‘/home/pretender/R/x86_64-pc-linux-gnu-library/4.3/nvimcom’
Error in do_exit(status = status) : .install_packages() exit status 1Execution halted

Time:
  global setup: 0.001425052
  check health (async): 0.000931295
  before_rns.R (async): 0.339921738
  unix setup: 4.6219e-05
Why build nvimcom: Nvimcom not installed
12:34:59 AM msg_show.echo   RDebugInfo before_rns.R stdout: * checking for file ‘/home/pretender/.local/share/nvim/lazy/R.nvim/nvimcom/DESCRIPTION’ ... OK
* preparing ‘nvimcom’:
* checking DESCRIPTION meta-information ...
 OK
* cleaning src
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building ‘nvimcom_0.9.42.tar.gz’

before_rns.R stderr: Warning in system2(command, args, stdout = NULL, stderr = NULL, ...) :  error in running command

.build_packages() exit status 0
* installing to library ‘/home/pretender/R/x86_64-pc-linux-gnu-library/4.3’* installing *source* package ‘nvimcom’ ...** using staged installation
** libs
sh: line 1: make: command not found
Error in system(paste(MAKE, p1(paste("-f", shQuote(makefiles))), "compilers"),  :   error in running command
* removing ‘/home/pretender/R/x86_64-pc-linux-gnu-library/4.3/nvimcom’
Error in do_exit(status = status) : .install_packages() exit status 1Execution halted

Time:
  global setup: 0.001425052
  check health (async): 0.000931295
  before_rns.R (async): 0.339921738
  unix setup: 4.6219e-05
Why build nvimcom: Nvimcom not installed

these are the configs Im using

please note I tried using this in my R profile to try and circumvent the issue.

options(
  languageserver.server_capabilities =
    list(
      completionProvider = FALSE,
      completionItemResolve = FALSE
    )
)

I had also disscuseed the issue here: on another repo

I also get this error up launching r.nvim

[mason-lspconfig.nvim] failed to install r_language_server. Installation logs are available in :Mason and :MasonLog
PMassicotte commented 6 days ago

sh: line 1: make: command not found

Is it installed on your system?

jalvesaq commented 6 days ago

You have to fix this:

sh: line 1: make: command not found

Install gcc and make.

VtheRtech commented 6 days ago

ah okay, I'm using nixos there so I need to create a shell with make & gcc in it. I will post again when I have a fix.

gonna look through here to find the packages for that. https://search.nixos.org/packages

VtheRtech commented 6 days ago
gnumake #depedency for r.nvim 
libgcc #depedency for r.nvim
gccgo #depedency for r.nvim

These where the three unsatifiied dependencies, it would be nice if these where specificed in your documentation.

jalvesaq commented 6 days ago

I use Debian and I created a meta package that doesn't install any files but depends on many other packages that are necessary to compile R and R packages that include C code. The advantage of having a meta package is that I never inadvertently uninstall a useful package. Here is how I created the meta package:

I created a file named build-r with the following contents:

Package: build-r
Priority: optional
Version: 4.2.2
Maintainer: Your Name <yourname@email>
Architecture: all
Section: metapackages
Depends: bash-completion,
  bison,
  g++,
  gcc,
  gfortran,
  groff-base,
  tidy,
  libblas-dev,
  libbz2-dev,
  libcairo2-dev,
  libcurl4-openssl-dev | libcurl4-dev,
  libgdal-dev,
  libjpeg-dev,
  liblapack-dev,
  libudunits2-dev,
  libpoppler-cpp-dev,
  libmagick++-dev,
  liblzma-dev,
  libncurses5-dev,
  libpango1.0-dev,
  libpcre2-dev,
  libpcre3-dev,
  libpng-dev,
  libreadline-dev,
  libtiff5-dev,
  libx11-dev,
  libxt-dev,
  mpack,
  tcl8.6-dev,
  texinfo,
  texlive-base,
  texlive-extra-utils,
  texlive-fonts-recommended,
  texlive-latex-base,
  texlive-latex-extra,
  texlive-latex-recommended,
  texlive-plain-generic,
  tk8.6-dev,
  x11proto-core-dev,
  xauth,
  xdg-utils,
  xfonts-base,
  xvfb,
  zlib1g-dev
Description: r building dependencies
  This is a metapackage which depends on all
  packages necessary to compile R and some R packages.

Then, in a terminal emulator:

equivs-build build-r
sudo dpkg -i build-r_4.2.2_all.deb

Right after the installation, build-r_4.2.2 is in a broken state because the dependencies are not installed. Then, finally, I start aptitude and install the dependencies of build-r.

I got the list of dependencies to build R from the Debian source package r-base. Later, I added other dependencies as they were needed to build some R libraries.

NixOS isn't Debian based, but the procedure that I described above might be helpful for people using Debian, Ubuntu, Mint, or other Debian based Linux distro.

jalvesaq commented 6 days ago

The documentation has this:

     - The R package `nvimcom` is included in R.nvim and is automatically
       installed and updated whenever necessary. The package requires
       compilation by a C compiler (e.g. `gcc` or `clang`).

I will change it to make it clearer that make and gcc are dependencies.