Open
Description
Happens in windows and linux.
This is with the latest
C:\temp\temp\new5\arduino-preprocessor>arduino-preprocessor.exe Blink.ino
Error while trying to load a compilation database:
Could not auto-detect compilation database for file "Blink.ino"
No compilation database found in C:\temp\temp\new5\arduino-preprocessor or any parent directory
json-compilation-database: Error while opening JSON database: No such file or directory
Running without flags.
Error while processing C:\temp\temp\new5\arduino-preprocessor\Blink.ino.
C:\temp\temp\new5\arduino-preprocessor>arduino-preprocessor.exe Blink.ino.cpp
Error while trying to load a compilation database:
Installing manually on windows is broken.
Installing this on docker (fedora) is also broken by default due to missing <type_traits>
This is what I'm working on right now to fix this build:
RUN dnf -y update && \
echo "max_parallel_downloads=10" >> /etc/dnf/dnf.conf
# Install necessary packages: wget, gcc-c++, and standard C++ libraries
RUN dnf install -y wget gcc-c++ libstdc++-devel libstdc++ --skip-broken
# Set library path to ensure linker can find libstdc++
ENV LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH
# Clone the Arduino Preprocessor repository
RUN git clone https://github.com/JVIon6oose/arduino-preprocessor /tools/arduino-preprocessor
# Build the Arduino Preprocessor
RUN cd /tools/arduino-preprocessor && ./package-arduino-preprocessor.bash
But this breaks as well with the output:
> [stage-1 29/37] RUN cd /tools/arduino-preprocessor && ./package-arduino-preprocessor.bash:
0.570 ++ cat Config.hpp
0.570 ++ grep VERSION
0.571 ++ sed 's/[^"]*"\([^"]*\)".*/\1/'
0.573 + ARDUINO_PREPROCESSOR_VERSION=0.1.5
0.573 + OUTPUT_VERSION=0.1.5
0.573 + rm -rf objdir arduino-preprocessor
0.574 + mkdir objdir
0.576 ++ uname -o
0.578 + export OS=GNU/Linux
0.578 + OS=GNU/Linux
0.578 + export TARGET_OS=GNU/Linux
0.578 + TARGET_OS=GNU/Linux
0.578 + START_GROUP=-Wl,--start-group
0.578 + END_GROUP=-Wl,--end-group
0.578 + [[ GNU/Linux == \G\N\U\/\L\i\n\u\x ]]
0.578 ++ uname -m
0.579 + export MACHINE=x86_64
0.579 + MACHINE=x86_64
0.579 + [[ x86_64 == \x\8\6\_\6\4 ]]
0.580 + fetch_llvm https://github.com/cmaglie/llvm-clang-build-scripts/releases/download/4.0.0/llvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz
0.580 ++ basename https://github.com/cmaglie/llvm-clang-build-scripts/releases/download/4.0.0/llvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz
0.581 + fetched=llvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz
0.581 + '[' '!' -f llvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz ']'
0.581 + wget https://github.com/cmaglie/llvm-clang-build-scripts/releases/download/4.0.0/llvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz
107.3 [0] Downloading 'https://github.com/cmaglie/llvm-clang-build-scripts/releases/download/4.0.0/llvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz' ...
107.3 HTTP response 302 [https://github.com/cmaglie/llvm-clang-build-scripts/releases/download/4.0.0/llvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz]
107.3 Adding URL: https://objects.githubusercontent.com/github-production-release-asset-2e65be/95235003/806a5dea-5840-11e7-9110-d2e1a878a81e?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241015%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241015T002202Z&X-Amz-Expires=300&X-Amz-Signature=bfa8e7b738e2d624b2174638ebff610e6ee86503f34b09d9190b4bd9c28f7179&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dllvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz&response-content-type=application%2Foctet-stream
107.3 [0] Downloading 'https://objects.githubusercontent.com/github-production-release-asset-2e65be/95235003/806a5dea-5840-11e7-9110-d2e1a878a81e?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241015%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241015T002202Z&X-Amz-Expires=300&X-Amz-Signature=bfa8e7b738e2d624b2174638ebff610e6ee86503f34b09d9190b4bd9c28f7179&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dllvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz&response-content-type=application%2Foctet-stream' ...
107.3 Saving 'llvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz'
107.3 HTTP response 200 [https://objects.githubusercontent.com/github-production-release-asset-2e65be/95235003/806a5dea-5840-11e7-9110-d2e1a878a81e?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241015%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241015T002202Z&X-Amz-Expires=300&X-Amz-Signature=bfa8e7b738e2d624b2174638ebff610e6ee86503f34b09d9190b4bd9c28f7179&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dllvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz&response-content-type=application%2Foctet-stream]
107.3 + '[' '!' -f llvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz.asc ']'
107.3 + wget https://github.com/cmaglie/llvm-clang-build-scripts/releases/download/4.0.0/llvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz.asc
108.2 [0] Downloading 'https://github.com/cmaglie/llvm-clang-build-scripts/releases/download/4.0.0/llvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz.asc' ...
108.2 HTTP response 302 [https://github.com/cmaglie/llvm-clang-build-scripts/releases/download/4.0.0/llvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz.asc]
108.2 Adding URL: https://objects.githubusercontent.com/github-production-release-asset-2e65be/95235003/c5d92042-5844-11e7-8158-4cfc6a4dec92?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241015%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241015T002349Z&X-Amz-Expires=300&X-Amz-Signature=928a0658f4fb6e449444a5a8c80ed466385066a71ff15447a4d52c5fa891d137&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dllvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz.asc&response-content-type=application%2Foctet-stream
108.2 [0] Downloading 'https://objects.githubusercontent.com/github-production-release-asset-2e65be/95235003/c5d92042-5844-11e7-8158-4cfc6a4dec92?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241015%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241015T002349Z&X-Amz-Expires=300&X-Amz-Signature=928a0658f4fb6e449444a5a8c80ed466385066a71ff15447a4d52c5fa891d137&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dllvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz.asc&response-content-type=application%2Foctet-stream' ...
108.2 Saving 'llvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz.asc'
108.2 HTTP response 200 [https://objects.githubusercontent.com/github-production-release-asset-2e65be/95235003/c5d92042-5844-11e7-8158-4cfc6a4dec92?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241015%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241015T002349Z&X-Amz-Expires=300&X-Amz-Signature=928a0658f4fb6e449444a5a8c80ed466385066a71ff15447a4d52c5fa891d137&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dllvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz.asc&response-content-type=application%2Foctet-stream]
108.2 + gpg2 --status-fd 1 --no-default-keyring --homedir . --keyring arduino_sources_gpg_pubkey.key --trust-model always --verify llvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz.asc
108.2 gpg: WARNING: unsafe permissions on homedir '/tools/arduino-preprocessor'
108.2 gpg: assuming signed data in 'llvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz'
108.3 [GNUPG:] NEWSIG
108.3 gpg: Signature made Fri Jun 23 16:33:54 2017 UTC
108.3 gpg: using RSA key 95FA6F43E21188C4
108.3 [GNUPG:] KEY_CONSIDERED 326567C1C6B288DF32CB061A95FA6F43E21188C4 0
108.3 [GNUPG:] SIG_ID 7EjxZk/ytWx33WHB3H/VzqsUtcg 2017-06-23 1498235634
108.3 [GNUPG:] KEY_CONSIDERED 326567C1C6B288DF32CB061A95FA6F43E21188C4 0
108.3 [GNUPG:] GOODSIG 95FA6F43E21188C4 Arduino Packages <support@arduino.cc>
108.3 gpg: Good signature from "Arduino Packages <support@arduino.cc>" [unknown]
108.3 [GNUPG:] VALIDSIG 326567C1C6B288DF32CB061A95FA6F43E21188C4 2017-06-23 1498235634 0 4 0 1 8 00 326567C1C6B288DF32CB061A95FA6F43E21188C4
108.3 gpg: WARNING: Using untrusted key!
108.3 + rm -rf clang
108.3 + mkdir clang
108.3 + tar xf llvm-clang-4.0.0-ubuntu-14.04.5-x86_64.tar.xz -C clang --strip-components=1
120.2 + OUTPUT_TAG=x86_64-pc-linux-gnu
120.2 + CXXFLAGS=
120.2 + CXX=clang/bin/clang++
120.2 ++ clang/bin/llvm-config --cxxflags
120.2 + CXXFLAGS='-I/tools/arduino-preprocessor/clang/include -std=c++11 -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers
-pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -std=c++11 -ffunction-sections -fdata-sections -O3 -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '
120.2 ++ clang/bin/llvm-config --ldflags
120.2 + LDFLAGS='-L/tools/arduino-preprocessor/clang/lib -static-libstdc++'
120.2 ++ clang/bin/llvm-config --libs --system-libs
120.2 + LLVMLIBS='-lLLVMLTO -lLLVMPasses -lLLVMObjCARCOpts -lLLVMSymbolize -lLLVMDebugInfoPDB -lLLVMDebugInfoDWARF -lLLVMCoverage -lLLVMTableGen -lLLVMLineEditor -lLLVMOrcJIT -lLLVMMIRParser -lLLVMARMDisassembler -lLLVMARMCodeGen -lLLVMARMAsmParser -lLLVMARMDesc -lLLVMARMInfo -lLLVMARMAsmPrinter
-lLLVMObjectYAML -lLLVMLibDriver -lLLVMOption -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMX86Desc -lLLVMMCDisassembler -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMMCJIT -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMCodeGen -lLLVMTarget -lLLVMCoroutines -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMScalarOpts -lLLVMLinker -lLLVMIRReader -lLLVMAsmParser -lLLVMInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMObject -lLLVMMCParser -lLLVMMC -lLLVMBitReader -lLLVMProfileData -lLLVMCore -lLLVMSupport -lLLVMDemangle
120.2 -lrt -ldl -lpthread -lm'
120.2 ++ ls clang/lib/libclangARCMigrate.a clang/lib/libclangAST.a clang/lib/libclangASTMatchers.a
clang/lib/libclangAnalysis.a clang/lib/libclangBasic.a clang/lib/libclangCodeGen.a clang/lib/libclangDriver.a clang/lib/libclangDynamicASTMatchers.a clang/lib/libclangEdit.a clang/lib/libclangFormat.a clang/lib/libclangFrontend.a clang/lib/libclangFrontendTool.a clang/lib/libclangIndex.a clang/lib/libclangLex.a clang/lib/libclangParse.a clang/lib/libclangRewrite.a clang/lib/libclangRewriteFrontend.a clang/lib/libclangSema.a clang/lib/libclangSerialization.a clang/lib/libclangStaticAnalyzerCheckers.a clang/lib/libclangStaticAnalyzerCore.a clang/lib/libclangStaticAnalyzerFrontend.a clang/lib/libclangTooling.a clang/lib/libclangToolingCore.a
120.2 ++ sed 's/.*libclang/-lclang/'
120.2 ++ sed 's/.a$//'
120.2 + CLANGLIBS='-lclangARCMigrate
120.2 -lclangAST
120.2 -lclangASTMatchers
120.2 -lclangAnalysis
120.2 -lclangBasic
120.2 -lclangCodeGen
120.2 -lclangDriver
120.2 -lclangDynamicASTMatchers
120.2 -lclangEdit
120.2 -lclangFormat
120.2 -lclangFrontend
120.2 -lclangFrontendTool
120.2 -lclangIndex
120.2 -lclangLex
120.2 -lclangParse
120.2 -lclangRewrite
120.2 -lclangRewriteFrontend
120.2 -lclangSema
120.2 -lclangSerialization
120.2 -lclangStaticAnalyzerCheckers
120.2 -lclangStaticAnalyzerCore
120.2 -lclangStaticAnalyzerFrontend
120.2 -lclangTooling
120.2 -lclangToolingCore'
120.2 + SOURCES='main.cpp ArduinoDiagnosticConsumer.cpp CommandLine.cpp IdentifiersList.cpp CodeCompletion.cpp'
120.2 + clang/bin/clang++ main.cpp ArduinoDiagnosticConsumer.cpp CommandLine.cpp IdentifiersList.cpp CodeCompletion.cpp -o objdir/arduino-preprocessor -I/tools/arduino-preprocessor/clang/include -std=c++11 -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -std=c++11 -ffunction-sections -fdata-sections -O3 -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -L/tools/arduino-preprocessor/clang/lib -static-libstdc++ -Wl,--start-group -lLLVMLTO -lLLVMPasses -lLLVMObjCARCOpts -lLLVMSymbolize -lLLVMDebugInfoPDB -lLLVMDebugInfoDWARF -lLLVMCoverage -lLLVMTableGen -lLLVMLineEditor -lLLVMOrcJIT -lLLVMMIRParser -lLLVMARMDisassembler -lLLVMARMCodeGen -lLLVMARMAsmParser -lLLVMARMDesc -lLLVMARMInfo -lLLVMARMAsmPrinter -lLLVMObjectYAML -lLLVMLibDriver -lLLVMOption -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMGlobalISel -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF -lLLVMX86Desc -lLLVMMCDisassembler -lLLVMX86Info -lLLVMX86AsmPrinter
-lLLVMX86Utils -lLLVMMCJIT -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMCodeGen
-lLLVMTarget -lLLVMCoroutines -lLLVMipo -lLLVMInstrumentation -lLLVMVectorize -lLLVMScalarOpts -lLLVMLinker -lLLVMIRReader -lLLVMAsmParser -lLLVMInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis -lLLVMObject -lLLVMMCParser -lLLVMMC -lLLVMBitReader -lLLVMProfileData -lLLVMCore -lLLVMSupport -lLLVMDemangle -lrt -ldl -lpthread -lm -lclangARCMigrate -lclangAST -lclangASTMatchers -lclangAnalysis -lclangBasic -lclangCodeGen -lclangDriver -lclangDynamicASTMatchers -lclangEdit -lclangFormat -lclangFrontend -lclangFrontendTool -lclangIndex -lclangLex -lclangParse -lclangRewrite -lclangRewriteFrontend -lclangSema -lclangSerialization -lclangStaticAnalyzerCheckers -lclangStaticAnalyzerCore -lclangStaticAnalyzerFrontend -lclangTooling -lclangToolingCore -Wl,--end-group
120.2 warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Wunknown-warning-option]
121.9 In file included from main.cpp:30:
121.9 In file included from /tools/arduino-preprocessor/clang/include/clang/AST/AST.h:21:
121.9 /tools/arduino-preprocessor/clang/include/clang/AST/DeclObjC.h:389:46: warning: 'const_mem_fun_t<clang::QualType, clang::ParmVarDecl>' is deprecated [-Wdeprecated-declarations]
121.9 return llvm::map_iterator(param_begin(), deref_fun(&ParmVarDecl::getType));
121.9 ^
121.9 /usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/stl_function.h:1246:11: note: 'const_mem_fun_t<clang::QualType, clang::ParmVarDecl>' has been explicitly marked deprecated here
121.9 class const_mem_fun_t : public unary_function<const _Tp*, _Ret>
121.9 ^
121.9 In file included from main.cpp:30:
121.9 In file included from /tools/arduino-preprocessor/clang/include/clang/AST/AST.h:21:
121.9 /tools/arduino-preprocessor/clang/include/clang/AST/DeclObjC.h:392:44: warning: 'const_mem_fun_t<clang::QualType, clang::ParmVarDecl>' is deprecated [-Wdeprecated-declarations]
121.9 return llvm::map_iterator(param_end(), deref_fun(&ParmVarDecl::getType));
121.9 ^
121.9 /usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/stl_function.h:1246:11: note: 'const_mem_fun_t<clang::QualType, clang::ParmVarDecl>' has been explicitly marked deprecated here
121.9 class const_mem_fun_t : public unary_function<const _Tp*, _Ret>
121.9 ^
126.7 3 warnings generated.
126.8 warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Wunknown-warning-option]
128.3 In file included from ArduinoDiagnosticConsumer.cpp:32:
128.3 In file included from ./ArduinoDiagnosticConsumer.hpp:34:
128.3 In file included from ./IdentifiersList.hpp:32:
128.3 In file included from /tools/arduino-preprocessor/clang/include/clang/AST/AST.h:21:
128.3 /tools/arduino-preprocessor/clang/include/clang/AST/DeclObjC.h:389:46: warning: 'const_mem_fun_t<clang::QualType, clang::ParmVarDecl>' is deprecated [-Wdeprecated-declarations]
128.3 return llvm::map_iterator(param_begin(), deref_fun(&ParmVarDecl::getType));
128.3 ^
128.3 /usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/stl_function.h:1246:11: note: 'const_mem_fun_t<clang::QualType, clang::ParmVarDecl>' has been explicitly marked deprecated here
128.3 class const_mem_fun_t : public unary_function<const _Tp*, _Ret>
128.3 ^
128.3 In file included from ArduinoDiagnosticConsumer.cpp:32:
128.3 In file included from ./ArduinoDiagnosticConsumer.hpp:34:
128.3 In file included from ./IdentifiersList.hpp:32:
128.3 In file included from /tools/arduino-preprocessor/clang/include/clang/AST/AST.h:21:
128.3 /tools/arduino-preprocessor/clang/include/clang/AST/DeclObjC.h:392:44: warning: 'const_mem_fun_t<clang::QualType, clang::ParmVarDecl>' is deprecated [-Wdeprecated-declarations]
128.3 return llvm::map_iterator(param_end(), deref_fun(&ParmVarDecl::getType));
128.3 ^
128.3 /usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/stl_function.h:1246:11: note: 'const_mem_fun_t<clang::QualType, clang::ParmVarDecl>' has been explicitly marked deprecated here
128.3 class const_mem_fun_t : public unary_function<const _Tp*, _Ret>
128.3 ^
130.7 3 warnings generated.
130.7 warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Wunknown-warning-option]
132.3 CommandLine.cpp:84:32: error: cannot initialize a parameter of type 'void (*)()' with an lvalue of type 'void (llvm::raw_ostream &)': different number of parameters (0 vs 1)
132.3 cl::AddExtraVersionPrinter(printVersion);
132.3 ^~~~~~~~~~~~
132.3 /tools/arduino-preprocessor/clang/include/llvm/Support/CommandLine.h:78:36: note: passing argument to parameter 'func' here
132.3 void AddExtraVersionPrinter(void (*func)());
132.3 ^
132.7 1 warning and 1 error generated.
------