From 786b9f02efedca96a59bb532e1ce3bdaf07e9900 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Tue, 25 Aug 2020 22:24:52 +0000 Subject: [PATCH 01/40] Add iwyu to travis. --- .travis.yml | 19 ++++++++++++++++--- custom_iwyu.imp | 17 +++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 custom_iwyu.imp diff --git a/.travis.yml b/.travis.yml index 7ae7cfec..3f6da991 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,13 +45,18 @@ install: ../configure --enable-debug --disable-shared --disable-fastopen; elif [ "$VALGRIND" = "valgrind" ]; then ../configure --enable-debug --disable-fastopen --disable-valgrind-helgrind --disable-valgrind-drd --disable-valgrind-sgcheck; + elif [ "$IWYU" = "iwyu" ]; then + ../configure --disable-examples else ../configure --disable-fastopen; fi - - make + - if [ "$IWYU" = "iwyu" ]; then + make -k CXX='iwyu -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-isystem /usr/lib/llvm-6.0/lib/clang/6.0.0/include -std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS"; + elif + make; + fi script: - - make check - - cat test/test-suite.log + - if [ "$IWYU" != "iwyu" ]; then make check; cat test/test-suite.log; fi - if [ "$VALGRIND" = "valgrind" ]; then make check-valgrind; fi; - if [ "$VALGRIND" = "valgrind" ]; then cat test/test-suite-memcheck.log; fi; - if [ "$TRAVIS_OS_NAME" = "linux" ]; then cd ../src/; cppcheck --error-exitcode=1 .; cd ../build; fi @@ -309,3 +314,11 @@ matrix: - clang-9 env: - MATRIX_EVAL="CC=clang-9 && CXX=clang++-9" + - os: linux + addons: + apt: + packages: + - clang-6.0 + - iwyu + env: + - MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0 && IWYU=iwyu" diff --git a/custom_iwyu.imp b/custom_iwyu.imp new file mode 100644 index 00000000..e814a310 --- /dev/null +++ b/custom_iwyu.imp @@ -0,0 +1,17 @@ +[ + { include: ["\"microhttpd.h\"", "private", "", "public"] }, + { include: ["", "private", "", "public"] }, + + { symbol: ["std::exception", "private", "", "public"]}, + { symbol: ["std::shared_ptr", "private", "", "public"]}, + { symbol: ["std::uint16_t", "private", "", "public"]}, + { symbol: ["std::uint64_t", "private", "", "public"]}, + { symbol: ["std::istringstream", "private", "", "public"]}, + { symbol: ["std::stringstream", "private", "", "public"]}, + { symbol: ["std::ifstream", "private", "", "public"]}, + + { symbol: ["uint16_t", "private", "", "public"]}, + { symbol: ["uint64_t", "private", "", "public"]}, + + { symbol: ["MHD_Connection", "private", "", "public"]}, +] From e90e1b22a6849a495748a77f047566beb1ddaefe Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Tue, 25 Aug 2020 22:38:37 +0000 Subject: [PATCH 02/40] Fix else statement on travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3f6da991..a90e716a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,7 +52,7 @@ install: fi - if [ "$IWYU" = "iwyu" ]; then make -k CXX='iwyu -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-isystem /usr/lib/llvm-6.0/lib/clang/6.0.0/include -std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS"; - elif + else make; fi script: From fc74d9376643e6271bcd49f3d88a152ebe93e249 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Tue, 25 Aug 2020 22:42:28 +0000 Subject: [PATCH 03/40] Fix typo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a90e716a..9b43a1f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,7 +46,7 @@ install: elif [ "$VALGRIND" = "valgrind" ]; then ../configure --enable-debug --disable-fastopen --disable-valgrind-helgrind --disable-valgrind-drd --disable-valgrind-sgcheck; elif [ "$IWYU" = "iwyu" ]; then - ../configure --disable-examples + ../configure --disable-examples; else ../configure --disable-fastopen; fi From 6191d1a721189bcff825166420898d98b6898f0b Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Tue, 25 Aug 2020 23:19:53 +0000 Subject: [PATCH 04/40] Letting iwyu find its system libraries --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9b43a1f4..c464e52d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,7 +51,7 @@ install: ../configure --disable-fastopen; fi - if [ "$IWYU" = "iwyu" ]; then - make -k CXX='iwyu -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-isystem /usr/lib/llvm-6.0/lib/clang/6.0.0/include -std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS"; + make -k CXX='iwyu -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS"; else make; fi From abf5c436532dcf6d2f28f067de9107711a197997 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 00:11:33 +0000 Subject: [PATCH 05/40] Print clang resource files --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index c464e52d..6f890e5d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,6 +51,7 @@ install: ../configure --disable-fastopen; fi - if [ "$IWYU" = "iwyu" ]; then + clang -print-resource-dir; make -k CXX='iwyu -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS"; else make; From 0d50ec83d695aac2522a21b2b73ae3cb44951f61 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 00:57:15 +0000 Subject: [PATCH 06/40] Specify correct clang include path to IWYU. Assumes clang-7 to be in use. --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6f890e5d..413b990e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,7 +52,7 @@ install: fi - if [ "$IWYU" = "iwyu" ]; then clang -print-resource-dir; - make -k CXX='iwyu -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS"; + make -k CXX='iwyu -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-isystem /usr/local/clang-7.0.0/lib/clang/7.0.0/include -std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS"; else make; fi @@ -319,7 +319,6 @@ matrix: addons: apt: packages: - - clang-6.0 - iwyu env: - - MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0 && IWYU=iwyu" + - MATRIX_EVAL="IWYU=iwyu" From ff84dfe28b4357b6ae5453effc39eb416ca3ddf3 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 05:12:00 +0000 Subject: [PATCH 07/40] Use iwyu from sources --- .travis.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 413b990e..09b4a6d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,15 @@ env: - LINKING="static" before_install: - eval "${MATRIX_EVAL}" + - if [ "$IWYU" = "iwyu" ]; then + git clone https://github.com/include-what-you-use/include-what-you-use.git; + cd include-what-you-use; + git checkout clang_7.0; + cd ../ mkdir build_iwyu && cd build_iwyu; + cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=/usr/lib/llvm-7 ../include-what-you-use; + make; + sudo make install; + fi - export LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/lib" - export PATH=$PATH:/usr/local/lib - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib @@ -319,6 +328,9 @@ matrix: addons: apt: packages: - - iwyu + - clang-7 + - llvm-7-dev + - libclang-7-dev + - libncurses-dev env: - - MATRIX_EVAL="IWYU=iwyu" + - MATRIX_EVAL="CC=clang-7 && CXX=clang++-7 && IWYU=iwyu" From 7bce61f50d5ec57954da8d37281c9bd14ea56b03 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 07:07:54 -0700 Subject: [PATCH 08/40] Added apt sources to travis to find packages --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 09b4a6d9..1467dcfa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,7 @@ before_install: cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=/usr/lib/llvm-7 ../include-what-you-use; make; sudo make install; + cd ..; fi - export LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/lib" - export PATH=$PATH:/usr/local/lib @@ -327,6 +328,9 @@ matrix: - os: linux addons: apt: + sources: + - llvm-toolchain-xenial-7 + - ubuntu-toolchain-r-test packages: - clang-7 - llvm-7-dev From 3a4527bde05290f356e4aea2a5ea706355e2d48d Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 07:51:51 -0700 Subject: [PATCH 09/40] Fix iwyu commands --- .travis.yml | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1467dcfa..d141a2d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,15 +11,18 @@ env: - LINKING="static" before_install: - eval "${MATRIX_EVAL}" - - if [ "$IWYU" = "iwyu" ]; then - git clone https://github.com/include-what-you-use/include-what-you-use.git; - cd include-what-you-use; - git checkout clang_7.0; - cd ../ mkdir build_iwyu && cd build_iwyu; - cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=/usr/lib/llvm-7 ../include-what-you-use; - make; - sudo make install; - cd ..; + - | + if [ "$IWYU" = "iwyu" ]; then + git clone https://github.com/include-what-you-use/include-what-you-use.git ; + cd include-what-you-use ; + git checkout clang_7.0 ; + cd .. ; + mkdir build_iwyu ; + cd build_iwyu ; + cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=/usr/lib/llvm-7 ../include-what-you-use ; + make ; + sudo make install ; + cd .. ; fi - export LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/lib" - export PATH=$PATH:/usr/local/lib @@ -47,7 +50,8 @@ install: - ./bootstrap - mkdir build - cd build - - if [ "$LINKING" = "static" ]; then + - | + if [ "$LINKING" = "static" ]; then ../configure --enable-static --disable-fastopen; elif [ "$DEBUG" = "debug" ] && [ "$COVERAGE" = "coverage" ]; then ../configure --enable-debug --enable-coverage --disable-shared --disable-fastopen; @@ -60,7 +64,8 @@ install: else ../configure --disable-fastopen; fi - - if [ "$IWYU" = "iwyu" ]; then + - | + if [ "$IWYU" = "iwyu" ]; then clang -print-resource-dir; make -k CXX='iwyu -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-isystem /usr/local/clang-7.0.0/lib/clang/7.0.0/include -std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS"; else From a637da69efc4dbc64e04a31699cccea3aa278165 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 08:53:52 -0700 Subject: [PATCH 10/40] Print more clang and iwyu paths --- .travis.yml | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index d141a2d4..4b5184c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,19 +11,6 @@ env: - LINKING="static" before_install: - eval "${MATRIX_EVAL}" - - | - if [ "$IWYU" = "iwyu" ]; then - git clone https://github.com/include-what-you-use/include-what-you-use.git ; - cd include-what-you-use ; - git checkout clang_7.0 ; - cd .. ; - mkdir build_iwyu ; - cd build_iwyu ; - cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=/usr/lib/llvm-7 ../include-what-you-use ; - make ; - sudo make install ; - cd .. ; - fi - export LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/lib" - export PATH=$PATH:/usr/local/lib - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib @@ -66,7 +53,10 @@ install: fi - | if [ "$IWYU" = "iwyu" ]; then - clang -print-resource-dir; + clang -print-resource-dir ; + include-what-you-use -print-resource-dir ; + which clang ; + which include-what-you-use ; make -k CXX='iwyu -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-isystem /usr/local/clang-7.0.0/lib/clang/7.0.0/include -std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS"; else make; @@ -337,9 +327,6 @@ matrix: - llvm-toolchain-xenial-7 - ubuntu-toolchain-r-test packages: - - clang-7 - - llvm-7-dev - - libclang-7-dev - - libncurses-dev + - iwyu env: - MATRIX_EVAL="CC=clang-7 && CXX=clang++-7 && IWYU=iwyu" From e7b36db8b14f929fac5e65bb5ac8f155830e4769 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 09:33:52 -0700 Subject: [PATCH 11/40] Reducing scope of build to only the interested one --- .travis.yml | 467 ++++++++++++++++++++++++++-------------------------- 1 file changed, 234 insertions(+), 233 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4b5184c0..c52de51d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: cpp os: - linux - - osx -compiler: - - gcc - - clang +# - osx +#compiler: +# - gcc +# - clang env: - DEBUG="debug" COVERAGE="coverage" - DEBUG="nodebug" COVERAGE="nocoverage" @@ -91,235 +91,235 @@ matrix: - compiler: clang env: DEBUG="debug" COVERAGE="coverage" include: - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.8 - packages: - - clang-3.8 - env: MATRIX_EVAL="BUILD_TYPE=asan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage" - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.8 - packages: - - clang-3.8 - env: MATRIX_EVAL="BUILD_TYPE=msan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage" - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.8 - packages: - - clang-3.8 - env: MATRIX_EVAL="BUILD_TYPE=lsan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage" - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.8 - packages: - - clang-3.8 - env: MATRIX_EVAL="BUILD_TYPE=tsan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage" - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.8 - packages: - - clang-3.8 - env: MATRIX_EVAL="BUILD_TYPE=ubsan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage" - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-5 - env: - - MATRIX_EVAL="CC=gcc-5 && CXX=g++-5" - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-6 - env: - - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6" - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-7 - env: - - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-8 - env: - - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-9 - env: - - MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-7 - - valgrind - - valgrind-dbg - env: - - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && VALGRIND=valgrind" - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-7 - - apache2-utils - env: - - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && PERFORMANCE=select" - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-7 - - apache2-utils - env: - - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && PERFORMANCE=nodelay" - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-7 - - apache2-utils - env: - - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && PERFORMANCE=threads" - # works on Precise and Trusty - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.6 - packages: - - clang-3.6 - env: - - MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6" - # works on Precise and Trusty - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.7 - packages: - - clang-3.7 - env: - - MATRIX_EVAL="CC=clang-3.7 && CXX=clang++-3.7" - # works on Precise and Trusty - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.8 - packages: - - clang-3.8 - env: - - MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8" - # works on Trusty - - os: linux - addons: - apt: - sources: - - llvm-toolchain-trusty-3.9 - packages: - - clang-3.9 - env: - - MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9" - # works on Trusty - - os: linux - addons: - apt: - packages: - - clang-4.0 - env: - - MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0" - # works on Trusty - - os: linux - addons: - apt: - packages: - - clang-5.0 - env: - - MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0" - - os: linux - addons: - apt: - packages: - - clang-6.0 - env: - - MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0" - - os: linux - addons: - apt: - sources: - - llvm-toolchain-xenial-7 - - ubuntu-toolchain-r-test - packages: - - clang-7 - env: - - MATRIX_EVAL="CC=clang-7 && CXX=clang++-7" - - os: linux - addons: - apt: - sources: - - llvm-toolchain-xenial-8 - - ubuntu-toolchain-r-test - packages: - - clang-8 - env: - - MATRIX_EVAL="CC=clang-8 && CXX=clang++-8" - - os: linux - addons: - apt: - sources: - - llvm-toolchain-xenial-9 - - ubuntu-toolchain-r-test - - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main' - key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' - packages: - - clang-9 - env: - - MATRIX_EVAL="CC=clang-9 && CXX=clang++-9" +# - os: linux +# addons: +# apt: +# sources: +# - ubuntu-toolchain-r-test +# - llvm-toolchain-precise-3.8 +# packages: +# - clang-3.8 +# env: MATRIX_EVAL="BUILD_TYPE=asan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage" +# - os: linux +# addons: +# apt: +# sources: +# - ubuntu-toolchain-r-test +# - llvm-toolchain-precise-3.8 +# packages: +# - clang-3.8 +# env: MATRIX_EVAL="BUILD_TYPE=msan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage" +# - os: linux +# addons: +# apt: +# sources: +# - ubuntu-toolchain-r-test +# - llvm-toolchain-precise-3.8 +# packages: +# - clang-3.8 +# env: MATRIX_EVAL="BUILD_TYPE=lsan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage" +# - os: linux +# addons: +# apt: +# sources: +# - ubuntu-toolchain-r-test +# - llvm-toolchain-precise-3.8 +# packages: +# - clang-3.8 +# env: MATRIX_EVAL="BUILD_TYPE=tsan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage" +# - os: linux +# addons: +# apt: +# sources: +# - ubuntu-toolchain-r-test +# - llvm-toolchain-precise-3.8 +# packages: +# - clang-3.8 +# env: MATRIX_EVAL="BUILD_TYPE=ubsan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage" +# - os: linux +# addons: +# apt: +# sources: +# - ubuntu-toolchain-r-test +# packages: +# - g++-5 +# env: +# - MATRIX_EVAL="CC=gcc-5 && CXX=g++-5" +# - os: linux +# addons: +# apt: +# sources: +# - ubuntu-toolchain-r-test +# packages: +# - g++-6 +# env: +# - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6" +# - os: linux +# addons: +# apt: +# sources: +# - ubuntu-toolchain-r-test +# packages: +# - g++-7 +# env: +# - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" +# - os: linux +# addons: +# apt: +# sources: +# - ubuntu-toolchain-r-test +# packages: +# - g++-8 +# env: +# - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" +# - os: linux +# addons: +# apt: +# sources: +# - ubuntu-toolchain-r-test +# packages: +# - g++-9 +# env: +# - MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" +# - os: linux +# addons: +# apt: +# sources: +# - ubuntu-toolchain-r-test +# packages: +# - g++-7 +# - valgrind +# - valgrind-dbg +# env: +# - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && VALGRIND=valgrind" +# - os: linux +# addons: +# apt: +# sources: +# - ubuntu-toolchain-r-test +# packages: +# - g++-7 +# - apache2-utils +# env: +# - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && PERFORMANCE=select" +# - os: linux +# addons: +# apt: +# sources: +# - ubuntu-toolchain-r-test +# packages: +# - g++-7 +# - apache2-utils +# env: +# - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && PERFORMANCE=nodelay" +# - os: linux +# addons: +# apt: +# sources: +# - ubuntu-toolchain-r-test +# packages: +# - g++-7 +# - apache2-utils +# env: +# - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && PERFORMANCE=threads" +# # works on Precise and Trusty +# - os: linux +# addons: +# apt: +# sources: +# - ubuntu-toolchain-r-test +# - llvm-toolchain-precise-3.6 +# packages: +# - clang-3.6 +# env: +# - MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6" +# # works on Precise and Trusty +# - os: linux +# addons: +# apt: +# sources: +# - ubuntu-toolchain-r-test +# - llvm-toolchain-precise-3.7 +# packages: +# - clang-3.7 +# env: +# - MATRIX_EVAL="CC=clang-3.7 && CXX=clang++-3.7" +# # works on Precise and Trusty +# - os: linux +# addons: +# apt: +# sources: +# - ubuntu-toolchain-r-test +# - llvm-toolchain-precise-3.8 +# packages: +# - clang-3.8 +# env: +# - MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8" +# # works on Trusty +# - os: linux +# addons: +# apt: +# sources: +# - llvm-toolchain-trusty-3.9 +# packages: +# - clang-3.9 +# env: +# - MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9" +# # works on Trusty +# - os: linux +# addons: +# apt: +# packages: +# - clang-4.0 +# env: +# - MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0" +# # works on Trusty +# - os: linux +# addons: +# apt: +# packages: +# - clang-5.0 +# env: +# - MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0" +# - os: linux +# addons: +# apt: +# packages: +# - clang-6.0 +# env: +# - MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0" +# - os: linux +# addons: +# apt: +# sources: +# - llvm-toolchain-xenial-7 +# - ubuntu-toolchain-r-test +# packages: +# - clang-7 +# env: +# - MATRIX_EVAL="CC=clang-7 && CXX=clang++-7" +# - os: linux +# addons: +# apt: +# sources: +# - llvm-toolchain-xenial-8 +# - ubuntu-toolchain-r-test +# packages: +# - clang-8 +# env: +# - MATRIX_EVAL="CC=clang-8 && CXX=clang++-8" +# - os: linux +# addons: +# apt: +# sources: +# - llvm-toolchain-xenial-9 +# - ubuntu-toolchain-r-test +# - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main' +# key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' +# packages: +# - clang-9 +# env: +# - MATRIX_EVAL="CC=clang-9 && CXX=clang++-9" - os: linux addons: apt: @@ -328,5 +328,6 @@ matrix: - ubuntu-toolchain-r-test packages: - iwyu + - clang-7 env: - MATRIX_EVAL="CC=clang-7 && CXX=clang++-7 && IWYU=iwyu" From ab742d4840669504205747c6da85ec29e35d4e3d Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 09:34:23 -0700 Subject: [PATCH 12/40] Add compiler --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c52de51d..83bc1122 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,9 @@ language: cpp os: - linux # - osx -#compiler: +compiler: # - gcc -# - clang + - clang env: - DEBUG="debug" COVERAGE="coverage" - DEBUG="nodebug" COVERAGE="nocoverage" From bc1e4a6c3cfe55bf8112a38a96476929b1276a77 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 09:35:36 -0700 Subject: [PATCH 13/40] Exclude combinatorial ENVs --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 83bc1122..2b03178e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,10 @@ os: compiler: # - gcc - clang -env: - - DEBUG="debug" COVERAGE="coverage" - - DEBUG="nodebug" COVERAGE="nocoverage" - - LINKING="static" +#env: +# - DEBUG="debug" COVERAGE="coverage" +# - DEBUG="nodebug" COVERAGE="nocoverage" +# - LINKING="static" before_install: - eval "${MATRIX_EVAL}" - export LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/lib" From 184d67f7bff49c44fdfda3435f9eae90408a6e22 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 09:52:16 -0700 Subject: [PATCH 14/40] Remove the rest of params for make to work --- .travis.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2b03178e..bcd89887 100644 --- a/.travis.yml +++ b/.travis.yml @@ -54,10 +54,9 @@ install: - | if [ "$IWYU" = "iwyu" ]; then clang -print-resource-dir ; - include-what-you-use -print-resource-dir ; which clang ; which include-what-you-use ; - make -k CXX='iwyu -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-isystem /usr/local/clang-7.0.0/lib/clang/7.0.0/include -std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS"; + make -k CXX='iwyu -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS"; else make; fi @@ -323,11 +322,7 @@ matrix: - os: linux addons: apt: - sources: - - llvm-toolchain-xenial-7 - - ubuntu-toolchain-r-test packages: - iwyu - - clang-7 env: - - MATRIX_EVAL="CC=clang-7 && CXX=clang++-7 && IWYU=iwyu" + - MATRIX_EVAL="IWYU=iwyu" From 34c1892cf3fca6b9a2a6c1cf87f8ad83f9f30267 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 10:18:22 -0700 Subject: [PATCH 15/40] Attempt to compile iwyu --- .travis.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.travis.yml b/.travis.yml index bcd89887..4595364c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,20 @@ compiler: # - LINKING="static" before_install: - eval "${MATRIX_EVAL}" + - if [ "$IWYU" = "iwyu" ]; then + CLANG_VERSION=`ls -t /usr/lib/ | grep '^llvm-' | head -n 1 | sed -E 's/llvm-(.+)/\1/'` ; + CLANG_PREFIX_PATH=`llvm-config-$VERSION --prefix` ; + CLANG_BIN_PATH=`llvm-config-$VERSION --bindir` ; + git clone https://github.com/include-what-you-use/include-what-you-use.git ; + cd include-what-you-use ; + git checkout clang_${VERSION}.0 ; + cd .. ; + mkdir build_iwyu ; + cd build_iwyu ; + cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$CLANG_PREFIX_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../include-what-you-use ; + make ; + sudo make install ; + fi - export LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/lib" - export PATH=$PATH:/usr/local/lib - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib @@ -56,6 +70,8 @@ install: clang -print-resource-dir ; which clang ; which include-what-you-use ; + sudo updatedb ; + locate stdarg.h ; make -k CXX='iwyu -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS"; else make; @@ -320,6 +336,7 @@ matrix: # env: # - MATRIX_EVAL="CC=clang-9 && CXX=clang++-9" - os: linux + compiler: clang addons: apt: packages: From f064b0d8e2df181580d76e038da032ce8d0dadb3 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 10:43:40 -0700 Subject: [PATCH 16/40] Fetch clang version from system --- .travis.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4595364c..2586c596 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,12 +12,16 @@ compiler: before_install: - eval "${MATRIX_EVAL}" - if [ "$IWYU" = "iwyu" ]; then - CLANG_VERSION=`ls -t /usr/lib/ | grep '^llvm-' | head -n 1 | sed -E 's/llvm-(.+)/\1/'` ; - CLANG_PREFIX_PATH=`llvm-config-$VERSION --prefix` ; - CLANG_BIN_PATH=`llvm-config-$VERSION --bindir` ; + CLANG_VERSION=`ls -t /usr/bin/ | grep '^clang-' | head -n 1 | sed -E 's/clang-(.+)/\1/'` ; + CLANG_PREFIX_PATH=`/usr/lib/clang/${CLANG_VERSION}` ; + CLANG_BIN_PATH=`/usr/lib/llvm-${CLANG_VERSION}/bin/clang` ; git clone https://github.com/include-what-you-use/include-what-you-use.git ; cd include-what-you-use ; - git checkout clang_${VERSION}.0 ; + if "$VERSION" | sed 's/\.0$//'; then + git checkout clang_${VERSION} ; + else + git checkout clang_${VERSION}.0 ; + fi; cd .. ; mkdir build_iwyu ; cd build_iwyu ; From 97200f4945dccbfc14315e875e89d1725d5291b9 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 10:50:11 -0700 Subject: [PATCH 17/40] Fix version sourcing --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2586c596..ef7ef20c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,10 +17,11 @@ before_install: CLANG_BIN_PATH=`/usr/lib/llvm-${CLANG_VERSION}/bin/clang` ; git clone https://github.com/include-what-you-use/include-what-you-use.git ; cd include-what-you-use ; - if "$VERSION" | sed 's/\.0$//'; then - git checkout clang_${VERSION} ; + echo "$CLANG_VERSION" | grep '\.0$' + if [$? -eq 0]; then + git checkout clang_${CLANG_VERSION} ; else - git checkout clang_${VERSION}.0 ; + git checkout clang_${CLANG_VERSION}.0 ; fi; cd .. ; mkdir build_iwyu ; From d60e35161d25d18f27bbae95fcf5cedd1c31cedd Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 10:53:35 -0700 Subject: [PATCH 18/40] Fix paths --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ef7ef20c..d8d243e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,8 @@ before_install: - eval "${MATRIX_EVAL}" - if [ "$IWYU" = "iwyu" ]; then CLANG_VERSION=`ls -t /usr/bin/ | grep '^clang-' | head -n 1 | sed -E 's/clang-(.+)/\1/'` ; - CLANG_PREFIX_PATH=`/usr/lib/clang/${CLANG_VERSION}` ; - CLANG_BIN_PATH=`/usr/lib/llvm-${CLANG_VERSION}/bin/clang` ; + CLANG_PREFIX_PATH="/usr/lib/clang/${CLANG_VERSION}" ; + CLANG_BIN_PATH="/usr/lib/llvm-${CLANG_VERSION}/bin/clang" ; git clone https://github.com/include-what-you-use/include-what-you-use.git ; cd include-what-you-use ; echo "$CLANG_VERSION" | grep '\.0$' From 2b995565f41729326aad7a5d3613c06186847049 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 11:14:38 -0700 Subject: [PATCH 19/40] Fix versions using llvm --- .travis.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index d8d243e7..c0b68cc7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,13 +12,13 @@ compiler: before_install: - eval "${MATRIX_EVAL}" - if [ "$IWYU" = "iwyu" ]; then - CLANG_VERSION=`ls -t /usr/bin/ | grep '^clang-' | head -n 1 | sed -E 's/clang-(.+)/\1/'` ; - CLANG_PREFIX_PATH="/usr/lib/clang/${CLANG_VERSION}" ; - CLANG_BIN_PATH="/usr/lib/llvm-${CLANG_VERSION}/bin/clang" ; + CLANG_VERSION=`ls -t /usr/lib/ | grep '^llvm-' | head -n 1 | sed -E 's/llvm-(.+)/\1/'` ; + CLANG_PREFIX_PATH="/usr/lib/llvm-${CLANG_VERSION}/" ; + CLANG_BIN_PATH="/usr/lib/llvm-${CLANG_VERSION}/bin/" ; git clone https://github.com/include-what-you-use/include-what-you-use.git ; cd include-what-you-use ; echo "$CLANG_VERSION" | grep '\.0$' - if [$? -eq 0]; then + if [ $? -eq 0 ]; then git checkout clang_${CLANG_VERSION} ; else git checkout clang_${CLANG_VERSION}.0 ; @@ -344,7 +344,13 @@ matrix: compiler: clang addons: apt: + sources: + - llvm-toolchain-xenial-7 + - ubuntu-toolchain-r-test packages: - iwyu + - cmake + - llvm-dev + - libclang-dev env: - MATRIX_EVAL="IWYU=iwyu" From b4b0434b00c1ee73d2a93c0c2705390ad0f275a1 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 11:18:11 -0700 Subject: [PATCH 20/40] Added missing semicolon --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c0b68cc7..2798e5e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ before_install: CLANG_BIN_PATH="/usr/lib/llvm-${CLANG_VERSION}/bin/" ; git clone https://github.com/include-what-you-use/include-what-you-use.git ; cd include-what-you-use ; - echo "$CLANG_VERSION" | grep '\.0$' + echo "$CLANG_VERSION" | grep '\.0$' ; if [ $? -eq 0 ]; then git checkout clang_${CLANG_VERSION} ; else From 3913a033a992fa1a6b61b5bd07c238565d6c3da3 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 11:23:30 -0700 Subject: [PATCH 21/40] Fix version check --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2798e5e5..609e6d2e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ before_install: CLANG_BIN_PATH="/usr/lib/llvm-${CLANG_VERSION}/bin/" ; git clone https://github.com/include-what-you-use/include-what-you-use.git ; cd include-what-you-use ; - echo "$CLANG_VERSION" | grep '\.0$' ; + echo "$CLANG_VERSION" | grep '\.[0-9]$' ; if [ $? -eq 0 ]; then git checkout clang_${CLANG_VERSION} ; else From c96adce1cdcb0dba653a46d5f28571149eae3f2f Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 11:27:55 -0700 Subject: [PATCH 22/40] Fix and print paths --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 609e6d2e..1b490daa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,10 @@ before_install: - eval "${MATRIX_EVAL}" - if [ "$IWYU" = "iwyu" ]; then CLANG_VERSION=`ls -t /usr/lib/ | grep '^llvm-' | head -n 1 | sed -E 's/llvm-(.+)/\1/'` ; - CLANG_PREFIX_PATH="/usr/lib/llvm-${CLANG_VERSION}/" ; - CLANG_BIN_PATH="/usr/lib/llvm-${CLANG_VERSION}/bin/" ; + CLANG_PREFIX_PATH="/usr/lib/llvm-${CLANG_VERSION}" ; + CLANG_BIN_PATH="/usr/lib/llvm-${CLANG_VERSION}/bin" ; + ls -l $CLANG_PREFIX_PATH ; + ls -l $CLANG_BIN_PATH ; git clone https://github.com/include-what-you-use/include-what-you-use.git ; cd include-what-you-use ; echo "$CLANG_VERSION" | grep '\.[0-9]$' ; From 698419a59077fed95a7606f468db932caffa5df0 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 11:32:05 -0700 Subject: [PATCH 23/40] use llvm config to deduce paths --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1b490daa..523842ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,8 @@ before_install: - eval "${MATRIX_EVAL}" - if [ "$IWYU" = "iwyu" ]; then CLANG_VERSION=`ls -t /usr/lib/ | grep '^llvm-' | head -n 1 | sed -E 's/llvm-(.+)/\1/'` ; - CLANG_PREFIX_PATH="/usr/lib/llvm-${CLANG_VERSION}" ; - CLANG_BIN_PATH="/usr/lib/llvm-${CLANG_VERSION}/bin" ; + CLANG_PREFIX_PATH=`llvm-config-$CLANG_VERSION --prefix` ; + CLANG_BIN_PATH=`llvm-config-$CLANG_VERSION --bindir` ; ls -l $CLANG_PREFIX_PATH ; ls -l $CLANG_BIN_PATH ; git clone https://github.com/include-what-you-use/include-what-you-use.git ; From 43a99c305f67699a020e377421355dab1296e294 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 11:40:19 -0700 Subject: [PATCH 24/40] Find location of stddef.h --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 523842ae..1dcb717d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,8 @@ before_install: CLANG_VERSION=`ls -t /usr/lib/ | grep '^llvm-' | head -n 1 | sed -E 's/llvm-(.+)/\1/'` ; CLANG_PREFIX_PATH=`llvm-config-$CLANG_VERSION --prefix` ; CLANG_BIN_PATH=`llvm-config-$CLANG_VERSION --bindir` ; + sudo updatedb ; + locate stddef.h ; ls -l $CLANG_PREFIX_PATH ; ls -l $CLANG_BIN_PATH ; git clone https://github.com/include-what-you-use/include-what-you-use.git ; From 36e9e9c9e10181b63aa450745a567f0332717ba8 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 11:44:42 -0700 Subject: [PATCH 25/40] Print which clang --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 1dcb717d..9a158726 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,7 @@ before_install: CLANG_BIN_PATH=`llvm-config-$CLANG_VERSION --bindir` ; sudo updatedb ; locate stddef.h ; + which clang ; ls -l $CLANG_PREFIX_PATH ; ls -l $CLANG_BIN_PATH ; git clone https://github.com/include-what-you-use/include-what-you-use.git ; From 8a3a6943561a786eb989e6390091818919159b08 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 14:07:30 -0700 Subject: [PATCH 26/40] Fix version extraction --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9a158726..9e5f07a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,9 +12,9 @@ compiler: before_install: - eval "${MATRIX_EVAL}" - if [ "$IWYU" = "iwyu" ]; then - CLANG_VERSION=`ls -t /usr/lib/ | grep '^llvm-' | head -n 1 | sed -E 's/llvm-(.+)/\1/'` ; - CLANG_PREFIX_PATH=`llvm-config-$CLANG_VERSION --prefix` ; - CLANG_BIN_PATH=`llvm-config-$CLANG_VERSION --bindir` ; + CLANG_VERSION=`clang --version | grep version | cut -f3 -d' ' | cut -f1 -d'-' | cut -f1,2 -d'.'` ; + CLANG_PREFIX_PATH="/usr/local/clang-${CLANG_VERSION}/lib/clang/${CLANG_VERSION}/" ; + CLANG_BIN_PATH="/usr/local/clang-${CLANG_VERSION}/bin" ; sudo updatedb ; locate stddef.h ; which clang ; From 249b10deb009efd0330a606fb910a882bcb44619 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 14:12:19 -0700 Subject: [PATCH 27/40] Fix versioning further --- .travis.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9e5f07a3..bfcf2956 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,8 @@ compiler: before_install: - eval "${MATRIX_EVAL}" - if [ "$IWYU" = "iwyu" ]; then - CLANG_VERSION=`clang --version | grep version | cut -f3 -d' ' | cut -f1 -d'-' | cut -f1,2 -d'.'` ; + CLANG_VERSION=`clang --version | grep version | cut -f3 -d' ' | cut -f1 -d'-'` ; + CLANG_PKG_VERSION=`echo $CLANG_VERSION | cut -f1,2 -d'.'` CLANG_PREFIX_PATH="/usr/local/clang-${CLANG_VERSION}/lib/clang/${CLANG_VERSION}/" ; CLANG_BIN_PATH="/usr/local/clang-${CLANG_VERSION}/bin" ; sudo updatedb ; @@ -22,11 +23,11 @@ before_install: ls -l $CLANG_BIN_PATH ; git clone https://github.com/include-what-you-use/include-what-you-use.git ; cd include-what-you-use ; - echo "$CLANG_VERSION" | grep '\.[0-9]$' ; + echo "$CLANG_PKG_VERSION" | grep '\.[0-9]$' ; if [ $? -eq 0 ]; then - git checkout clang_${CLANG_VERSION} ; + git checkout clang_${CLANG_PKG_VERSION} ; else - git checkout clang_${CLANG_VERSION}.0 ; + git checkout clang_${CLANG_PKG_VERSION}.0 ; fi; cd .. ; mkdir build_iwyu ; From d4356aa0a0150b1b6f690a6b26a70644b36156ce Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 14:17:41 -0700 Subject: [PATCH 28/40] Fix binary name --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bfcf2956..e4edcccb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,6 +35,7 @@ before_install: cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$CLANG_PREFIX_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../include-what-you-use ; make ; sudo make install ; + cd .. ; fi - export LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/lib" - export PATH=$PATH:/usr/local/lib @@ -83,7 +84,7 @@ install: which include-what-you-use ; sudo updatedb ; locate stdarg.h ; - make -k CXX='iwyu -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS"; + make -k CXX='/usr/local/bin/include-what-you-use -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS"; else make; fi From 090e5edb1660d9bf94817fc4bf00fa619e3194d6 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 14:25:21 -0700 Subject: [PATCH 29/40] passing a system path to iwyu --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e4edcccb..b15ea389 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ before_install: - if [ "$IWYU" = "iwyu" ]; then CLANG_VERSION=`clang --version | grep version | cut -f3 -d' ' | cut -f1 -d'-'` ; CLANG_PKG_VERSION=`echo $CLANG_VERSION | cut -f1,2 -d'.'` - CLANG_PREFIX_PATH="/usr/local/clang-${CLANG_VERSION}/lib/clang/${CLANG_VERSION}/" ; + CLANG_PREFIX_PATH="/usr/local/clang-${CLANG_VERSION}/lib/clang/${CLANG_VERSION}" ; CLANG_BIN_PATH="/usr/local/clang-${CLANG_VERSION}/bin" ; sudo updatedb ; locate stddef.h ; @@ -84,7 +84,7 @@ install: which include-what-you-use ; sudo updatedb ; locate stdarg.h ; - make -k CXX='/usr/local/bin/include-what-you-use -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS"; + make -k CXX='/usr/local/bin/include-what-you-use -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-isystem ${CLANG_PREFIX_PATH}/include -std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS"; else make; fi From a536fa37ba8e1c259be12c541fcbfe2106333a11 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 14:35:42 -0700 Subject: [PATCH 30/40] Getting the config back to run all tests --- .travis.yml | 481 ++++++++++++++++++++++++++-------------------------- 1 file changed, 236 insertions(+), 245 deletions(-) diff --git a/.travis.yml b/.travis.yml index b15ea389..2822e411 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,26 +1,22 @@ language: cpp os: - linux -# - osx + - osx compiler: -# - gcc + - gcc - clang -#env: -# - DEBUG="debug" COVERAGE="coverage" -# - DEBUG="nodebug" COVERAGE="nocoverage" -# - LINKING="static" +env: + - DEBUG="debug" COVERAGE="coverage" + - DEBUG="nodebug" COVERAGE="nocoverage" + - LINKING="static" before_install: - eval "${MATRIX_EVAL}" + # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. - if [ "$IWYU" = "iwyu" ]; then CLANG_VERSION=`clang --version | grep version | cut -f3 -d' ' | cut -f1 -d'-'` ; CLANG_PKG_VERSION=`echo $CLANG_VERSION | cut -f1,2 -d'.'` CLANG_PREFIX_PATH="/usr/local/clang-${CLANG_VERSION}/lib/clang/${CLANG_VERSION}" ; CLANG_BIN_PATH="/usr/local/clang-${CLANG_VERSION}/bin" ; - sudo updatedb ; - locate stddef.h ; - which clang ; - ls -l $CLANG_PREFIX_PATH ; - ls -l $CLANG_BIN_PATH ; git clone https://github.com/include-what-you-use/include-what-you-use.git ; cd include-what-you-use ; echo "$CLANG_PKG_VERSION" | grep '\.[0-9]$' ; @@ -79,11 +75,6 @@ install: fi - | if [ "$IWYU" = "iwyu" ]; then - clang -print-resource-dir ; - which clang ; - which include-what-you-use ; - sudo updatedb ; - locate stdarg.h ; make -k CXX='/usr/local/bin/include-what-you-use -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-isystem ${CLANG_PREFIX_PATH}/include -std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS"; else make; @@ -118,235 +109,235 @@ matrix: - compiler: clang env: DEBUG="debug" COVERAGE="coverage" include: -# - os: linux -# addons: -# apt: -# sources: -# - ubuntu-toolchain-r-test -# - llvm-toolchain-precise-3.8 -# packages: -# - clang-3.8 -# env: MATRIX_EVAL="BUILD_TYPE=asan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage" -# - os: linux -# addons: -# apt: -# sources: -# - ubuntu-toolchain-r-test -# - llvm-toolchain-precise-3.8 -# packages: -# - clang-3.8 -# env: MATRIX_EVAL="BUILD_TYPE=msan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage" -# - os: linux -# addons: -# apt: -# sources: -# - ubuntu-toolchain-r-test -# - llvm-toolchain-precise-3.8 -# packages: -# - clang-3.8 -# env: MATRIX_EVAL="BUILD_TYPE=lsan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage" -# - os: linux -# addons: -# apt: -# sources: -# - ubuntu-toolchain-r-test -# - llvm-toolchain-precise-3.8 -# packages: -# - clang-3.8 -# env: MATRIX_EVAL="BUILD_TYPE=tsan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage" -# - os: linux -# addons: -# apt: -# sources: -# - ubuntu-toolchain-r-test -# - llvm-toolchain-precise-3.8 -# packages: -# - clang-3.8 -# env: MATRIX_EVAL="BUILD_TYPE=ubsan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage" -# - os: linux -# addons: -# apt: -# sources: -# - ubuntu-toolchain-r-test -# packages: -# - g++-5 -# env: -# - MATRIX_EVAL="CC=gcc-5 && CXX=g++-5" -# - os: linux -# addons: -# apt: -# sources: -# - ubuntu-toolchain-r-test -# packages: -# - g++-6 -# env: -# - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6" -# - os: linux -# addons: -# apt: -# sources: -# - ubuntu-toolchain-r-test -# packages: -# - g++-7 -# env: -# - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" -# - os: linux -# addons: -# apt: -# sources: -# - ubuntu-toolchain-r-test -# packages: -# - g++-8 -# env: -# - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" -# - os: linux -# addons: -# apt: -# sources: -# - ubuntu-toolchain-r-test -# packages: -# - g++-9 -# env: -# - MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" -# - os: linux -# addons: -# apt: -# sources: -# - ubuntu-toolchain-r-test -# packages: -# - g++-7 -# - valgrind -# - valgrind-dbg -# env: -# - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && VALGRIND=valgrind" -# - os: linux -# addons: -# apt: -# sources: -# - ubuntu-toolchain-r-test -# packages: -# - g++-7 -# - apache2-utils -# env: -# - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && PERFORMANCE=select" -# - os: linux -# addons: -# apt: -# sources: -# - ubuntu-toolchain-r-test -# packages: -# - g++-7 -# - apache2-utils -# env: -# - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && PERFORMANCE=nodelay" -# - os: linux -# addons: -# apt: -# sources: -# - ubuntu-toolchain-r-test -# packages: -# - g++-7 -# - apache2-utils -# env: -# - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && PERFORMANCE=threads" -# # works on Precise and Trusty -# - os: linux -# addons: -# apt: -# sources: -# - ubuntu-toolchain-r-test -# - llvm-toolchain-precise-3.6 -# packages: -# - clang-3.6 -# env: -# - MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6" -# # works on Precise and Trusty -# - os: linux -# addons: -# apt: -# sources: -# - ubuntu-toolchain-r-test -# - llvm-toolchain-precise-3.7 -# packages: -# - clang-3.7 -# env: -# - MATRIX_EVAL="CC=clang-3.7 && CXX=clang++-3.7" -# # works on Precise and Trusty -# - os: linux -# addons: -# apt: -# sources: -# - ubuntu-toolchain-r-test -# - llvm-toolchain-precise-3.8 -# packages: -# - clang-3.8 -# env: -# - MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8" -# # works on Trusty -# - os: linux -# addons: -# apt: -# sources: -# - llvm-toolchain-trusty-3.9 -# packages: -# - clang-3.9 -# env: -# - MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9" -# # works on Trusty -# - os: linux -# addons: -# apt: -# packages: -# - clang-4.0 -# env: -# - MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0" -# # works on Trusty -# - os: linux -# addons: -# apt: -# packages: -# - clang-5.0 -# env: -# - MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0" -# - os: linux -# addons: -# apt: -# packages: -# - clang-6.0 -# env: -# - MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0" -# - os: linux -# addons: -# apt: -# sources: -# - llvm-toolchain-xenial-7 -# - ubuntu-toolchain-r-test -# packages: -# - clang-7 -# env: -# - MATRIX_EVAL="CC=clang-7 && CXX=clang++-7" -# - os: linux -# addons: -# apt: -# sources: -# - llvm-toolchain-xenial-8 -# - ubuntu-toolchain-r-test -# packages: -# - clang-8 -# env: -# - MATRIX_EVAL="CC=clang-8 && CXX=clang++-8" -# - os: linux -# addons: -# apt: -# sources: -# - llvm-toolchain-xenial-9 -# - ubuntu-toolchain-r-test -# - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main' -# key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' -# packages: -# - clang-9 -# env: -# - MATRIX_EVAL="CC=clang-9 && CXX=clang++-9" + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.8 + packages: + - clang-3.8 + env: MATRIX_EVAL="BUILD_TYPE=asan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage" + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.8 + packages: + - clang-3.8 + env: MATRIX_EVAL="BUILD_TYPE=msan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage" + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.8 + packages: + - clang-3.8 + env: MATRIX_EVAL="BUILD_TYPE=lsan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage" + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.8 + packages: + - clang-3.8 + env: MATRIX_EVAL="BUILD_TYPE=tsan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage" + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.8 + packages: + - clang-3.8 + env: MATRIX_EVAL="BUILD_TYPE=ubsan && CC=clang-3.8 && CXX=clang++-3.8 && DEBUG=debug && COVERAGE=nocoverage" + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-5 + env: + - MATRIX_EVAL="CC=gcc-5 && CXX=g++-5" + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-6 + env: + - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6" + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-7 + env: + - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-8 + env: + - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-9 + env: + - MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-7 + - valgrind + - valgrind-dbg + env: + - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && VALGRIND=valgrind" + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-7 + - apache2-utils + env: + - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && PERFORMANCE=select" + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-7 + - apache2-utils + env: + - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && PERFORMANCE=nodelay" + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-7 + - apache2-utils + env: + - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && PERFORMANCE=threads" + # works on Precise and Trusty + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.6 + packages: + - clang-3.6 + env: + - MATRIX_EVAL="CC=clang-3.6 && CXX=clang++-3.6" + # works on Precise and Trusty + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.7 + packages: + - clang-3.7 + env: + - MATRIX_EVAL="CC=clang-3.7 && CXX=clang++-3.7" + # works on Precise and Trusty + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise-3.8 + packages: + - clang-3.8 + env: + - MATRIX_EVAL="CC=clang-3.8 && CXX=clang++-3.8" + # works on Trusty + - os: linux + addons: + apt: + sources: + - llvm-toolchain-trusty-3.9 + packages: + - clang-3.9 + env: + - MATRIX_EVAL="CC=clang-3.9 && CXX=clang++-3.9" + # works on Trusty + - os: linux + addons: + apt: + packages: + - clang-4.0 + env: + - MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0" + # works on Trusty + - os: linux + addons: + apt: + packages: + - clang-5.0 + env: + - MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0" + - os: linux + addons: + apt: + packages: + - clang-6.0 + env: + - MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0" + - os: linux + addons: + apt: + sources: + - llvm-toolchain-xenial-7 + - ubuntu-toolchain-r-test + packages: + - clang-7 + env: + - MATRIX_EVAL="CC=clang-7 && CXX=clang++-7" + - os: linux + addons: + apt: + sources: + - llvm-toolchain-xenial-8 + - ubuntu-toolchain-r-test + packages: + - clang-8 + env: + - MATRIX_EVAL="CC=clang-8 && CXX=clang++-8" + - os: linux + addons: + apt: + sources: + - llvm-toolchain-xenial-9 + - ubuntu-toolchain-r-test + - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main' + key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' + packages: + - clang-9 + env: + - MATRIX_EVAL="CC=clang-9 && CXX=clang++-9" - os: linux compiler: clang addons: From 840691ebb8987378480afca51cad251b643f1637 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 22:58:36 +0000 Subject: [PATCH 31/40] Fix codebase to pass IWYU checks. --- src/basic_auth_fail_response.cpp | 4 +++ src/deferred_response.cpp | 3 +++ src/details/http_endpoint.cpp | 10 ++++++-- src/digest_auth_fail_response.cpp | 4 +++ src/file_response.cpp | 6 ++++- src/http_request.cpp | 4 +-- src/http_resource.cpp | 11 +++----- src/http_response.cpp | 10 ++------ src/http_utils.cpp | 8 +++--- src/httpserver/basic_auth_fail_response.hpp | 5 ++++ src/httpserver/deferred_response.hpp | 8 +++++- src/httpserver/digest_auth_fail_response.hpp | 5 ++++ src/httpserver/file_response.hpp | 4 +++ src/httpserver/http_request.hpp | 4 +++ src/httpserver/http_resource.hpp | 18 +++++-------- src/httpserver/http_response.hpp | 4 --- src/httpserver/string_response.hpp | 5 ++++ src/httpserver/webserver.hpp | 27 ++++++++------------ src/string_response.cpp | 4 +++ src/string_utilities.cpp | 3 --- src/webserver.cpp | 15 +++-------- 21 files changed, 89 insertions(+), 73 deletions(-) diff --git a/src/basic_auth_fail_response.cpp b/src/basic_auth_fail_response.cpp index 500fceb6..49d9f5a9 100644 --- a/src/basic_auth_fail_response.cpp +++ b/src/basic_auth_fail_response.cpp @@ -19,6 +19,10 @@ */ #include "httpserver/basic_auth_fail_response.hpp" +#include + +struct MHD_Connection; +struct MHD_Response; using namespace std; diff --git a/src/deferred_response.cpp b/src/deferred_response.cpp index 08033c80..f3d44527 100644 --- a/src/deferred_response.cpp +++ b/src/deferred_response.cpp @@ -19,6 +19,9 @@ */ #include "httpserver/deferred_response.hpp" +#include + +struct MHD_Response; using namespace std; diff --git a/src/details/http_endpoint.cpp b/src/details/http_endpoint.cpp index be76ddde..584fb507 100644 --- a/src/details/http_endpoint.cpp +++ b/src/details/http_endpoint.cpp @@ -18,12 +18,18 @@ USA */ +#include +#include +#include +#include +#include #include +#include +#include +#include #include "httpserver/details/http_endpoint.hpp" - #include "httpserver/http_utils.hpp" -#include "httpserver/string_utilities.hpp" using namespace std; diff --git a/src/digest_auth_fail_response.cpp b/src/digest_auth_fail_response.cpp index d2fd5263..ca95526d 100644 --- a/src/digest_auth_fail_response.cpp +++ b/src/digest_auth_fail_response.cpp @@ -19,6 +19,10 @@ */ #include "httpserver/digest_auth_fail_response.hpp" +#include + +struct MHD_Connection; +struct MHD_Response; using namespace std; diff --git a/src/file_response.cpp b/src/file_response.cpp index 1503e4bd..66d13a1c 100644 --- a/src/file_response.cpp +++ b/src/file_response.cpp @@ -19,8 +19,12 @@ */ #include "httpserver/file_response.hpp" - #include +#include +#include +#include + +struct MHD_Response; using namespace std; diff --git a/src/http_request.cpp b/src/http_request.cpp index be342c7c..d7d8e2af 100644 --- a/src/http_request.cpp +++ b/src/http_request.cpp @@ -20,9 +20,9 @@ */ #include "httpserver/http_request.hpp" - +#include +#include #include - #include "httpserver/http_utils.hpp" #include "httpserver/string_utilities.hpp" diff --git a/src/http_resource.cpp b/src/http_resource.cpp index 0fc6402a..46bdb0de 100644 --- a/src/http_resource.cpp +++ b/src/http_resource.cpp @@ -19,15 +19,10 @@ */ #include "httpserver/http_resource.hpp" - -#include - -#include "httpserver/http_request.hpp" -#include "httpserver/http_response.hpp" -#include "httpserver/http_utils.hpp" +#include #include "httpserver/string_response.hpp" -#include "httpserver/string_utilities.hpp" -#include "httpserver/webserver.hpp" + +namespace httpserver { class http_response; } using namespace std; diff --git a/src/http_response.cpp b/src/http_response.cpp index c502f2ac..2d261e3d 100644 --- a/src/http_response.cpp +++ b/src/http_response.cpp @@ -19,16 +19,10 @@ */ #include "httpserver/http_response.hpp" - -#include -#include -#include -#include +#include #include -#include - +#include #include "httpserver/http_utils.hpp" -#include "httpserver/webserver.hpp" using namespace std; diff --git a/src/http_utils.cpp b/src/http_utils.cpp index c9d3aa66..05b461df 100644 --- a/src/http_utils.cpp +++ b/src/http_utils.cpp @@ -34,12 +34,14 @@ #include #endif // WIN32 check +#include "httpserver/http_utils.hpp" + #include #include -#include -#include #include -#include +#include +#include +#include #include #include #include diff --git a/src/httpserver/basic_auth_fail_response.hpp b/src/httpserver/basic_auth_fail_response.hpp index c7e2d476..a28fa3d9 100644 --- a/src/httpserver/basic_auth_fail_response.hpp +++ b/src/httpserver/basic_auth_fail_response.hpp @@ -25,8 +25,13 @@ #ifndef _BASIC_AUTH_FAIL_RESPONSE_HPP_ #define _BASIC_AUTH_FAIL_RESPONSE_HPP_ +#include +#include "http_utils.hpp" #include "httpserver/string_response.hpp" +struct MHD_Connection; +struct MHD_Response; + namespace httpserver { diff --git a/src/httpserver/deferred_response.hpp b/src/httpserver/deferred_response.hpp index 2193f960..9e4601e2 100644 --- a/src/httpserver/deferred_response.hpp +++ b/src/httpserver/deferred_response.hpp @@ -25,10 +25,16 @@ #ifndef _DEFERRED_RESPONSE_HPP_ #define _DEFERRED_RESPONSE_HPP_ +#include +#include +#include #include - +#include +#include "http_utils.hpp" #include "httpserver/string_response.hpp" +struct MHD_Response; + namespace httpserver { diff --git a/src/httpserver/digest_auth_fail_response.hpp b/src/httpserver/digest_auth_fail_response.hpp index 292f477b..50abcee2 100644 --- a/src/httpserver/digest_auth_fail_response.hpp +++ b/src/httpserver/digest_auth_fail_response.hpp @@ -25,8 +25,13 @@ #ifndef _DIGEST_AUTH_FAIL_RESPONSE_HPP_ #define _DIGEST_AUTH_FAIL_RESPONSE_HPP_ +#include +#include "http_utils.hpp" #include "httpserver/string_response.hpp" +struct MHD_Connection; +struct MHD_Response; + namespace httpserver { diff --git a/src/httpserver/file_response.hpp b/src/httpserver/file_response.hpp index cb80c114..0c9386fb 100644 --- a/src/httpserver/file_response.hpp +++ b/src/httpserver/file_response.hpp @@ -25,8 +25,12 @@ #ifndef _FILE_RESPONSE_HPP_ #define _FILE_RESPONSE_HPP_ +#include +#include "http_utils.hpp" #include "httpserver/http_response.hpp" +struct MHD_Response; + namespace httpserver { diff --git a/src/httpserver/http_request.hpp b/src/httpserver/http_request.hpp index 62e52751..1f8a733b 100644 --- a/src/httpserver/http_request.hpp +++ b/src/httpserver/http_request.hpp @@ -25,6 +25,10 @@ #ifndef _HTTP_REQUEST_HPP_ #define _HTTP_REQUEST_HPP_ +#include + +#include +#include #include #include #include diff --git a/src/httpserver/http_resource.hpp b/src/httpserver/http_resource.hpp index 7841b96b..04f67cb8 100644 --- a/src/httpserver/http_resource.hpp +++ b/src/httpserver/http_resource.hpp @@ -28,24 +28,18 @@ #ifdef DEBUG #include #endif + #include #include #include +#include -#include "httpserver/http_response.hpp" - -namespace httpserver -{ +namespace httpserver { class http_request; } +namespace httpserver { class http_response; } -class webserver; -class http_request; +namespace httpserver { -namespace details -{ - -std::shared_ptr empty_render(const http_request& r); - -}; +namespace details { std::shared_ptr empty_render(const http_request& r); }; /** * Class representing a callable http resource. diff --git a/src/httpserver/http_response.hpp b/src/httpserver/http_response.hpp index 33c1df42..1f3f0971 100644 --- a/src/httpserver/http_response.hpp +++ b/src/httpserver/http_response.hpp @@ -27,11 +27,7 @@ #include #include -#include #include -#include -#include - #include "httpserver/http_utils.hpp" struct MHD_Connection; diff --git a/src/httpserver/string_response.hpp b/src/httpserver/string_response.hpp index 1c2183d0..43e7580d 100644 --- a/src/httpserver/string_response.hpp +++ b/src/httpserver/string_response.hpp @@ -25,8 +25,13 @@ #ifndef _STRING_RESPONSE_HPP_ #define _STRING_RESPONSE_HPP_ +#include +#include +#include "http_utils.hpp" #include "httpserver/http_response.hpp" +struct MHD_Response; + namespace httpserver { diff --git a/src/httpserver/webserver.hpp b/src/httpserver/webserver.hpp index c1ca06de..c96d0481 100644 --- a/src/httpserver/webserver.hpp +++ b/src/httpserver/webserver.hpp @@ -30,35 +30,28 @@ #define NOT_METHOD_ERROR "Method not Acceptable" #define GENERIC_ERROR "Internal Error" +#include #include +#include +#include #include -#include -#include +#include #include #include #include -#include #include -#include -#include +#include "http_utils.hpp" #include "httpserver/create_webserver.hpp" #include "httpserver/details/http_endpoint.hpp" -#include "httpserver/http_response.hpp" -namespace httpserver { - -class http_resource; -class create_webserver; +namespace httpserver { class http_resource; } +namespace httpserver { class http_response; } +namespace httpserver { namespace details { struct modded_request; } } -namespace http { -struct ip_representation; -struct httpserver_ska; -}; +struct MHD_Connection; -namespace details { - struct modded_request; -} +namespace httpserver { /** * Class representing the webserver. Main class of the apis. diff --git a/src/string_response.cpp b/src/string_response.cpp index 7720d61b..75a557f8 100644 --- a/src/string_response.cpp +++ b/src/string_response.cpp @@ -19,6 +19,10 @@ */ #include "httpserver/string_response.hpp" +#include +#include + +struct MHD_Response; using namespace std; diff --git a/src/string_utilities.cpp b/src/string_utilities.cpp index c557fe06..a3937f2e 100644 --- a/src/string_utilities.cpp +++ b/src/string_utilities.cpp @@ -22,9 +22,6 @@ #include #include -#include -#include -#include #include #include #include diff --git a/src/webserver.cpp b/src/webserver.cpp index 6b7dd47f..38542f2a 100644 --- a/src/webserver.cpp +++ b/src/webserver.cpp @@ -31,26 +31,16 @@ #if defined(__CYGWIN__) #include #endif -#include +#include #include #endif #include -#include -#include #include #include -#include #include #include #include -#include -#include -#include -#include -#include -#include -#include #include #include #include @@ -67,7 +57,8 @@ #include "httpserver/http_response.hpp" #include "httpserver/http_utils.hpp" #include "httpserver/string_response.hpp" -#include "httpserver/string_utilities.hpp" + +struct MHD_Connection; #define _REENTRANT 1 From ae437b56f6205685f77da2aae21b794d0315904c Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 16:39:00 -0700 Subject: [PATCH 32/40] Fix import on http_utils.hpp --- src/httpserver/http_utils.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/httpserver/http_utils.hpp b/src/httpserver/http_utils.hpp index a8121977..ed89c011 100644 --- a/src/httpserver/http_utils.hpp +++ b/src/httpserver/http_utils.hpp @@ -43,9 +43,10 @@ #endif #include +#include +#include #include #include -#include #include #include #include From 3a43cae716a3797a7f0eb53e24966612d3786ae3 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 16:41:21 -0700 Subject: [PATCH 33/40] Fix includes in http_utils.cpp --- src/http_utils.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/http_utils.cpp b/src/http_utils.cpp index 05b461df..63a342fc 100644 --- a/src/http_utils.cpp +++ b/src/http_utils.cpp @@ -34,8 +34,6 @@ #include #endif // WIN32 check -#include "httpserver/http_utils.hpp" - #include #include #include From a400a70e5023419abab8338d2b56a4ef3b6b56ff Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 16:42:55 -0700 Subject: [PATCH 34/40] Fix imports in http_utils.hpp --- src/httpserver/http_request.hpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/httpserver/http_request.hpp b/src/httpserver/http_request.hpp index 1f8a733b..6aacbfe6 100644 --- a/src/httpserver/http_request.hpp +++ b/src/httpserver/http_request.hpp @@ -42,14 +42,6 @@ struct MHD_Connection; namespace httpserver { -class webserver; - -namespace http -{ - class header_comparator; - class arg_comparator; -}; - /** * Class representing an abstraction for an Http Request. It is used from classes using these apis to receive information through http protocol. **/ From 33b47b9fcb07e7c3fa6fcdc3dd76c315fc1e0c22 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 16:44:40 -0700 Subject: [PATCH 35/40] Remove ignore travis for appveyor A few more builds but it won't miss structural changes that involve travis by accident --- appveyor.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 4fc56074..c86df7e5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,13 +1,5 @@ platform: x64 -branches: - except: - - /.*travis.*/ -skip_commits: - message: /travis/ - files: - - .travis.yml - environment: matrix: - compiler: msys2 From 267f4522b6173bf4d43286d819dcdc9342c8ddb6 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 16:57:04 -0700 Subject: [PATCH 36/40] Fix broken include when building on mingw --- src/httpserver/http_utils.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/httpserver/http_utils.hpp b/src/httpserver/http_utils.hpp index ed89c011..6a30450e 100644 --- a/src/httpserver/http_utils.hpp +++ b/src/httpserver/http_utils.hpp @@ -43,8 +43,12 @@ #endif #include + #include +#if !defined(__MINGW32__) #include +#endif + #include #include #include From e158568e32b5dadd53a3bf8561db7601718f5676 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 16:57:47 -0700 Subject: [PATCH 37/40] Fix spacing --- src/httpserver/http_utils.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/httpserver/http_utils.hpp b/src/httpserver/http_utils.hpp index 6a30450e..e2aa0339 100644 --- a/src/httpserver/http_utils.hpp +++ b/src/httpserver/http_utils.hpp @@ -43,8 +43,8 @@ #endif #include - #include + #if !defined(__MINGW32__) #include #endif From b2f0b3f4c5808fead72ffef4126dda9efffd6213 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 16:58:12 -0700 Subject: [PATCH 38/40] Fix include for mingw in webserver.hpp --- src/httpserver/webserver.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/httpserver/webserver.hpp b/src/httpserver/webserver.hpp index c96d0481..02d626c5 100644 --- a/src/httpserver/webserver.hpp +++ b/src/httpserver/webserver.hpp @@ -35,7 +35,11 @@ #include #include #include + +#if !defined(__MINGW32__) #include +#endif + #include #include #include From 16fd75fe801ef1ae9700cc68d714608360bc5bb2 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 20:13:27 -0700 Subject: [PATCH 39/40] Avoid breaking when iwyu is fine --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2822e411..5aa66c2e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -73,9 +73,13 @@ install: else ../configure --disable-fastopen; fi + # Make or run iwyu. If running iwyu, check for the result code to be 2 (IWYU always returns an error code, if it is 2, no corrections are necessary). - | if [ "$IWYU" = "iwyu" ]; then - make -k CXX='/usr/local/bin/include-what-you-use -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-isystem ${CLANG_PREFIX_PATH}/include -std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS"; + make -k CXX='/usr/local/bin/include-what-you-use -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-isystem ${CLANG_PREFIX_PATH}/include -std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS" ; + if [ $? -ne 2 ]; then + return 1; + fi else make; fi From 287812e54428fc7d45432767a1acf777718a47ad Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Wed, 26 Aug 2020 20:38:01 -0700 Subject: [PATCH 40/40] Redundant include for FreeBSD (already included) --- src/http_utils.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/http_utils.cpp b/src/http_utils.cpp index 63a342fc..caefabc5 100644 --- a/src/http_utils.cpp +++ b/src/http_utils.cpp @@ -24,9 +24,6 @@ #include #include #else // WIN32 check -#if defined(__FreeBSD__) -#include -#endif // FreeBSD #include #include #include