r-lib/fs

Problem installing fs

Closed this issue · 3 comments

Hi,
I'm trying installing fs after upgrading to R 4.4.2 but I get this error if I try to install it in a renv managed project:

 renv::install("fs")
# Downloading packages -------------------------------------------------------
- Downloading fs from CRAN ...                  OK [file is up to date]
Successfully downloaded 1 package in 1.3 seconds.

The following package(s) will be installed:
- fs [1.6.5]
These packages will be installed into "~/Documents/GitHub/VEDA_RG/renv/library/macos/R-4.4/aarch64-apple-darwin20".

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

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

* installing *source* package ‘fs’ ...
** package ‘fs’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
using C++ compiler: ‘Apple clang version 16.0.0 (clang-1600.0.26.4)’
using SDK: ‘MacOSX15.1.sdk’
clang++ -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I./libuv-1.44.2/include -I. -pthread  -I/opt/R/arm64/include -I/opt/homebrew/opt/libomp/include -Xclang -fopenmp     -fPIC  -falign-functions=64 -Wall -g -O2   -c dir.cc -o dir.o
dir.cc:1:10: fatal error: 'cstring' file not found
    1 | #include <cstring>
      |          ^~~~~~~~~
1 error generated.
make: *** [dir.o] Error 1
ERROR: compilation failed for package ‘fs’
* removing ‘/Users/alessandroarrigo/Documents/GitHub/VEDA_RG/renv/staging/1/fs’
install of package 'fs' failed [error code 1]

No problem instead If I install it the global space outside renv. Any hints on how to solve the problem?

You are probably running into this macOS bug: https://trac.macports.org/wiki/SequoiaProblems#CompilingCfails

You are probably running into this macOS bug: https://trac.macports.org/wiki/SequoiaProblems#CompilingCfails

You are probably right, this morning I updated both R and the OS. I temporarily bypassed the problem by copying the old fs folder to the new installation. The really weird thing is that I can install fs (the same problem also happens with gdtools) when I'm working outside renv without any issue. Maybe being renv an isolated environment, it searches for some files in the wrong place.

I close the ticket and I'll open another one in the renv github. Thanks!

The really weird thing is that I can install fs (the same problem also happens with gdtools) when I'm working outside renv without any issue.

Because you are probably installing the binary package, so no compilation is needed. I don't know why renv tries to compile it instead of installing the binary.