r-lib / pkgbuild

Find tools needed to build R packages
https://pkgbuild.r-lib.org
Other
66 stars 35 forks source link

Fails to detect build tools correctly on macOS Big Sur #103

Closed hrbrmstr closed 1 year ago

hrbrmstr commented 4 years ago

I've left a similar issue for RStudio's internal checks but {pkgbuild} fails to properly see clearly installed build tools during package checks inside RStudio.

$ xcode-select --print-path
/Applications/Xcode.app/Contents/Developer

In RStudio (latest dailies) I can't even debug this issue:

pkgbuild::check_build_tools(debug = TRUE)
Error: Could not find tools necessary to compile a package
Call `pkgbuild::check_build_tools(debug = TRUE)` to diagnose the problem.

When I do the same in a terminal R console:

> pkgbuild::check_build_tools(debug = TRUE)
Trying to compile a simple C file
Running /Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB foo.c
ccache clang -Qunused-arguments -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c foo.c -o foo.o
ccache clang -Qunused-arguments -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o foo.so foo.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation

Your system is ready to build packages!

macOS Big Sur (latest Beta), R 4.0.2, Xcode (latest beta)

jimhester commented 4 years ago

If pkgbuild works in the console but not in RStudio I think this must be an RStudio issue, there really isn't any RStudio specific code in pkgbuild.

hrbrmstr commented 4 years ago

Well, since you're kinda all on the same team, mebbe y'all could fix this holistically? Or, is that unreasonable?

NathanSkene commented 3 years ago

I've got the same issue

hrbrmstr commented 3 years ago

Pretty sure the only course of action is to waste disk space and install the command line tools as well as Xcode (or jury rig symbolic links) since there seems to be no impetus to resolve this across RStudio IDE behavior and the supporting packages it relies upon.

On Fri, Jan 15, 2021 at 12:38 PM Nathan Skene notifications@github.com wrote:

I've got the same issue

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/r-lib/pkgbuild/issues/103#issuecomment-761081249, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD4PNWYERLVNGRXGG4HKY3S2B4THANCNFSM4QOMCY4Q .

PythonCoderUnicorn commented 2 years ago

Hi, I have this issue following a tutorial

all i did was edit the DESCRIPTION file and ran check()

==> devtools::check()

ℹ Updating ohwhaley documentation
ℹ Loading ohwhaley
── Building ─────────────────────── ohwhaley ──
Setting env vars:
• CFLAGS    : -Wall -pedantic
• CXXFLAGS  : -Wall -pedantic
• CXX11FLAGS: -Wall -pedantic

✓  checking for file ‘/Users/zane/Documents/R_/PACKAGE/ohwhaley/DESCRIPTION’ ...
─  preparing ‘ohwhaley’:
✓  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
   Removed empty directory ‘ohwhaley/R’
   Removed empty directory ‘ohwhaley/man’
─  building ‘ohwhaley_0.0.0.9000.tar.gz’

── Checking ─────────────────────── ohwhaley ──
Setting env vars:
• _R_CHECK_CRAN_INCOMING_REMOTE_: FALSE
• _R_CHECK_CRAN_INCOMING_       : FALSE
• _R_CHECK_FORCE_SUGGESTS_      : FALSE
• NOT_CRAN                      : true
Error: Could not find tools necessary to compile a package

Call `pkgbuild::check_build_tools(debug = TRUE)` to diagnose the problem.
Execution halted

Exited with status 1.
gaborcsardi commented 2 years ago

I opened a new issue for this, hopefully it will be fixed this time: https://github.com/rstudio/rstudio/issues/10203

gaborcsardi commented 2 years ago

I think we can work around this in pkgbuild, and first try to find a compiler on our own, and only fall back on RStudio if we fail to find one.

PythonCoderUnicorn commented 2 years ago

update, I installed the full XCode and then everything worked, which sucks as I didn't want to have the full software. Thanks !

gaborcsardi commented 2 years ago

@PythonCoderUnicorn Well, this issue is about the opposite, i.e. that pkgbuild in RStudio does not work with the full Xcode and only works with the command line tools.

PythonCoderUnicorn commented 2 years ago

okay, good to know. Just wanted to share that for me, the full installed fixed my issues of beginner pkg dev, so maybe there is issues unknown to me on this. I thank you for your work on this.