mono / CppSharp

Tools and libraries to glue C/C++ APIs to high-level languages
MIT License
3.12k stars 514 forks source link

fatal error: llvm/ADT/SmallString.h: No such file or directory #1553

Open bmahlbrand opened 3 years ago

bmahlbrand commented 3 years ago
Brief Description

when building master:

fatal error: llvm/ADT/SmallString.h: No such file or directory 11 | #include <llvm/ADT/SmallString.h>

OS: Windows / OS X / Linux (include version and/or distro) Ubuntu 20.04

Used headers

N/A

Used settings

Target: MSVC/GCC/Clang

GCC

Other settings

Stack trace or incompilable generated code
(base) PS C:\Users\user\workspace\CppSharp\build> bash ./build.sh generate -configuration Release -platform x64
Archive llvm-0c8f9b-linux-x64-gcc-9-Release.tar.xz already exists.
Using debug LLVM build: /mnt/c/Users/user/workspace/CppSharp/build/llvm/llvm-0c8f9b-linux-x64-gcc-9-Debug
Using release LLVM build: /mnt/c/Users/user/workspace/CppSharp/build/llvm/llvm-0c8f9b-linux-x64-gcc-9-Release
Building configurations...
Running action 'gmake2'...
Done (173ms).
Generating CppSharp build configuration file 'BuildConfig.cs'
Building configurations...
Running action 'vs2019'...
Done (137ms).
(base) PS C:\Users\user\workspace\CppSharp\build> bash ./build.sh -configuration Release -platform x64
Archive llvm-0c8f9b-linux-x64-gcc-9-Release.tar.xz already exists.
Using debug LLVM build: /mnt/c/Users/user/workspace/CppSharp/build/llvm/llvm-0c8f9b-linux-x64-gcc-9-Debug
Using release LLVM build: /mnt/c/Users/user/workspace/CppSharp/build/llvm/llvm-0c8f9b-linux-x64-gcc-9-Release
Building configurations...
Running action 'gmake2'...
Done (180ms).
Generating CppSharp build configuration file 'BuildConfig.cs'
Building configurations...
Running action 'vs2019'...
Done (120ms).
  Determining projects to restore...
  All projects are up-to-date for restore.
make: Entering directory '/mnt/c/Users/user/workspace/CppSharp/build/gmake'
==== Building CppSharp.CppParser (release_x64) ====
AST.cpp
../../../src/CppParser/AST.cpp:11:10: fatal error: llvm/ADT/SmallString.h: No such file or directory
   11 | #include <llvm/ADT/SmallString.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [CppSharp.CppParser.make:138: ../../obj/CppSharp.CppParser/Release/AST.o] Error 1
make: *** [Makefile:54: CppSharp.CppParser] Error 2
make: Leaving directory '/mnt/c/Users/user/workspace/CppSharp/build/gmake'
ddobrev commented 3 years ago

This is really strange because our CI works fine. Are you sure you haven't made any modifications to the project files after generation?

bmahlbrand commented 3 years ago

definitely, I also tried cloning fresh a couple of times and had the same error. I'm sure there's something I overlooked on my end.

tritao commented 3 years ago

Not sure what it could be either..

You can check if the archives for LLVM are properly extracted in the LLVM build path: /mnt/c/Users/user/workspace/CppSharp/build/llvm/llvm-0c8f9b-linux-x64-gcc-9-*

Also check the verbose build output (you can invoke make/build with verbose=true make, it should give you the actual compiler parameters being passed by the makefile. If you can paste it on a gist or something then I can take a look.