Skip to content

RStudio: libclang missing some code/namespaces #82

Closed

Description

@franzbischoff

Everything compiles and runs ok, but the RStudio libclang still missing things:

image

image

I spent more than 4h around this...

Session info:

> devtools::session_info()
- Session info ------------------------------------------------------------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.6.3 (2020-02-29)
 os       Windows 10 x64              
 system   x86_64, mingw32             
 ui       RStudio                     
 language (EN)                        
 collate  English_United States.1252  
 ctype    English_United States.1252  
 tz       Europe/London               
 date     2020-08-06

here is the log for .rs.setClangDiagnostics(2)

CLANG INDEXING: D:/Workspaces/RStudio/test/src/code.cpp
CLANG REMOVE INDEX: D:/Workspaces/RStudio/test/src/code.cpp
COMPILATION ARGUMENTS:
[
    "-IC:/Program Files/RStudio/resources/libclang/builtin-headers/5.0.2",
    "-IC:/Program Files/RStudio/resources/libclang/builtin-headers/libc++/5.0.2",
    "-ID:/Cloud/Google_Drive/Documents/R/win-library/3.6/cpp11/include",
    "-std=gnu++11",
    "-IC:/PROGRA~1/R/R-36~1.3/include",
    "-DNDEBUG",
    "-v"
]
  (Creating new index)
clang version 5.0.2 (tags/RELEASE_502/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: 
ignoring nonexistent directory "lib\clang\5.0.2\include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 10.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include"
#include "..." search starts here:
#include <...> search starts here:
 C:/Program Files/RStudio/resources/libclang/builtin-headers/5.0.2
 C:/Program Files/RStudio/resources/libclang/builtin-headers/libc++/5.0.2
 D:/Cloud/Google_Drive/Documents/R/win-library/3.6/cpp11/include
 C:/PROGRA~1/R/R-36~1.3/include
End of search list.
C:/Program Files/RStudio/resources/libclang/builtin-headers/libc++/5.0.2\cstddef:44:15: fatal error: 'stddef.h' file not found
TOTAL MEMORY: 6 mb (code.cpp)
PERFORMANCE 181 ms (code.cpp)
CLANG INDEXING: D:/Workspaces/RStudio/test/src/code.cpp
CLANG REMOVE INDEX: D:/Workspaces/RStudio/test/src/code.cpp
COMPILATION ARGUMENTS:
[
    "-IC:/Program Files/RStudio/resources/libclang/builtin-headers/5.0.2",
    "-IC:/Program Files/RStudio/resources/libclang/builtin-headers/libc++/5.0.2",
    "-ID:/Cloud/Google_Drive/Documents/R/win-library/3.6/cpp11/include",
    "-std=gnu++11",
    "-IC:/PROGRA~1/R/R-36~1.3/include",
    "-DNDEBUG",
    "-v"
]
  (Creating new index)
clang version 5.0.2 (tags/RELEASE_502/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: 
ignoring nonexistent directory "lib\clang\5.0.2\include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 10.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include"
#include "..." search starts here:
#include <...> search starts here:
 C:/Program Files/RStudio/resources/libclang/builtin-headers/5.0.2
 C:/Program Files/RStudio/resources/libclang/builtin-headers/libc++/5.0.2
 D:/Cloud/Google_Drive/Documents/R/win-library/3.6/cpp11/include
 C:/PROGRA~1/R/R-36~1.3/include
End of search list.
C:/Program Files/RStudio/resources/libclang/builtin-headers/libc++/5.0.2\cstddef:44:15: fatal error: 'stddef.h' file not found
TOTAL MEMORY: 6 mb (code.cpp)
PERFORMANCE 184 ms (code.cpp)
C:/Program Files/RStudio/resources/libclang/builtin-headers/libc++/5.0.2\cstddef:44:15: fatal error: 'stddef.h' file not found

Activity

  1. jimhester commented on Aug 7, 2020

    @jimhester
    Member

    Should this instead be an issue in https://github.com/rstudio/rstudio/issues? I am not aware of anything we could change in this project to fix the RStudio completion.

    From the log it looks like the cpp11 headers are being included, but that stddef.h error seems suspicious, maybe @kevinushey has thoughts?

  2. franzbischoff commented on Aug 7, 2020

    @franzbischoff
    Author

    Yes, I thought about posting in RStudio, but I also crossed by other posts about libclang errors, with Rcpp, and IIRC Rcpp did some changes to comply with some standard...
    I'll try this in ubuntu.

  3. franzbischoff commented on Aug 7, 2020

    @franzbischoff
    Author

    In Ubuntu, all clear.
    In Ubuntu, it is using the libclang 3.8.0, and RStudio (just for windows?) has updated it to 5.0.2, so it may be broken someway.

    Just updated the Ubuntu installation from libclang 3.8.0 to 11.0 (the last one), and the bug starts...

  4. franzbischoff commented on Aug 7, 2020

    @franzbischoff
    Author

    In windows, I got the old RStudio Desktop 1.1.463 version, and copy the rstudio/bin/rsclang/* and rstudio/resources/libclang/* over the current version (libclang 3.4.0 says the terminal) and it comes back to life. May it be some more restrict syntax, since RStudio said they updated to 5.0.2 to allow c++14 stuff?

    image

  5. kevinushey commented on Aug 9, 2020

    @kevinushey
    Contributor

    I think the issue here ultimately is that the Rtools headers are not being included during compilation -- those are needed to resolve things referenced via #include_next in the libc++ headers.

    Can you please re-file this issue on the RStudio repository (https://github.com/rstudio/rstudio/issues)?

  6. franzbischoff commented on Aug 9, 2020

    @franzbischoff
    Author

    Sure, thank you. I'll post there a link to this issue to avoid having to re-explain all the details.

    BR.

  7. bkietz commented on Sep 15, 2020

    @bkietz
    Collaborator

    @jimhester should this issue be closed, since it has been moved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions