Repository navigation
Closed
Description
System details
RStudio Edition : Desktop
RStudio Version : Preview 2022.02.0 Build 392 (But also in the daily!)
OS Version : macOS Monterey
R Version : 4.1.1
Steps to reproduce the problem
-
Fork this repo and open it in rstudio https://github.com/DavisVaughan/testcppautocomplete.
-
Open
code.cand click around. You should get little failure indications like:
Here are the clang diagnostics from .rs.setClangDiagnostics(2). It looks like the R headers aren't being included at all?
> .rs.setClangDiagnostics(2)
Attemping to load libclang for x86_64-apple-darwin17.0
/Applications/RStudio.app/Contents/MacOS/rsclang/libclang.dylib
(Not Found)
/Library/Developer/CommandLineTools/usr/lib/libclang.dylib
LOADED: 13.0.0
Restarting R session...
>
CLANG INDEXING: /Users/davis/Desktop/r/playground/packages/testcppautocomplete/src/code.c
# RESTORING PACKAGE COMPILATION CONFIG ----
/Users/davis/Desktop/r/playground/packages/testcppautocomplete/.Rproj.user/49404F48/cpp-compilation-config
{
"args": [
"-I/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include",
"-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1",
"-I/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include",
"-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include",
"-I/Library/Developer/CommandLineTools/usr/include"
],
"pch": "",
"is_cpp": false,
"hash": "16323402221644244300",
"compiler": "3328171544225527596",
"rversion": "4.1.1"
}
# COMPILATION ARGUMENTS ----
[
"-I/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include",
"-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1",
"-I/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include",
"-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include",
"-I/Library/Developer/CommandLineTools/usr/include",
"-v"
]
(Creating new index)
Apple clang version 13.0.0 (clang-1300.0.27.3)
Target: x86_64-apple-darwin21.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/local/include"
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/Library/Frameworks"
ignoring duplicate directory "/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include"
ignoring duplicate directory "/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include"
as it is a non-system directory that duplicates a system directory
ignoring duplicate directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include"
as it is a non-system directory that duplicates a system directory
ignoring duplicate directory "/Library/Developer/CommandLineTools/usr/include"
as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1
/Library/Developer/CommandLineTools/usr/lib/clang/13.0.0/include
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
/Library/Developer/CommandLineTools/usr/include
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)
End of search list.
/Users/davis/Desktop/r/playground/packages/testcppautocomplete/src/code.c:2:10: fatal error: 'R.h' file not found
TOTAL MEMORY: 400 kb (code.c)
PERFORMANCE 146 ms (code.c)

Activity
DavisVaughan commentedon Feb 7, 2022
Note that I just updated to macOS Monterey from Mojave and also immediately updated my RStudio version to the daily version (to use Quarto). I have no idea if this is related to the Monterey update or not.
ronblum commentedon Feb 7, 2022
I can reproduce the problem in the following:
However, it works in
Also, there are issues in

init.c:Note: Marking as
triageto consider the milestone.DavisVaughan commentedon Feb 8, 2022
Can confirm that Kevin's fix is working in the latest daily
valerie-rstudio commentedon Feb 8, 2022
Verified Fixed
Summary
Verified that C code autocomplete is now working as expected.
Automation