From 0dc4ac883347634b93af931adfd57241045c1db8 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Fri, 26 Feb 2021 22:39:14 -0800 Subject: [PATCH 01/72] Add CI builds to github actions --- .github/workflows/verify-build.yml | 181 +++++++++++++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 .github/workflows/verify-build.yml diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml new file mode 100644 index 00000000..47ce93ae --- /dev/null +++ b/.github/workflows/verify-build.yml @@ -0,0 +1,181 @@ +name: "Verify Build" + +on: + push: + branches: [master] + pull_request: + # The branches below must be a subset of the branches above + branches: [master] + schedule: + - cron: '0 0 * * 0' + +jobs: + verify: + name: Verify + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + compiler: + - 'CC=gcc && CXX=g++' + - 'CC=clang && CXX=clang++' + env: + - 'DEBUG="debug" && COVERAGE="coverage"' + - 'DEBUG="nodebug" && COVERAGE="nocoverage"' + - 'LINKING="static"' + exclude: + - compiler: 'CC=clang && CXX=clang++' + env: 'DEBUG="debug" && COVERAGE="coverage"' + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # If this run was triggered by a pull request event, then checkout + # the head of the pull request instead of the merge commit. + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + # Extract combination of environment variables + - name: Apply environment variables + run: | + eval "${{ matrix.compiler }}" + eval "${{ matrix.env }}" + + # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. + - name: Install IWYU if requested + run: 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" ; + 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]$' ; + if [ $? -eq 0 ]; then + git checkout clang_${CLANG_PKG_VERSION} ; + else + git checkout clang_${CLANG_PKG_VERSION}.0 ; + fi; + 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 ; + cd .. ; + fi + + # Set paths + - run: | + 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 + export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib + + - name: Setup coverage dependencies (only on linux) + run: | + sudo apt-get install info install-info ; + sudo pip install codecov ; + sudo pip install gcovr ; + sudo apt-get install cppcheck ; + if: ${{ matrix.os == 'ubuntu-latest' }} + + # Additional flags on mac + - run: | + export CFLAGS='-mtune=generic' ; + export IPV6_TESTS_ENABLED="true" ; + if: ${{ matrix.os == 'macos-latest' }} + + - name: Install libmicrohttpd dependency + run: | + curl https://s3.amazonaws.com/libhttpserver/libmicrohttpd_releases/libmicrohttpd-0.9.59.tar.gz -o libmicrohttpd-0.9.59.tar.gz ; + tar -xzf libmicrohttpd-0.9.59.tar.gz ; + cd libmicrohttpd-0.9.59 ; + ./configure --disable-examples ; + make ; + sudo make install ; + cd .. ; + + - name: Set flags for memory checks + run: | + if [ "$BUILD_TYPE" = "asan" ]; then export CFLAGS='-fsanitize=address'; export CXXLAGS='-fsanitize=address'; export LDFLAGS='-fsanitize=address'; fi + if [ "$BUILD_TYPE" = "msan" ]; then export CFLAGS='-fsanitize=memory'; export CXXLAGS='-fsanitize=memory'; export LDFLAGS='-fsanitize=memory'; fi + if [ "$BUILD_TYPE" = "lsan" ]; then export CFLAGS='-fsanitize=leak'; export CXXLAGS='-fsanitize=leak'; export LDFLAGS='-fsanitize=leak'; fi + if [ "$BUILD_TYPE" = "tsan" ]; then export CFLAGS='-fsanitize=thread'; export CXXLAGS='-fsanitize=thread'; export LDFLAGS='-fsanitize=thread'; fi + if [ "$BUILD_TYPE" = "ubsan" ]; then export export CFLAGS='-fsanitize=undefined'; export CXXLAGS='-fsanitize=undefined'; export LDFLAGS='-fsanitize=undefined'; fi + + - name: Run libhttpserver configure + run: | + ./bootstrap ; + mkdir build ; + cd build ; + if [ "$LINKING" = "static" ]; then + ../configure --enable-static --disable-fastopen; + elif [ "$DEBUG" = "debug" ] && [ "$COVERAGE" = "coverage" ]; then + ../configure --enable-debug --enable-coverage --disable-shared --disable-fastopen; + elif [ "$DEBUG" = "debug" ]; then + ../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 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). + - name: Make or run IWYU + run: | + 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" ; + if [ $? -ne 2 ]; then + return 1; + fi + else + make; + fi + + - name: Run tests + run: if [ "$IWYU" != "iwyu" ]; then make check; cat test/test-suite.log; fi + + - name: Run Valgrind checks + run: if [ "$VALGRIND" = "valgrind" ]; then make check-valgrind; cat test/test-suite-memcheck.log; fi; + + - name: Run cppcheck + run: cd ../src/; cppcheck --error-exitcode=1 .; cd ../build; + if: ${{ matrix.os == 'ubuntu-latest' }} + + - name: Run performance tests (select) + run: | + if [ "$PERFORMANCE" = "select" ]; then + cd examples + ./benchmark_select 8080 $(nproc) & + sleep 5 && ab -n 10000000 -c 100 localhost:8080/plaintext + fi + + - name: Run performance tests (nodelay) + run: | + if [ "$PERFORMANCE" = "nodelay" ]; then + cd examples + ./benchmark_nodelay 8080 $(nproc) & + sleep 5 && ab -n 10000000 -c 100 localhost:8080/plaintext + fi + + - name: Run performance tests (threads) + run: | + if [ "$PERFORMANCE" = "threads" ]; then + cd examples + ./benchmark_threads 8080 & + sleep 5 && ab -n 10000000 -c 100 localhost:8080/plaintext + fi + + - name: Push code coverage data + run: if [ "$DEBUG" = "debug" ] && [ "$COVERAGE" = "coverage" ]; then bash <(curl -s https://codecov.io/bash); fi + if: ${{ matrix.os == 'ubuntu-latest' }} From db5ed2e25f37b39d96e66220dc185d59a2da69b1 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Fri, 26 Feb 2021 22:52:42 -0800 Subject: [PATCH 02/72] Ensures that make is run from build --- .github/workflows/verify-build.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 47ce93ae..25c10553 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -133,6 +133,7 @@ jobs: # 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). - name: Make or run IWYU run: | + cd build ; 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" ; if [ $? -ne 2 ]; then @@ -143,18 +144,19 @@ jobs: fi - name: Run tests - run: if [ "$IWYU" != "iwyu" ]; then make check; cat test/test-suite.log; fi + run: if [ "$IWYU" != "iwyu" ]; then cd build ; make check; cat test/test-suite.log; fi - name: Run Valgrind checks - run: if [ "$VALGRIND" = "valgrind" ]; then make check-valgrind; cat test/test-suite-memcheck.log; fi; + run: if [ "$VALGRIND" = "valgrind" ]; then cd build ; make check-valgrind; cat test/test-suite-memcheck.log; fi; - name: Run cppcheck - run: cd ../src/; cppcheck --error-exitcode=1 .; cd ../build; + run: cd src/; cppcheck --error-exitcode=1 .; if: ${{ matrix.os == 'ubuntu-latest' }} - name: Run performance tests (select) run: | if [ "$PERFORMANCE" = "select" ]; then + cd build cd examples ./benchmark_select 8080 $(nproc) & sleep 5 && ab -n 10000000 -c 100 localhost:8080/plaintext @@ -163,6 +165,7 @@ jobs: - name: Run performance tests (nodelay) run: | if [ "$PERFORMANCE" = "nodelay" ]; then + cd build cd examples ./benchmark_nodelay 8080 $(nproc) & sleep 5 && ab -n 10000000 -c 100 localhost:8080/plaintext @@ -171,11 +174,12 @@ jobs: - name: Run performance tests (threads) run: | if [ "$PERFORMANCE" = "threads" ]; then + cd build cd examples ./benchmark_threads 8080 & sleep 5 && ab -n 10000000 -c 100 localhost:8080/plaintext fi - name: Push code coverage data - run: if [ "$DEBUG" = "debug" ] && [ "$COVERAGE" = "coverage" ]; then bash <(curl -s https://codecov.io/bash); fi + run: if [ "$DEBUG" = "debug" ] && [ "$COVERAGE" = "coverage" ]; then cd build ; bash <(curl -s https://codecov.io/bash); fi if: ${{ matrix.os == 'ubuntu-latest' }} From 2039c960295fb2015455907c0f1bb4dbc4b62473 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Fri, 26 Feb 2021 23:08:01 -0800 Subject: [PATCH 03/72] Install CURL to support testing --- .github/workflows/verify-build.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 25c10553..e7251a1d 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -47,6 +47,20 @@ jobs: run: | eval "${{ matrix.compiler }}" eval "${{ matrix.env }}" + + - name: Install CURL (for testing on linux) + run: sudo apt-get install libcurl-dev + if: ${{ matrix.os == 'ubuntu-latest' }} + + - name: Install CURL (for testing on mac) + run: | + curl https://libhttpserver.s3.amazonaws.com/travis_stuff/curl-7.75.0.tar.gz -o curl-7.75.0.tar.gz ; + tar -xzf curl-7.75.0.tar.gz ; + cd curl-7.75.0 ; + ./configure ; + make ; + make install ; + if: ${{ matrix.os == 'macos-latest' }} # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. - name: Install IWYU if requested From 9f496ac5d6bf654f07f0e9aeaa6025b9d291cf09 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Fri, 26 Feb 2021 23:16:19 -0800 Subject: [PATCH 04/72] Fix tools installation --- .github/workflows/verify-build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index e7251a1d..2541e30d 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -49,7 +49,7 @@ jobs: eval "${{ matrix.env }}" - name: Install CURL (for testing on linux) - run: sudo apt-get install libcurl-dev + run: sudo apt-get install libcurl4-openssl-dev if: ${{ matrix.os == 'ubuntu-latest' }} - name: Install CURL (for testing on mac) @@ -61,6 +61,10 @@ jobs: make ; make install ; if: ${{ matrix.os == 'macos-latest' }} + + - name: Install autotools on mac + run: brew install autoconf automake libtool + if: ${{ matrix.os == 'macos-latest' }} # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. - name: Install IWYU if requested From c9c8d260cc92e615a10887186975ad458f4ea524 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Fri, 26 Feb 2021 23:33:08 -0800 Subject: [PATCH 05/72] Open 8080 port on the container Needed to run tests --- .github/workflows/verify-build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 2541e30d..844d2147 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -13,7 +13,9 @@ jobs: verify: name: Verify runs-on: ${{ matrix.os }} - + container: + ports: + - 8080 strategy: fail-fast: false matrix: From 8079f95b56b31e3c91b8ba2fdf12f428c9297bff Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Fri, 26 Feb 2021 23:42:23 -0800 Subject: [PATCH 06/72] Cannot set ports explicitly --- .github/workflows/verify-build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 844d2147..b712d838 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -13,9 +13,6 @@ jobs: verify: name: Verify runs-on: ${{ matrix.os }} - container: - ports: - - 8080 strategy: fail-fast: false matrix: From 55b8e7d81e82bc55d5737f93953f3e6f0c31f4c5 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Fri, 26 Feb 2021 23:53:53 -0800 Subject: [PATCH 07/72] Print tests results --- .github/workflows/verify-build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index b712d838..1e742571 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -13,6 +13,7 @@ jobs: verify: name: Verify runs-on: ${{ matrix.os }} + continue-on-error: true strategy: fail-fast: false matrix: @@ -161,7 +162,10 @@ jobs: fi - name: Run tests - run: if [ "$IWYU" != "iwyu" ]; then cd build ; make check; cat test/test-suite.log; fi + run: if [ "$IWYU" != "iwyu" ]; then cd build ; make check; fi + + - name: Print tests results + run: if [ "$IWYU" != "iwyu" ]; then cd build ; cat test/test-suite.log; fi - name: Run Valgrind checks run: if [ "$VALGRIND" = "valgrind" ]; then cd build ; make check-valgrind; cat test/test-suite-memcheck.log; fi; From b66be643ca81791040bab388910c624d16ee4d20 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 00:04:24 -0800 Subject: [PATCH 08/72] Print test logs on failure --- .github/workflows/verify-build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 1e742571..7390105e 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -13,7 +13,6 @@ jobs: verify: name: Verify runs-on: ${{ matrix.os }} - continue-on-error: true strategy: fail-fast: false matrix: @@ -41,6 +40,10 @@ jobs: # the head of the pull request instead of the merge commit. - run: git checkout HEAD^2 if: ${{ github.event_name == 'pull_request' }} + + # Add a conclusion action + - name: Workflow Conclusion Action + uses: technote-space/workflow-conclusion-action@v2.0.1 # Extract combination of environment variables - name: Apply environment variables @@ -166,6 +169,7 @@ jobs: - name: Print tests results run: if [ "$IWYU" != "iwyu" ]; then cd build ; cat test/test-suite.log; fi + if: env.WORKFLOW_CONCLUSION == 'failure' - name: Run Valgrind checks run: if [ "$VALGRIND" = "valgrind" ]; then cd build ; make check-valgrind; cat test/test-suite-memcheck.log; fi; From a31c6f83b2c5c0282d1854943369434d6a5d5ebc Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 00:12:21 -0800 Subject: [PATCH 09/72] Print log on failure --- .github/workflows/verify-build.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 7390105e..854a2568 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -40,10 +40,6 @@ jobs: # the head of the pull request instead of the merge commit. - run: git checkout HEAD^2 if: ${{ github.event_name == 'pull_request' }} - - # Add a conclusion action - - name: Workflow Conclusion Action - uses: technote-space/workflow-conclusion-action@v2.0.1 # Extract combination of environment variables - name: Apply environment variables @@ -165,11 +161,11 @@ jobs: fi - name: Run tests - run: if [ "$IWYU" != "iwyu" ]; then cd build ; make check; fi + run: if [ "$IWYU" != "iwyu" ]; then cd build ; make check; cat test/test-suite.log ; fi - name: Print tests results run: if [ "$IWYU" != "iwyu" ]; then cd build ; cat test/test-suite.log; fi - if: env.WORKFLOW_CONCLUSION == 'failure' + if: ${{ failure() }} - name: Run Valgrind checks run: if [ "$VALGRIND" = "valgrind" ]; then cd build ; make check-valgrind; cat test/test-suite-memcheck.log; fi; From 67e7f0f2bd6804c462355b5b4d4a90526c8fcb4c Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 00:17:46 -0800 Subject: [PATCH 10/72] Update lib dependencies --- .github/workflows/verify-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 854a2568..a742d348 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -118,7 +118,7 @@ jobs: ./configure --disable-examples ; make ; sudo make install ; - cd .. ; + sudo ldconfig ; - name: Set flags for memory checks run: | From 05563f0079f32d38ab69184246641ea058402cb9 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 00:29:18 -0800 Subject: [PATCH 11/72] Run ldconfig only on linux --- .github/workflows/verify-build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index a742d348..4aa384b3 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -118,7 +118,10 @@ jobs: ./configure --disable-examples ; make ; sudo make install ; - sudo ldconfig ; + + - name: Refresh links to shared libs + run: sudo ldconfig ; + if: ${{ matrix.os == 'ubuntu-latest' }} - name: Set flags for memory checks run: | From b604dbd822a36018a31047d6d9c1086ce9e0de04 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 09:49:55 -0800 Subject: [PATCH 12/72] Add caching for CURL on mac Speeds up builds --- .github/workflows/verify-build.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 4aa384b3..4022e081 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -51,14 +51,25 @@ jobs: run: sudo apt-get install libcurl4-openssl-dev if: ${{ matrix.os == 'ubuntu-latest' }} - - name: Install CURL (for testing on mac) + - name: CURL from cache (for testing on mac) + id: cache-CURL + uses: actions/cache@v2 + with: + path: curl-7.75.0.tar.gz + key: ${{ matrix.os }}-primes + if: ${{ matrix.os == 'macos-latest' }} + + - name: Build CURL (for testing on mac) run: | curl https://libhttpserver.s3.amazonaws.com/travis_stuff/curl-7.75.0.tar.gz -o curl-7.75.0.tar.gz ; tar -xzf curl-7.75.0.tar.gz ; cd curl-7.75.0 ; ./configure ; make ; - make install ; + if: steps.cache-CURL.outputs.cache-hit != 'true' + + - name: Install CURL (for testing on mac) + run: make install ; if: ${{ matrix.os == 'macos-latest' }} - name: Install autotools on mac From 05e1f7996326d54bafff2ec6c1be0af5d7775451 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 09:54:02 -0800 Subject: [PATCH 13/72] Restrict CURL building to mac only --- .github/workflows/verify-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 4022e081..9b463538 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -66,7 +66,7 @@ jobs: cd curl-7.75.0 ; ./configure ; make ; - if: steps.cache-CURL.outputs.cache-hit != 'true' + if: steps.cache-CURL.outputs.cache-hit != 'true' && ${{ matrix.os == 'macos-latest' }} - name: Install CURL (for testing on mac) run: make install ; From dda6504170db5511c6df757c53033ccc624abd5b Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 10:00:04 -0800 Subject: [PATCH 14/72] Always install curl from source --- .github/workflows/verify-build.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 9b463538..99c01bc7 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -47,30 +47,28 @@ jobs: eval "${{ matrix.compiler }}" eval "${{ matrix.env }}" - - name: Install CURL (for testing on linux) - run: sudo apt-get install libcurl4-openssl-dev - if: ${{ matrix.os == 'ubuntu-latest' }} + #- name: Install CURL (for testing on linux) + # run: sudo apt-get install libcurl4-openssl-dev + # if: ${{ matrix.os == 'ubuntu-latest' }} - - name: CURL from cache (for testing on mac) + - name: CURL from cache (for testing) id: cache-CURL uses: actions/cache@v2 with: path: curl-7.75.0.tar.gz - key: ${{ matrix.os }}-primes - if: ${{ matrix.os == 'macos-latest' }} + key: ${{ matrix.os }}-CURL - - name: Build CURL (for testing on mac) + - name: Build CURL (for testing) run: | curl https://libhttpserver.s3.amazonaws.com/travis_stuff/curl-7.75.0.tar.gz -o curl-7.75.0.tar.gz ; tar -xzf curl-7.75.0.tar.gz ; cd curl-7.75.0 ; ./configure ; make ; - if: steps.cache-CURL.outputs.cache-hit != 'true' && ${{ matrix.os == 'macos-latest' }} + if: steps.cache-CURL.outputs.cache-hit != 'true' - - name: Install CURL (for testing on mac) + - name: Install CURL (for testing) run: make install ; - if: ${{ matrix.os == 'macos-latest' }} - name: Install autotools on mac run: brew install autoconf automake libtool From 85c06abe6a558b8a9380256c2e1a9c9d568b35ed Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 11:57:39 -0800 Subject: [PATCH 15/72] fix curl install --- .github/workflows/verify-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 99c01bc7..d13f82a4 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -68,7 +68,7 @@ jobs: if: steps.cache-CURL.outputs.cache-hit != 'true' - name: Install CURL (for testing) - run: make install ; + run: cd curl-7.75.0 ; sudo make install ; - name: Install autotools on mac run: brew install autoconf automake libtool From 93f232ca924bee43d79daf224c65eed1a8831ba5 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 12:00:17 -0800 Subject: [PATCH 16/72] cache the entire curl directory --- .github/workflows/verify-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index d13f82a4..6fba395d 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -55,8 +55,8 @@ jobs: id: cache-CURL uses: actions/cache@v2 with: - path: curl-7.75.0.tar.gz - key: ${{ matrix.os }}-CURL + path: curl-7.75.0 + key: ${{ matrix.os }}-CURL-pre-built - name: Build CURL (for testing) run: | From 41cfd251dc6ed0943167698faeacb22bf2736bc8 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 12:05:40 -0800 Subject: [PATCH 17/72] ubuntu use system curl --- .github/workflows/verify-build.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 6fba395d..5fef3f12 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -67,9 +67,14 @@ jobs: make ; if: steps.cache-CURL.outputs.cache-hit != 'true' - - name: Install CURL (for testing) + - name: Install CURL (for testing on mac only) run: cd curl-7.75.0 ; sudo make install ; - + if: ${{ matrix.os == 'macos-latest' }} + + - name: Install CURL (for testing on linux) + run: sudo apt-get install libcurl4-openssl-dev + if: ${{ matrix.os == 'ubuntu-latest' }} + - name: Install autotools on mac run: brew install autoconf automake libtool if: ${{ matrix.os == 'macos-latest' }} From 4ea0839d4aef790a18a7866efd4c97957c612ccc Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 13:04:23 -0800 Subject: [PATCH 18/72] Compile CURL on mac with ssl enabled --- .github/workflows/verify-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 5fef3f12..8e385b83 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -63,7 +63,7 @@ jobs: curl https://libhttpserver.s3.amazonaws.com/travis_stuff/curl-7.75.0.tar.gz -o curl-7.75.0.tar.gz ; tar -xzf curl-7.75.0.tar.gz ; cd curl-7.75.0 ; - ./configure ; + if [ "$matrix.os" = "ubuntu-latest" ]; then ./configure ; else ./configure --with-darwinssl ; fi make ; if: steps.cache-CURL.outputs.cache-hit != 'true' From 4324626251e1f54359ccd8f3d3ae1e3e038e14fb Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 13:19:32 -0800 Subject: [PATCH 19/72] Cache libmicrohttpd --- .github/workflows/verify-build.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 8e385b83..b1cfc435 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -47,10 +47,6 @@ jobs: eval "${{ matrix.compiler }}" eval "${{ matrix.env }}" - #- name: Install CURL (for testing on linux) - # run: sudo apt-get install libcurl4-openssl-dev - # if: ${{ matrix.os == 'ubuntu-latest' }} - - name: CURL from cache (for testing) id: cache-CURL uses: actions/cache@v2 @@ -124,15 +120,25 @@ jobs: export IPV6_TESTS_ENABLED="true" ; if: ${{ matrix.os == 'macos-latest' }} - - name: Install libmicrohttpd dependency + - name: Fetch libmicrohttpd from cache + id: cache-libmicrohttpd + uses: actions/cache@v2 + with: + path: libmicrohttpd-0.9.59 + key: ${{ matrix.os }}-libmicrohttpd-pre-built + + - name: Build libmicrohttpd dependency (if not cached) run: | curl https://s3.amazonaws.com/libhttpserver/libmicrohttpd_releases/libmicrohttpd-0.9.59.tar.gz -o libmicrohttpd-0.9.59.tar.gz ; tar -xzf libmicrohttpd-0.9.59.tar.gz ; cd libmicrohttpd-0.9.59 ; ./configure --disable-examples ; make ; - sudo make install ; - + if: steps.cache-libmicrohttpd.outputs.cache-hit != 'true' + + - name: Install libmicrohttpd + run: cd libmicrohttpd-0.9.59 ; sudo make install ; + - name: Refresh links to shared libs run: sudo ldconfig ; if: ${{ matrix.os == 'ubuntu-latest' }} From ac6b23348d768d4cdbb7e59d929829d67a925db4 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 15:02:35 -0800 Subject: [PATCH 20/72] Add memory checks --- .github/workflows/verify-build.yml | 40 +++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index b1cfc435..bcf8f533 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -17,6 +17,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] + test-group: [basic] compiler: - 'CC=gcc && CXX=g++' - 'CC=clang && CXX=clang++' @@ -27,7 +28,32 @@ jobs: exclude: - compiler: 'CC=clang && CXX=clang++' env: 'DEBUG="debug" && COVERAGE="coverage"' - + include: + - compiler-family: clang + compiler-version: 3.9 + test-group: extra + os: ubuntu-latest + env: 'BUILD_TYPE=asan && CC=clang-3.9 && CXX=clang++-3.9 && DEBUG=debug && COVERAGE=nocoverage' + - compiler-family: clang + compiler-version: 3.9 + test-group: extra + os: ubuntu-latest + env: 'BUILD_TYPE=msan && CC=clang-3.9 && CXX=clang++-3.9 && DEBUG=debug && COVERAGE=nocoverage' + - compiler-family: clang + compiler-version: 3.9 + test-group: extra + os: ubuntu-latest + env: 'BUILD_TYPE=lsan && CC=clang-3.9 && CXX=clang++-3.9 && DEBUG=debug && COVERAGE=nocoverage' + - compiler-family: clang + compiler-version: 3.9 + test-group: extra + os: ubuntu-latest + env: 'BUILD_TYPE=tsan && CC=clang-3.9 && CXX=clang++-3.9 && DEBUG=debug && COVERAGE=nocoverage' + - compiler-family: clang + compiler-version: 3.9 + test-group: extra + os: ubuntu-latest + env: 'BUILD_TYPE=ubsan && CC=clang-3.9 && CXX=clang++-3.9 && DEBUG=debug && COVERAGE=nocoverage' steps: - name: Checkout repository uses: actions/checkout@v2 @@ -46,6 +72,18 @@ jobs: run: | eval "${{ matrix.compiler }}" eval "${{ matrix.env }}" + + - name: Install Ubuntu test sources (for extra builds) + run: | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test ; + sudo apt-get update ; + if: ${{ matrix.test-group == 'extra' && matrix.os == 'ubuntu-latest' }} + + - name: Install optional clang if needed + run: | + sudo apt-get install llvm-toolchain-${{ matrix.compiler-version }} ; + sudo apt-get install clang-${{ matrix.compiler-version }} + if: ${{ matrix.compiler-family == 'clang' && matrix.os == 'ubuntu-latest' }} - name: CURL from cache (for testing) id: cache-CURL From cf479dc1a9a24e10e61f166cd5f4623e61b7018d Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 15:10:33 -0800 Subject: [PATCH 21/72] just install clang --- .github/workflows/verify-build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index bcf8f533..08f0454c 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -81,7 +81,6 @@ jobs: - name: Install optional clang if needed run: | - sudo apt-get install llvm-toolchain-${{ matrix.compiler-version }} ; sudo apt-get install clang-${{ matrix.compiler-version }} if: ${{ matrix.compiler-family == 'clang' && matrix.os == 'ubuntu-latest' }} From 5a5b4fc21132da464442a43e45f097b539feb96a Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 15:52:39 -0800 Subject: [PATCH 22/72] Set envs using github actions syntax --- .github/workflows/verify-build.yml | 102 ++++++++++++++++++----------- 1 file changed, 65 insertions(+), 37 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 08f0454c..270a9e71 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -13,47 +13,81 @@ jobs: verify: name: Verify runs-on: ${{ matrix.os }} + env: + DEBUG: ${{ matrix.debug }} + COVERAGE: ${{ matrix.coverage }} + LINKING: ${{ matrix.linking }} + BUILD_TYPE: ${{ matrix.build-type }} + CC: ${{ matrix.c-compiler }} + CXX: ${{ matrix.cc-compiler }} strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] test-group: [basic] - compiler: - - 'CC=gcc && CXX=g++' - - 'CC=clang && CXX=clang++' - env: - - 'DEBUG="debug" && COVERAGE="coverage"' - - 'DEBUG="nodebug" && COVERAGE="nocoverage"' - - 'LINKING="static"' + compiler-family: [none] + c-compiler: [gcc, clang] + cc-compiler: [g++, clang++] + debug: [debug, nodebug] + coverage: [coverage, nocoverage] + linking: [dynamic, static] + build-type: [classic] exclude: - - compiler: 'CC=clang && CXX=clang++' - env: 'DEBUG="debug" && COVERAGE="coverage"' + - c-compiler: gcc + cc-compiler: clang++ + - c-compiler: clang + cc-compiler: g++ + - c-compiler: clang + debug: debug + - debug: debug + coverage: nocoverage + - debug: nodebug + coverage: coverage + - linking: static + debug: debug + - linking: static + coverage: coverage include: - - compiler-family: clang - compiler-version: 3.9 - test-group: extra + - test-group: extra os: ubuntu-latest - env: 'BUILD_TYPE=asan && CC=clang-3.9 && CXX=clang++-3.9 && DEBUG=debug && COVERAGE=nocoverage' - - compiler-family: clang - compiler-version: 3.9 - test-group: extra + build-type: asan + compiler-family: clang + c-compiler: clang-3.9 + cc-compiler: clang++-3.9 + debug: debug + coverage: nocoverage + - test-group: extra os: ubuntu-latest - env: 'BUILD_TYPE=msan && CC=clang-3.9 && CXX=clang++-3.9 && DEBUG=debug && COVERAGE=nocoverage' - - compiler-family: clang - compiler-version: 3.9 - test-group: extra + build-type: msan + compiler-family: clang + c-compiler: clang-3.9 + cc-compiler: clang++-3.9 + debug: debug + coverage: nocoverage + - test-group: extra os: ubuntu-latest - env: 'BUILD_TYPE=lsan && CC=clang-3.9 && CXX=clang++-3.9 && DEBUG=debug && COVERAGE=nocoverage' - - compiler-family: clang - compiler-version: 3.9 - test-group: extra + build-type: lsan + compiler-family: clang + c-compiler: clang-3.9 + cc-compiler: clang++-3.9 + debug: debug + coverage: nocoverage + - test-group: extra os: ubuntu-latest - env: 'BUILD_TYPE=tsan && CC=clang-3.9 && CXX=clang++-3.9 && DEBUG=debug && COVERAGE=nocoverage' - - compiler-family: clang - compiler-version: 3.9 - test-group: extra + build-type: tsan + compiler-family: clang + c-compiler: clang-3.9 + cc-compiler: clang++-3.9 + debug: debug + coverage: nocoverage + - test-group: extra os: ubuntu-latest - env: 'BUILD_TYPE=ubsan && CC=clang-3.9 && CXX=clang++-3.9 && DEBUG=debug && COVERAGE=nocoverage' + build-type: ubsan + compiler-family: clang + c-compiler: clang-3.9 + cc-compiler: clang++-3.9 + debug: debug + coverage: nocoverage steps: - name: Checkout repository uses: actions/checkout@v2 @@ -66,12 +100,6 @@ jobs: # the head of the pull request instead of the merge commit. - run: git checkout HEAD^2 if: ${{ github.event_name == 'pull_request' }} - - # Extract combination of environment variables - - name: Apply environment variables - run: | - eval "${{ matrix.compiler }}" - eval "${{ matrix.env }}" - name: Install Ubuntu test sources (for extra builds) run: | @@ -81,7 +109,7 @@ jobs: - name: Install optional clang if needed run: | - sudo apt-get install clang-${{ matrix.compiler-version }} + sudo apt-get install ${{ matrix.c-compiler }} if: ${{ matrix.compiler-family == 'clang' && matrix.os == 'ubuntu-latest' }} - name: CURL from cache (for testing) @@ -263,4 +291,4 @@ jobs: - name: Push code coverage data run: if [ "$DEBUG" = "debug" ] && [ "$COVERAGE" = "coverage" ]; then cd build ; bash <(curl -s https://codecov.io/bash); fi - if: ${{ matrix.os == 'ubuntu-latest' }} + if: ${{ matrix.os == 'ubuntu-latest' && matrix.c-compiler == 'gcc' }} From 5a06c978dd2451d767085b934c9cb6e8a913c33b Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 16:02:17 -0800 Subject: [PATCH 23/72] Set flags for memory checks --- .github/workflows/verify-build.yml | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 270a9e71..e53cd0af 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -164,13 +164,6 @@ jobs: cd .. ; fi - # Set paths - - run: | - 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 - export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib - - name: Setup coverage dependencies (only on linux) run: | sudo apt-get install info install-info ; @@ -179,12 +172,6 @@ jobs: sudo apt-get install cppcheck ; if: ${{ matrix.os == 'ubuntu-latest' }} - # Additional flags on mac - - run: | - export CFLAGS='-mtune=generic' ; - export IPV6_TESTS_ENABLED="true" ; - if: ${{ matrix.os == 'macos-latest' }} - - name: Fetch libmicrohttpd from cache id: cache-libmicrohttpd uses: actions/cache@v2 @@ -208,16 +195,21 @@ jobs: run: sudo ldconfig ; if: ${{ matrix.os == 'ubuntu-latest' }} - - name: Set flags for memory checks + - name: Run libhttpserver configure run: | + # Set memory check flags. They need to stay in step as env variables don't propagate across steps. if [ "$BUILD_TYPE" = "asan" ]; then export CFLAGS='-fsanitize=address'; export CXXLAGS='-fsanitize=address'; export LDFLAGS='-fsanitize=address'; fi if [ "$BUILD_TYPE" = "msan" ]; then export CFLAGS='-fsanitize=memory'; export CXXLAGS='-fsanitize=memory'; export LDFLAGS='-fsanitize=memory'; fi if [ "$BUILD_TYPE" = "lsan" ]; then export CFLAGS='-fsanitize=leak'; export CXXLAGS='-fsanitize=leak'; export LDFLAGS='-fsanitize=leak'; fi if [ "$BUILD_TYPE" = "tsan" ]; then export CFLAGS='-fsanitize=thread'; export CXXLAGS='-fsanitize=thread'; export LDFLAGS='-fsanitize=thread'; fi if [ "$BUILD_TYPE" = "ubsan" ]; then export export CFLAGS='-fsanitize=undefined'; export CXXLAGS='-fsanitize=undefined'; export LDFLAGS='-fsanitize=undefined'; fi - - name: Run libhttpserver configure - run: | + # Additional flags on mac. They need to stay in step as env variables don't propagate across steps. + if [ "$matrix.os" = "macos-latest" ]; then + export CFLAGS='-mtune=generic' ; + export IPV6_TESTS_ENABLED="true" ; + fi + ./bootstrap ; mkdir build ; cd build ; From 129a08b5ae8a09310b34a626e829371127e345cb Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 16:18:41 -0800 Subject: [PATCH 24/72] Add tests on extra gcc/g++ versions --- .github/workflows/verify-build.yml | 51 ++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index e53cd0af..e8573f73 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -79,7 +79,7 @@ jobs: c-compiler: clang-3.9 cc-compiler: clang++-3.9 debug: debug - coverage: nocoverage + coverage: nocoverage - test-group: extra os: ubuntu-latest build-type: ubsan @@ -87,7 +87,47 @@ jobs: c-compiler: clang-3.9 cc-compiler: clang++-3.9 debug: debug - coverage: nocoverage + coverage: nocoverage + - test-group: extra + os: ubuntu-latest + build-type: none + compiler-family: gcc + c-compiler: gcc-5 + cc-compiler: g++-5 + debug: nodebug + coverage: nocoverage + - test-group: extra + os: ubuntu-latest + build-type: none + compiler-family: gcc + c-compiler: gcc-6 + cc-compiler: g++-6 + debug: nodebug + coverage: nocoverage + - test-group: extra + os: ubuntu-latest + build-type: none + compiler-family: gcc + c-compiler: gcc-7 + cc-compiler: g++-7 + debug: nodebug + coverage: nocoverage + - test-group: extra + os: ubuntu-latest + build-type: none + compiler-family: gcc + c-compiler: gcc-8 + cc-compiler: g++-8 + debug: nodebug + coverage: nocoverage + - test-group: extra + os: ubuntu-latest + build-type: none + compiler-family: gcc + c-compiler: gcc-9 + cc-compiler: g++-9 + debug: nodebug + coverage: nocoverage steps: - name: Checkout repository uses: actions/checkout@v2 @@ -111,7 +151,12 @@ jobs: run: | sudo apt-get install ${{ matrix.c-compiler }} if: ${{ matrix.compiler-family == 'clang' && matrix.os == 'ubuntu-latest' }} - + + - name: Install optional gcc if needed + run: | + sudo apt-get install ${{ matrix.cc-compiler }} + if: ${{ matrix.compiler-family == 'gcc' && matrix.os == 'ubuntu-latest' }} + - name: CURL from cache (for testing) id: cache-CURL uses: actions/cache@v2 From 3fbfeb4021ef8a2054c9b722614d9f9d4d8c9a9b Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 16:30:17 -0800 Subject: [PATCH 25/72] Add extra clang versions --- .github/workflows/verify-build.yml | 56 ++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index e8573f73..fe52c5f6 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -128,6 +128,62 @@ jobs: cc-compiler: g++-9 debug: nodebug coverage: nocoverage + - test-group: extra + os: ubuntu-latest + build-type: none + compiler-family: clang + c-compiler: clang-3.9 + cc-compiler: clang++-3.9 + debug: nodebug + coverage: nocoverage + - test-group: extra + os: ubuntu-latest + build-type: none + compiler-family: clang + c-compiler: clang-4.0 + cc-compiler: clang++-4.0 + debug: nodebug + coverage: nocoverage + - test-group: extra + os: ubuntu-latest + build-type: none + compiler-family: clang + c-compiler: clang-5.0 + cc-compiler: clang++-5.0 + debug: nodebug + coverage: nocoverage + - test-group: extra + os: ubuntu-latest + build-type: none + compiler-family: clang + c-compiler: clang-6.0 + cc-compiler: clang++-6.0 + debug: nodebug + coverage: nocoverage + - test-group: extra + os: ubuntu-latest + build-type: none + compiler-family: clang + c-compiler: clang-7 + cc-compiler: clang++-7 + debug: nodebug + coverage: nocoverage + - test-group: extra + os: ubuntu-latest + build-type: none + compiler-family: clang + c-compiler: clang-8 + cc-compiler: clang++-8 + debug: nodebug + coverage: nocoverage + - test-group: extra + os: ubuntu-latest + build-type: none + compiler-family: clang + c-compiler: clang-9 + cc-compiler: clang++-9 + debug: nodebug + coverage: nocoverage steps: - name: Checkout repository uses: actions/checkout@v2 From 024f031938b101cb5d1af4b9b79d2517b78a92ae Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 16:49:26 -0800 Subject: [PATCH 26/72] Add valgrind and iwyu checks --- .github/workflows/verify-build.yml | 42 ++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index fe52c5f6..412d8068 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -184,6 +184,22 @@ jobs: cc-compiler: clang++-9 debug: nodebug coverage: nocoverage + - test-group: extra + os: ubuntu-latest + build-type: valgrind + compiler-family: gcc + c-compiler: gcc-7 + cc-compiler: g++-7 + debug: nodebug + coverage: nocoverage + - test-group: extra + os: ubuntu-latest + build-type: iwyu + compiler-family: clang + c-compiler: clang + cc-compiler: clang++ + debug: nodebug + coverage: nocoverage steps: - name: Checkout repository uses: actions/checkout@v2 @@ -213,6 +229,16 @@ jobs: sudo apt-get install ${{ matrix.cc-compiler }} if: ${{ matrix.compiler-family == 'gcc' && matrix.os == 'ubuntu-latest' }} + - name: Install valgrind if needed + run: | + sudo apt-get install valgrind valgrind-dbg + if: ${{ matrix.build-type == 'valgrind' }} + + - name: Install IWYU if needed + run: | + sudo apt-get install iwyu cmake llvm-dev libclang-dev + if: ${{ matrix.build-type == 'iwyu' }} + - name: CURL from cache (for testing) id: cache-CURL uses: actions/cache@v2 @@ -243,7 +269,7 @@ jobs: # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. - name: Install IWYU if requested - run: if [ "$IWYU" = "iwyu" ]; then + run: | 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}" ; @@ -263,7 +289,7 @@ jobs: make ; sudo make install ; cd .. ; - fi + if: ${{ matrix.build-type == 'iwyu' }} - name: Setup coverage dependencies (only on linux) run: | @@ -320,9 +346,9 @@ jobs: ../configure --enable-debug --enable-coverage --disable-shared --disable-fastopen; elif [ "$DEBUG" = "debug" ]; then ../configure --enable-debug --disable-shared --disable-fastopen; - elif [ "$VALGRIND" = "valgrind" ]; then + elif [ "$BUILD_TYPE" = "valgrind" ]; then ../configure --enable-debug --disable-fastopen --disable-valgrind-helgrind --disable-valgrind-drd --disable-valgrind-sgcheck; - elif [ "$IWYU" = "iwyu" ]; then + elif [ "$BUILD_TYPE" = "iwyu" ]; then ../configure --disable-examples; else ../configure --disable-fastopen; @@ -332,7 +358,7 @@ jobs: - name: Make or run IWYU run: | cd build ; - if [ "$IWYU" = "iwyu" ]; then + if [ "$BUILD_TYPE" = "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" ; if [ $? -ne 2 ]; then return 1; @@ -342,14 +368,14 @@ jobs: fi - name: Run tests - run: if [ "$IWYU" != "iwyu" ]; then cd build ; make check; cat test/test-suite.log ; fi + run: if [ "$BUILD_TYPE" != "iwyu" ]; then cd build ; make check; cat test/test-suite.log ; fi - name: Print tests results - run: if [ "$IWYU" != "iwyu" ]; then cd build ; cat test/test-suite.log; fi + run: if [ "$BUILD_TYPE" != "iwyu" ]; then cd build ; cat test/test-suite.log; fi if: ${{ failure() }} - name: Run Valgrind checks - run: if [ "$VALGRIND" = "valgrind" ]; then cd build ; make check-valgrind; cat test/test-suite-memcheck.log; fi; + run: if [ "$BUILD_TYPE" = "valgrind" ]; then cd build ; make check-valgrind; cat test/test-suite-memcheck.log; fi; - name: Run cppcheck run: cd src/; cppcheck --error-exitcode=1 .; From dde13d38462cde040e6e6ded523682f0d42a26e6 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 17:02:24 -0800 Subject: [PATCH 27/72] Print clang versions and paths --- .github/workflows/verify-build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 412d8068..5c8e98e9 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -274,6 +274,11 @@ jobs: 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" ; + which clang ; + echo $CLANG_VERSION ; + echo $CLANG_PKG_VERSION ; + echo $CLANG_PREFIX_PATH ; + echo $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]$' ; From ce0eb1b623eabee47a5e39436dc912e56ecdfbf2 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 17:04:54 -0800 Subject: [PATCH 28/72] Print clang path --- .github/workflows/verify-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 5c8e98e9..03f8398a 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -274,7 +274,7 @@ jobs: 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" ; - which clang ; + ls -l `which clang` ; echo $CLANG_VERSION ; echo $CLANG_PKG_VERSION ; echo $CLANG_PREFIX_PATH ; From 578c9c356c77a120a8cf8ee0a59e3a88e965720b Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 17:12:15 -0800 Subject: [PATCH 29/72] Simplify iwyu Attempt to use system iwyu --- .github/workflows/verify-build.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 03f8398a..cb0a1504 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -267,35 +267,6 @@ jobs: run: brew install autoconf automake libtool if: ${{ matrix.os == 'macos-latest' }} - # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. - - name: Install IWYU if requested - run: | - 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" ; - ls -l `which clang` ; - echo $CLANG_VERSION ; - echo $CLANG_PKG_VERSION ; - echo $CLANG_PREFIX_PATH ; - echo $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]$' ; - if [ $? -eq 0 ]; then - git checkout clang_${CLANG_PKG_VERSION} ; - else - git checkout clang_${CLANG_PKG_VERSION}.0 ; - fi; - 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 ; - cd .. ; - if: ${{ matrix.build-type == 'iwyu' }} - - name: Setup coverage dependencies (only on linux) run: | sudo apt-get install info install-info ; From 75c856df98cff5a53451d0f8412032e4ccbc0a3d Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 17:17:46 -0800 Subject: [PATCH 30/72] fix iwyu path --- .github/workflows/verify-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index cb0a1504..eeb070cf 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -335,7 +335,7 @@ jobs: run: | cd build ; if [ "$BUILD_TYPE" = "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/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 From 552216371c0791e9ff940953976d8f388d472524 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 18:36:43 -0800 Subject: [PATCH 31/72] Install additional clang to support iwyu builds --- .github/workflows/verify-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index eeb070cf..7a054c1c 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -236,7 +236,7 @@ jobs: - name: Install IWYU if needed run: | - sudo apt-get install iwyu cmake llvm-dev libclang-dev + sudo apt-get install iwyu cmake llvm-dev libclang-dev clang-7 clang-8 clang-9 if: ${{ matrix.build-type == 'iwyu' }} - name: CURL from cache (for testing) From e475fc8c538f1b3dcb63590534030eb01960a689 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 19:02:09 -0800 Subject: [PATCH 32/72] Use compile iwyu --- .github/workflows/verify-build.yml | 32 +++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 7a054c1c..e57a5ca9 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -239,6 +239,36 @@ jobs: sudo apt-get install iwyu cmake llvm-dev libclang-dev clang-7 clang-8 clang-9 if: ${{ matrix.build-type == 'iwyu' }} + # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. + - name: Install IWYU if requested + run: | + CLANG_VERSION=`clang --version | grep version | cut -f3 -d' ' | cut -f1 -d'-'` ; + CLANG_PKG_VERSION=`echo $CLANG_VERSION | cut -f1,2 -d'.'` + CLANG_BIN_PATH=`readlink -f /usr/bin/clang` ; + CLANG_PREFIX_PATH="${CLANG_BIN_PATH}/../lib/clang/${CLANG_VERSION}" ; + which clang ; + ls -l `which clang` ; + echo $CLANG_VERSION ; + echo $CLANG_PKG_VERSION ; + echo $CLANG_PREFIX_PATH ; + echo $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]$' ; + if [ $? -eq 0 ]; then + git checkout clang_${CLANG_PKG_VERSION} ; + else + git checkout clang_${CLANG_PKG_VERSION}.0 ; + fi; + 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 ; + cd .. ; + if: ${{ matrix.build-type == 'iwyu' }} + - name: CURL from cache (for testing) id: cache-CURL uses: actions/cache@v2 @@ -335,7 +365,7 @@ jobs: run: | cd build ; if [ "$BUILD_TYPE" = "iwyu" ]; then - make -k CXX='/usr/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 From a0a64d4d8443d5d3e8f50d366ff518868a2a15a4 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 19:12:04 -0800 Subject: [PATCH 33/72] fix clang paths --- .github/workflows/verify-build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index e57a5ca9..e43efbff 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -245,9 +245,13 @@ jobs: CLANG_VERSION=`clang --version | grep version | cut -f3 -d' ' | cut -f1 -d'-'` ; CLANG_PKG_VERSION=`echo $CLANG_VERSION | cut -f1,2 -d'.'` CLANG_BIN_PATH=`readlink -f /usr/bin/clang` ; - CLANG_PREFIX_PATH="${CLANG_BIN_PATH}/../lib/clang/${CLANG_VERSION}" ; + CLANGPP_BIN_PATH=`readlink -f /usr/bin/clang++` ; + CLANG_BIN_DIR_PATH=`dirname "${CLANG_BIN_PATH}"` + CLANG_PREFIX_PATH="${CLANG_BIN_DIR_PATH}/../lib/clang/${CLANG_VERSION}" ; which clang ; ls -l `which clang` ; + ls -l "${CLANG_BIN_DIR_PATH}/../lib/" ; + ls -l "${CLANG_BIN_DIR_PATH}/../lib/clang/" ; echo $CLANG_VERSION ; echo $CLANG_PKG_VERSION ; echo $CLANG_PREFIX_PATH ; @@ -263,7 +267,7 @@ jobs: 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 ; + cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$CLANG_PREFIX_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH -DCMAKE_CXX_COMPILER=$CLANGPP_BIN_PATH ../include-what-you-use ; make ; sudo make install ; cd .. ; From 513cf6a17972f2c5c8a98cb3a9756bcded300592 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 19:19:36 -0800 Subject: [PATCH 34/72] Fix clang paths --- .github/workflows/verify-build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index e43efbff..d50b5139 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -247,15 +247,20 @@ jobs: CLANG_BIN_PATH=`readlink -f /usr/bin/clang` ; CLANGPP_BIN_PATH=`readlink -f /usr/bin/clang++` ; CLANG_BIN_DIR_PATH=`dirname "${CLANG_BIN_PATH}"` - CLANG_PREFIX_PATH="${CLANG_BIN_DIR_PATH}/../lib/clang/${CLANG_VERSION}" ; + CLANG_PREFIX_PATH="${CLANG_BIN_DIR_PATH}/../" ; which clang ; ls -l `which clang` ; + echo CLANG_ROOT + ls -l "${CLANG_BIN_DIR_PATH}/../" ; + echo CLANG_LIB ls -l "${CLANG_BIN_DIR_PATH}/../lib/" ; + echo CLANG_LIB_CLANG ls -l "${CLANG_BIN_DIR_PATH}/../lib/clang/" ; echo $CLANG_VERSION ; echo $CLANG_PKG_VERSION ; echo $CLANG_PREFIX_PATH ; echo $CLANG_BIN_PATH ; + echo $CLANGPP_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]$' ; From 66d0aee2f74f04ec9e56a4aba5747ca3d367edda Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 19:23:30 -0800 Subject: [PATCH 35/72] Fix clang path --- .github/workflows/verify-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index d50b5139..a3e8422a 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -272,7 +272,7 @@ jobs: cd .. ; mkdir build_iwyu ; cd build_iwyu ; - cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$CLANG_PREFIX_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH -DCMAKE_CXX_COMPILER=$CLANGPP_BIN_PATH ../include-what-you-use ; + cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$CLANG_PREFIX_PATH -DDIWYU_LLVM_ROOT_PATH=$CLANG_PREFIX_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH -DCMAKE_CXX_COMPILER=$CLANGPP_BIN_PATH ../include-what-you-use ; make ; sudo make install ; cd .. ; From 4b6fd271a34ba3ab5c6101e8d879431f3ba31ba8 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 19:31:24 -0800 Subject: [PATCH 36/72] fix iwyu import --- .github/workflows/verify-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index a3e8422a..395e02b8 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -272,7 +272,7 @@ jobs: cd .. ; mkdir build_iwyu ; cd build_iwyu ; - cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$CLANG_PREFIX_PATH -DDIWYU_LLVM_ROOT_PATH=$CLANG_PREFIX_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH -DCMAKE_CXX_COMPILER=$CLANGPP_BIN_PATH ../include-what-you-use ; + cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$CLANG_PREFIX_PATH -DIWYU_LLVM_ROOT_PATH=$CLANG_PREFIX_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH -DCMAKE_CXX_COMPILER=$CLANGPP_BIN_PATH ../include-what-you-use ; make ; sudo make install ; cd .. ; From 5c0d7912faea388b6a0bfc26cb6468bb805e8b16 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 19:44:25 -0800 Subject: [PATCH 37/72] Print iwyu resources --- .github/workflows/verify-build.yml | 42 +++--------------------------- 1 file changed, 3 insertions(+), 39 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 395e02b8..2c7b854f 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -239,45 +239,6 @@ jobs: sudo apt-get install iwyu cmake llvm-dev libclang-dev clang-7 clang-8 clang-9 if: ${{ matrix.build-type == 'iwyu' }} - # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. - - name: Install IWYU if requested - run: | - CLANG_VERSION=`clang --version | grep version | cut -f3 -d' ' | cut -f1 -d'-'` ; - CLANG_PKG_VERSION=`echo $CLANG_VERSION | cut -f1,2 -d'.'` - CLANG_BIN_PATH=`readlink -f /usr/bin/clang` ; - CLANGPP_BIN_PATH=`readlink -f /usr/bin/clang++` ; - CLANG_BIN_DIR_PATH=`dirname "${CLANG_BIN_PATH}"` - CLANG_PREFIX_PATH="${CLANG_BIN_DIR_PATH}/../" ; - which clang ; - ls -l `which clang` ; - echo CLANG_ROOT - ls -l "${CLANG_BIN_DIR_PATH}/../" ; - echo CLANG_LIB - ls -l "${CLANG_BIN_DIR_PATH}/../lib/" ; - echo CLANG_LIB_CLANG - ls -l "${CLANG_BIN_DIR_PATH}/../lib/clang/" ; - echo $CLANG_VERSION ; - echo $CLANG_PKG_VERSION ; - echo $CLANG_PREFIX_PATH ; - echo $CLANG_BIN_PATH ; - echo $CLANGPP_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]$' ; - if [ $? -eq 0 ]; then - git checkout clang_${CLANG_PKG_VERSION} ; - else - git checkout clang_${CLANG_PKG_VERSION}.0 ; - fi; - cd .. ; - mkdir build_iwyu ; - cd build_iwyu ; - cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$CLANG_PREFIX_PATH -DIWYU_LLVM_ROOT_PATH=$CLANG_PREFIX_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH -DCMAKE_CXX_COMPILER=$CLANGPP_BIN_PATH ../include-what-you-use ; - make ; - sudo make install ; - cd .. ; - if: ${{ matrix.build-type == 'iwyu' }} - - name: CURL from cache (for testing) id: cache-CURL uses: actions/cache@v2 @@ -374,6 +335,9 @@ jobs: run: | cd build ; if [ "$BUILD_TYPE" = "iwyu" ]; then + strings /usr/bin/iwyu | grep LLVM ; + clang -print-resource-dir ; + /usr/bin/include-what-you-use -print-resource-dir ; 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; From 389e80a461b90b1de80f77f6759f5f3afada2d62 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 20:00:49 -0800 Subject: [PATCH 38/72] Build iwyu again --- .github/workflows/verify-build.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 2c7b854f..fc6389de 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -236,7 +236,31 @@ jobs: - name: Install IWYU if needed run: | - sudo apt-get install iwyu cmake llvm-dev libclang-dev clang-7 clang-8 clang-9 + sudo apt-get install iwyu cmake llvm-dev libclang-dev clang-5.0 clang-6.0 clang-7 clang-8 clang-9 + if: ${{ matrix.build-type == 'iwyu' }} + + # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. + - name: Install IWYU if requested + run: | + 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/llvm-${CLANG_VERSION}/lib/clang/${CLANG_VERSION}" ; + CLANG_BIN_PATH="/usr/local/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_PKG_VERSION" | grep '\.[0-9]$' ; + if [ $? -eq 0 ]; then + git checkout clang_${CLANG_PKG_VERSION} ; + else + git checkout clang_${CLANG_PKG_VERSION}.0 ; + fi; + 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 ; + cd .. ; if: ${{ matrix.build-type == 'iwyu' }} - name: CURL from cache (for testing) @@ -337,7 +361,7 @@ jobs: if [ "$BUILD_TYPE" = "iwyu" ]; then strings /usr/bin/iwyu | grep LLVM ; clang -print-resource-dir ; - /usr/bin/include-what-you-use -print-resource-dir ; + /usr/local/bin/include-what-you-use -print-resource-dir ; 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; From 6927c73879d69e71c66d7e999fd9651c3e0fd16d Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 20:04:36 -0800 Subject: [PATCH 39/72] Use proper pkg version for clang in iwyu --- .github/workflows/verify-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index fc6389de..e5e4f4b1 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -244,8 +244,8 @@ jobs: run: | 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/llvm-${CLANG_VERSION}/lib/clang/${CLANG_VERSION}" ; - CLANG_BIN_PATH="/usr/local/llvm-${CLANG_VERSION}/bin" ; + CLANG_PREFIX_PATH="/usr/local/llvm-${CLANG_PKG_VERSION}/lib/clang/${CLANG_VERSION}" ; + CLANG_BIN_PATH="/usr/local/llvm-${CLANG_PKG_VERSION}/bin" ; 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]$' ; From 3bf016a31965a67adaa6570d61aac59086ce3861 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 20:09:34 -0800 Subject: [PATCH 40/72] Fix path to compiler in iwyu --- .github/workflows/verify-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index e5e4f4b1..558a25ca 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -244,8 +244,8 @@ jobs: run: | 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/llvm-${CLANG_PKG_VERSION}/lib/clang/${CLANG_VERSION}" ; - CLANG_BIN_PATH="/usr/local/llvm-${CLANG_PKG_VERSION}/bin" ; + CLANG_PREFIX_PATH="/usr/lib/llvm-${CLANG_PKG_VERSION}/lib/clang/${CLANG_VERSION}" ; + CLANG_BIN_PATH="/usr/lib/llvm-${CLANG_PKG_VERSION}/bin" ; 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]$' ; From c1eef4e1e27fad54b7426228483b96a3e2785f74 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 20:14:11 -0800 Subject: [PATCH 41/72] Set iwyu root path --- .github/workflows/verify-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 558a25ca..9c8764fd 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -257,7 +257,7 @@ jobs: 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 ; + cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$CLANG_PREFIX_PATH -DIWYU_LLVM_ROOT_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 .. ; From 680f9495cb6e0a813b75fe3ca825ce7b4506bdcc Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 20:22:55 -0800 Subject: [PATCH 42/72] Use llvm root path --- .github/workflows/verify-build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 9c8764fd..6115de34 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -244,8 +244,9 @@ jobs: run: | 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/lib/llvm-${CLANG_PKG_VERSION}/lib/clang/${CLANG_VERSION}" ; - CLANG_BIN_PATH="/usr/lib/llvm-${CLANG_PKG_VERSION}/bin" ; + CLANG_ROOT_PATH="/usr/lib/llvm-${CLANG_PKG_VERSION}" + CLANG_PREFIX_PATH="${CLANG_ROOT_PATH}/lib/clang/${CLANG_VERSION}" ; + CLANG_BIN_PATH="${CLANG_ROOT_PATH}/bin" ; 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]$' ; @@ -257,7 +258,7 @@ jobs: cd .. ; mkdir build_iwyu ; cd build_iwyu ; - cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$CLANG_PREFIX_PATH -DIWYU_LLVM_ROOT_PATH=$CLANG_PREFIX_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../include-what-you-use ; + cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$CLANG_ROOT_PATH -DIWYU_LLVM_ROOT_PATH=$CLANG_ROOT_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../include-what-you-use ; make ; sudo make install ; cd .. ; From e7f696c02d8c39dd2cc84b958eb266bb11d29e7b Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 20:33:37 -0800 Subject: [PATCH 43/72] No need to pass sys libs in CXXFLAS --- .github/workflows/verify-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 6115de34..79d30355 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -363,7 +363,7 @@ jobs: strings /usr/bin/iwyu | grep LLVM ; clang -print-resource-dir ; /usr/local/bin/include-what-you-use -print-resource-dir ; - 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="-std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS" ; if [ $? -ne 2 ]; then return 1; fi From b58331ee0dbf0468fdcfaaf6b13a0829f00aac6d Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 20:45:05 -0800 Subject: [PATCH 44/72] use clang-7 with iwyu --- .github/workflows/verify-build.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 79d30355..81066e07 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -196,8 +196,8 @@ jobs: os: ubuntu-latest build-type: iwyu compiler-family: clang - c-compiler: clang - cc-compiler: clang++ + c-compiler: clang-7 + cc-compiler: clang-7++ debug: nodebug coverage: nocoverage steps: @@ -236,13 +236,13 @@ jobs: - name: Install IWYU if needed run: | - sudo apt-get install iwyu cmake llvm-dev libclang-dev clang-5.0 clang-6.0 clang-7 clang-8 clang-9 + sudo apt-get install cmake llvm-dev libclang-dev clang-5.0 clang-6.0 clang-7 clang-8 clang-9 if: ${{ matrix.build-type == 'iwyu' }} # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. - name: Install IWYU if requested run: | - CLANG_VERSION=`clang --version | grep version | cut -f3 -d' ' | cut -f1 -d'-'` ; + CLANG_VERSION=`clang-7 --version | grep version | cut -f3 -d' ' | cut -f1 -d'-'` ; CLANG_PKG_VERSION=`echo $CLANG_VERSION | cut -f1,2 -d'.'` CLANG_ROOT_PATH="/usr/lib/llvm-${CLANG_PKG_VERSION}" CLANG_PREFIX_PATH="${CLANG_ROOT_PATH}/lib/clang/${CLANG_VERSION}" ; @@ -360,8 +360,7 @@ jobs: run: | cd build ; if [ "$BUILD_TYPE" = "iwyu" ]; then - strings /usr/bin/iwyu | grep LLVM ; - clang -print-resource-dir ; + clang-7 -print-resource-dir ; /usr/local/bin/include-what-you-use -print-resource-dir ; 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" ; if [ $? -ne 2 ]; then From 3bdec4aec0deda4c842810e6c5030d70e02856d7 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 20:55:44 -0800 Subject: [PATCH 45/72] Fix version fetching for clang-7 --- .github/workflows/verify-build.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 81066e07..99da2d9a 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -243,8 +243,14 @@ jobs: - name: Install IWYU if requested run: | CLANG_VERSION=`clang-7 --version | grep version | cut -f3 -d' ' | cut -f1 -d'-'` ; - CLANG_PKG_VERSION=`echo $CLANG_VERSION | cut -f1,2 -d'.'` - CLANG_ROOT_PATH="/usr/lib/llvm-${CLANG_PKG_VERSION}" + CLANG_MAJOR_VERSION=`echo $CLANG_VERSION | cut -f1 -d'.'` ; + # Clang changed version format from version 7 (without .0 at the end) + if [ $CLANG_MAJOR_VERSION -ge 7 ]; then + CLANG_PKG_VERSION=$CLANG_MAJOR_VERSION ; + else + CLANG_PKG_VERSION=`echo $CLANG_VERSION | cut -f1,2 -d'.'` ; + fi + CLANG_ROOT_PATH="/usr/lib/llvm-${CLANG_PKG_VERSION}" ; CLANG_PREFIX_PATH="${CLANG_ROOT_PATH}/lib/clang/${CLANG_VERSION}" ; CLANG_BIN_PATH="${CLANG_ROOT_PATH}/bin" ; git clone https://github.com/include-what-you-use/include-what-you-use.git ; From 88932be7066f85320f42fab14c6943e5dc849547 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 21:21:32 -0800 Subject: [PATCH 46/72] Use clang-7 from S3 --- .github/workflows/verify-build.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 99da2d9a..e7d652e1 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -253,14 +253,9 @@ jobs: CLANG_ROOT_PATH="/usr/lib/llvm-${CLANG_PKG_VERSION}" ; CLANG_PREFIX_PATH="${CLANG_ROOT_PATH}/lib/clang/${CLANG_VERSION}" ; CLANG_BIN_PATH="${CLANG_ROOT_PATH}/bin" ; - git clone https://github.com/include-what-you-use/include-what-you-use.git ; + curl "https://libhttpserver.s3.amazonaws.com/travis_stuff/include-what-you-use-clang-${CLANG_PKG_VERSION}.tgz" -o "include-what-you-use-clang-${CLANG_PKG_VERSION}.tgz" ; + tar -xzf "include-what-you-use-clang-${CLANG_PKG_VERSION}.tgz" ; cd include-what-you-use ; - echo "$CLANG_PKG_VERSION" | grep '\.[0-9]$' ; - if [ $? -eq 0 ]; then - git checkout clang_${CLANG_PKG_VERSION} ; - else - git checkout clang_${CLANG_PKG_VERSION}.0 ; - fi; cd .. ; mkdir build_iwyu ; cd build_iwyu ; From d98e801b2766ccf8f85e18e4e0dc41f736fc746e Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 21:35:26 -0800 Subject: [PATCH 47/72] Use clang-7 options in iwyu --- .github/workflows/verify-build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index e7d652e1..fec76ad0 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -259,7 +259,9 @@ jobs: cd .. ; mkdir build_iwyu ; cd build_iwyu ; - cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$CLANG_ROOT_PATH -DIWYU_LLVM_ROOT_PATH=$CLANG_ROOT_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../include-what-you-use ; + #The below worked with Clang-6 + #cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$CLANG_ROOT_PATH -DIWYU_LLVM_ROOT_PATH=$CLANG_ROOT_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../include-what-you-use ; + 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 .. ; From 2adf51d583e0b58abec37f282c8d2d418abaa5a7 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 21:49:43 -0800 Subject: [PATCH 48/72] Fix to clang-7 --- .github/workflows/verify-build.yml | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index fec76ad0..547a1085 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -236,32 +236,21 @@ jobs: - name: Install IWYU if needed run: | - sudo apt-get install cmake llvm-dev libclang-dev clang-5.0 clang-6.0 clang-7 clang-8 clang-9 + sudo apt-get install cmake llvm-7-dev libclang-7-dev clang-7 if: ${{ matrix.build-type == 'iwyu' }} # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. - name: Install IWYU if requested run: | - CLANG_VERSION=`clang-7 --version | grep version | cut -f3 -d' ' | cut -f1 -d'-'` ; - CLANG_MAJOR_VERSION=`echo $CLANG_VERSION | cut -f1 -d'.'` ; - # Clang changed version format from version 7 (without .0 at the end) - if [ $CLANG_MAJOR_VERSION -ge 7 ]; then - CLANG_PKG_VERSION=$CLANG_MAJOR_VERSION ; - else - CLANG_PKG_VERSION=`echo $CLANG_VERSION | cut -f1,2 -d'.'` ; - fi - CLANG_ROOT_PATH="/usr/lib/llvm-${CLANG_PKG_VERSION}" ; - CLANG_PREFIX_PATH="${CLANG_ROOT_PATH}/lib/clang/${CLANG_VERSION}" ; - CLANG_BIN_PATH="${CLANG_ROOT_PATH}/bin" ; - curl "https://libhttpserver.s3.amazonaws.com/travis_stuff/include-what-you-use-clang-${CLANG_PKG_VERSION}.tgz" -o "include-what-you-use-clang-${CLANG_PKG_VERSION}.tgz" ; - tar -xzf "include-what-you-use-clang-${CLANG_PKG_VERSION}.tgz" ; + CLANG_ROOT_PATH="/usr/lib/llvm-7" ; + CLANG_ROOT_PATH="/usr/lib/llvm-7/bin" ; + curl "https://libhttpserver.s3.amazonaws.com/travis_stuff/include-what-you-use-clang-7.tgz" -o "include-what-you-use-clang-7.tgz" ; + tar -xzf "include-what-you-use-clang-7.tgz" ; cd include-what-you-use ; cd .. ; mkdir build_iwyu ; cd build_iwyu ; - #The below worked with Clang-6 - #cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$CLANG_ROOT_PATH -DIWYU_LLVM_ROOT_PATH=$CLANG_ROOT_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../include-what-you-use ; - 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 ; + cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$ROOT_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../include-what-you-use ; make ; sudo make install ; cd .. ; From b4a99686309ccd97e5b95d77659870dd7f1956c3 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 21:54:11 -0800 Subject: [PATCH 49/72] Fix bin path --- .github/workflows/verify-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 547a1085..8f49e12e 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -243,7 +243,7 @@ jobs: - name: Install IWYU if requested run: | CLANG_ROOT_PATH="/usr/lib/llvm-7" ; - CLANG_ROOT_PATH="/usr/lib/llvm-7/bin" ; + CLANG_BIN_PATH="/usr/lib/llvm-7/bin" ; curl "https://libhttpserver.s3.amazonaws.com/travis_stuff/include-what-you-use-clang-7.tgz" -o "include-what-you-use-clang-7.tgz" ; tar -xzf "include-what-you-use-clang-7.tgz" ; cd include-what-you-use ; From e948f8bffc39b2ffc2203fc585d8aa058890e967 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 22:02:11 -0800 Subject: [PATCH 50/72] Use clang-9 with iwyu --- .github/workflows/verify-build.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 8f49e12e..ef28e53e 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -196,8 +196,8 @@ jobs: os: ubuntu-latest build-type: iwyu compiler-family: clang - c-compiler: clang-7 - cc-compiler: clang-7++ + c-compiler: clang-9 + cc-compiler: clang-9++ debug: nodebug coverage: nocoverage steps: @@ -234,18 +234,18 @@ jobs: sudo apt-get install valgrind valgrind-dbg if: ${{ matrix.build-type == 'valgrind' }} - - name: Install IWYU if needed + - name: Install IWYU dependencies if needed run: | - sudo apt-get install cmake llvm-7-dev libclang-7-dev clang-7 + sudo apt-get install cmake llvm-9-dev libclang-9-dev clang-9 if: ${{ matrix.build-type == 'iwyu' }} # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. - name: Install IWYU if requested run: | - CLANG_ROOT_PATH="/usr/lib/llvm-7" ; - CLANG_BIN_PATH="/usr/lib/llvm-7/bin" ; - curl "https://libhttpserver.s3.amazonaws.com/travis_stuff/include-what-you-use-clang-7.tgz" -o "include-what-you-use-clang-7.tgz" ; - tar -xzf "include-what-you-use-clang-7.tgz" ; + CLANG_ROOT_PATH="/usr/lib/llvm-9" ; + CLANG_BIN_PATH="/usr/lib/llvm-9/bin" ; + curl "https://libhttpserver.s3.amazonaws.com/travis_stuff/include-what-you-use-clang-9.tgz" -o "include-what-you-use-clang-9.tgz" ; + tar -xzf "include-what-you-use-clang-9.tgz" ; cd include-what-you-use ; cd .. ; mkdir build_iwyu ; @@ -352,7 +352,7 @@ jobs: run: | cd build ; if [ "$BUILD_TYPE" = "iwyu" ]; then - clang-7 -print-resource-dir ; + clang-9 -print-resource-dir ; /usr/local/bin/include-what-you-use -print-resource-dir ; 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" ; if [ $? -ne 2 ]; then From 244e50fef929eabaddaecd0cba88e1f489819842 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 22:30:53 -0800 Subject: [PATCH 51/72] spice path using llvm tools --- .github/workflows/verify-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index ef28e53e..e0828abe 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -236,14 +236,14 @@ jobs: - name: Install IWYU dependencies if needed run: | - sudo apt-get install cmake llvm-9-dev libclang-9-dev clang-9 + sudo apt-get install cmake llvm-9-dev llvm-9-tools libclang-9-dev clang-9 if: ${{ matrix.build-type == 'iwyu' }} # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. - name: Install IWYU if requested run: | - CLANG_ROOT_PATH="/usr/lib/llvm-9" ; - CLANG_BIN_PATH="/usr/lib/llvm-9/bin" ; + CLANG_ROOT_PATH=`llvm-config-$VERSION --prefix` ; + CLANG_BIN_PATH=`llvm-config-$VERSION --bindir` ; curl "https://libhttpserver.s3.amazonaws.com/travis_stuff/include-what-you-use-clang-9.tgz" -o "include-what-you-use-clang-9.tgz" ; tar -xzf "include-what-you-use-clang-9.tgz" ; cd include-what-you-use ; From 22b581fe1de9db115c75110f267379ed0dcf20c5 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 22:34:05 -0800 Subject: [PATCH 52/72] fix tool version --- .github/workflows/verify-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index e0828abe..9841c7cd 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -242,8 +242,8 @@ jobs: # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. - name: Install IWYU if requested run: | - CLANG_ROOT_PATH=`llvm-config-$VERSION --prefix` ; - CLANG_BIN_PATH=`llvm-config-$VERSION --bindir` ; + CLANG_ROOT_PATH=`llvm-config-9 --prefix` ; + CLANG_BIN_PATH=`llvm-config-9 --bindir` ; curl "https://libhttpserver.s3.amazonaws.com/travis_stuff/include-what-you-use-clang-9.tgz" -o "include-what-you-use-clang-9.tgz" ; tar -xzf "include-what-you-use-clang-9.tgz" ; cd include-what-you-use ; From 4049467ed1c0756753264fc7b162d2cd9a702bd7 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 22:45:41 -0800 Subject: [PATCH 53/72] build iwyu in place --- .github/workflows/verify-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 9841c7cd..9e328c37 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -247,7 +247,7 @@ jobs: curl "https://libhttpserver.s3.amazonaws.com/travis_stuff/include-what-you-use-clang-9.tgz" -o "include-what-you-use-clang-9.tgz" ; tar -xzf "include-what-you-use-clang-9.tgz" ; cd include-what-you-use ; - cd .. ; + cd mkdir build_iwyu ; cd build_iwyu ; cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$ROOT_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../include-what-you-use ; From 232a27f6ef44d020d929f6ab235da12746dc7a90 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 22:51:19 -0800 Subject: [PATCH 54/72] force c++14 compatibility --- .github/workflows/verify-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 9e328c37..fa3a5b35 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -250,7 +250,7 @@ jobs: cd mkdir build_iwyu ; cd build_iwyu ; - cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$ROOT_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../include-what-you-use ; + cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS=-std=gnu++14 -DCMAKE_PREFIX_PATH=$ROOT_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../include-what-you-use ; make ; sudo make install ; cd .. ; From 069ee11ce88e7e68f79af4c1b6e718b67997f014 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 22:55:45 -0800 Subject: [PATCH 55/72] fix typo --- .github/workflows/verify-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index fa3a5b35..b7197047 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -247,7 +247,7 @@ jobs: curl "https://libhttpserver.s3.amazonaws.com/travis_stuff/include-what-you-use-clang-9.tgz" -o "include-what-you-use-clang-9.tgz" ; tar -xzf "include-what-you-use-clang-9.tgz" ; cd include-what-you-use ; - cd + mkdir build_iwyu ; cd build_iwyu ; cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS=-std=gnu++14 -DCMAKE_PREFIX_PATH=$ROOT_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../include-what-you-use ; From b45e06c9ebbb353cf8d104d4c85e4281057b14e0 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sat, 27 Feb 2021 23:24:02 -0800 Subject: [PATCH 56/72] Fix path --- .github/workflows/verify-build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index b7197047..24148dd4 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -247,10 +247,9 @@ jobs: curl "https://libhttpserver.s3.amazonaws.com/travis_stuff/include-what-you-use-clang-9.tgz" -o "include-what-you-use-clang-9.tgz" ; tar -xzf "include-what-you-use-clang-9.tgz" ; cd include-what-you-use ; - mkdir build_iwyu ; cd build_iwyu ; - cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS=-std=gnu++14 -DCMAKE_PREFIX_PATH=$ROOT_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../include-what-you-use ; + cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS=-std=gnu++14 -DCMAKE_PREFIX_PATH=$ROOT_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../ ; make ; sudo make install ; cd .. ; From 2cd6296eca07b988680c0d4e642e5c9feaa1f4de Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sun, 28 Feb 2021 14:05:51 -0800 Subject: [PATCH 57/72] Use system iwyu and reference libraries --- .github/workflows/verify-build.yml | 42 ++++++++++++++++-------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 24148dd4..f43980f5 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -196,8 +196,8 @@ jobs: os: ubuntu-latest build-type: iwyu compiler-family: clang - c-compiler: clang-9 - cc-compiler: clang-9++ + c-compiler: clang-7 + cc-compiler: clang-7++ debug: nodebug coverage: nocoverage steps: @@ -236,24 +236,24 @@ jobs: - name: Install IWYU dependencies if needed run: | - sudo apt-get install cmake llvm-9-dev llvm-9-tools libclang-9-dev clang-9 + sudo apt-get install cmake llvm-7-dev llvm-7-tools libclang-7-dev clang-7 iwyu if: ${{ matrix.build-type == 'iwyu' }} # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. - - name: Install IWYU if requested - run: | - CLANG_ROOT_PATH=`llvm-config-9 --prefix` ; - CLANG_BIN_PATH=`llvm-config-9 --bindir` ; - curl "https://libhttpserver.s3.amazonaws.com/travis_stuff/include-what-you-use-clang-9.tgz" -o "include-what-you-use-clang-9.tgz" ; - tar -xzf "include-what-you-use-clang-9.tgz" ; - cd include-what-you-use ; - mkdir build_iwyu ; - cd build_iwyu ; - cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS=-std=gnu++14 -DCMAKE_PREFIX_PATH=$ROOT_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../ ; - make ; - sudo make install ; - cd .. ; - if: ${{ matrix.build-type == 'iwyu' }} + # - name: Install IWYU if requested + # run: | + # CLANG_ROOT_PATH=`llvm-config-9 --prefix` ; + # CLANG_BIN_PATH=`llvm-config-9 --bindir` ; + # curl "https://libhttpserver.s3.amazonaws.com/travis_stuff/include-what-you-use-clang-9.tgz" -o "include-what-you-use-clang-9.tgz" ; + # tar -xzf "include-what-you-use-clang-9.tgz" ; + # cd include-what-you-use ; + # mkdir build_iwyu ; + # cd build_iwyu ; + # cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS=-std=gnu++14 -DCMAKE_PREFIX_PATH=$ROOT_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../ ; + # make ; + # sudo make install ; + # cd .. ; + # if: ${{ matrix.build-type == 'iwyu' }} - name: CURL from cache (for testing) id: cache-CURL @@ -351,9 +351,11 @@ jobs: run: | cd build ; if [ "$BUILD_TYPE" = "iwyu" ]; then - clang-9 -print-resource-dir ; - /usr/local/bin/include-what-you-use -print-resource-dir ; - 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" ; + clang-7 -print-resource-dir ; + /usr/bin/include-what-you-use -print-resource-dir ; + sudo ln -s `clang-7 -print-resource dir`/include `/usr/bin/include-what-you-use -print-resource-dir`/include ; + sudo ln -s `clang-7 -print-resource dir`/lib `/usr/bin/include-what-you-use -print-resource-dir`/lib ; + make -k CXX='/usr/bin/include-what-you-use -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS" ; if [ $? -ne 2 ]; then return 1; fi From de7ff2267e649e357917f26a368d71631febe690 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sun, 28 Feb 2021 14:13:50 -0800 Subject: [PATCH 58/72] Install IWYU only --- .github/workflows/verify-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index f43980f5..82f6999a 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -234,9 +234,9 @@ jobs: sudo apt-get install valgrind valgrind-dbg if: ${{ matrix.build-type == 'valgrind' }} - - name: Install IWYU dependencies if needed + - name: Install IWYU if needed run: | - sudo apt-get install cmake llvm-7-dev llvm-7-tools libclang-7-dev clang-7 iwyu + sudo apt-get install iwyu if: ${{ matrix.build-type == 'iwyu' }} # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. From 394d9b0fde87831d0b76775de5ece8d15823c443 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sun, 28 Feb 2021 14:23:13 -0800 Subject: [PATCH 59/72] Temporarily disable iwyu installation --- .github/workflows/verify-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 82f6999a..69813d78 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -234,10 +234,10 @@ jobs: sudo apt-get install valgrind valgrind-dbg if: ${{ matrix.build-type == 'valgrind' }} - - name: Install IWYU if needed - run: | - sudo apt-get install iwyu - if: ${{ matrix.build-type == 'iwyu' }} + # - name: Install IWYU if needed + # run: | + # sudo apt-get install iwyu + # if: ${{ matrix.build-type == 'iwyu' }} # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. # - name: Install IWYU if requested From 4ea472d8bce0a00193a7732fb875ce0cb661bc69 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sun, 28 Feb 2021 14:26:53 -0800 Subject: [PATCH 60/72] No custom config for iwyu --- .github/workflows/verify-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 69813d78..1c04dde7 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -340,8 +340,8 @@ jobs: ../configure --enable-debug --disable-shared --disable-fastopen; elif [ "$BUILD_TYPE" = "valgrind" ]; then ../configure --enable-debug --disable-fastopen --disable-valgrind-helgrind --disable-valgrind-drd --disable-valgrind-sgcheck; - elif [ "$BUILD_TYPE" = "iwyu" ]; then - ../configure --disable-examples; + #elif [ "$BUILD_TYPE" = "iwyu" ]; then + # ../configure --disable-examples; else ../configure --disable-fastopen; fi From 67d795d7fb8920fc3e27aaf6017aa0b3de92162c Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sun, 28 Feb 2021 14:32:50 -0800 Subject: [PATCH 61/72] Fix compiler for iwyu --- .github/workflows/verify-build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 1c04dde7..ccd248d5 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -197,7 +197,7 @@ jobs: build-type: iwyu compiler-family: clang c-compiler: clang-7 - cc-compiler: clang-7++ + cc-compiler: clang++-7 debug: nodebug coverage: nocoverage steps: @@ -234,10 +234,10 @@ jobs: sudo apt-get install valgrind valgrind-dbg if: ${{ matrix.build-type == 'valgrind' }} - # - name: Install IWYU if needed - # run: | - # sudo apt-get install iwyu - # if: ${{ matrix.build-type == 'iwyu' }} + - name: Install IWYU if needed + run: | + sudo apt-get install iwyu + if: ${{ matrix.build-type == 'iwyu' }} # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. # - name: Install IWYU if requested @@ -340,8 +340,8 @@ jobs: ../configure --enable-debug --disable-shared --disable-fastopen; elif [ "$BUILD_TYPE" = "valgrind" ]; then ../configure --enable-debug --disable-fastopen --disable-valgrind-helgrind --disable-valgrind-drd --disable-valgrind-sgcheck; - #elif [ "$BUILD_TYPE" = "iwyu" ]; then - # ../configure --disable-examples; + elif [ "$BUILD_TYPE" = "iwyu" ]; then + ../configure --disable-examples; else ../configure --disable-fastopen; fi From 678372db6846bf98552a8db93ecd1173f6b644f6 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sun, 28 Feb 2021 14:44:27 -0800 Subject: [PATCH 62/72] Use clang 5 with iwyu --- .github/workflows/verify-build.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index ccd248d5..08053d72 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -196,8 +196,8 @@ jobs: os: ubuntu-latest build-type: iwyu compiler-family: clang - c-compiler: clang-7 - cc-compiler: clang++-7 + c-compiler: clang-5 + cc-compiler: clang++-5 debug: nodebug coverage: nocoverage steps: @@ -240,7 +240,7 @@ jobs: if: ${{ matrix.build-type == 'iwyu' }} # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. - # - name: Install IWYU if requested + #- name: Install IWYU if requested # run: | # CLANG_ROOT_PATH=`llvm-config-9 --prefix` ; # CLANG_BIN_PATH=`llvm-config-9 --bindir` ; @@ -252,7 +252,6 @@ jobs: # cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS=-std=gnu++14 -DCMAKE_PREFIX_PATH=$ROOT_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../ ; # make ; # sudo make install ; - # cd .. ; # if: ${{ matrix.build-type == 'iwyu' }} - name: CURL from cache (for testing) @@ -351,10 +350,10 @@ jobs: run: | cd build ; if [ "$BUILD_TYPE" = "iwyu" ]; then - clang-7 -print-resource-dir ; + clang-5 -print-resource-dir ; /usr/bin/include-what-you-use -print-resource-dir ; - sudo ln -s `clang-7 -print-resource dir`/include `/usr/bin/include-what-you-use -print-resource-dir`/include ; - sudo ln -s `clang-7 -print-resource dir`/lib `/usr/bin/include-what-you-use -print-resource-dir`/lib ; + sudo ln -s `clang-5 -print-resource dir`/include `/usr/bin/include-what-you-use -print-resource-dir`/include ; + sudo ln -s `clang-5 -print-resource dir`/lib `/usr/bin/include-what-you-use -print-resource-dir`/lib ; make -k CXX='/usr/bin/include-what-you-use -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS" ; if [ $? -ne 2 ]; then return 1; From e3d5b5b05a23fa9656369b42c296c699769ca359 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sun, 28 Feb 2021 14:57:50 -0800 Subject: [PATCH 63/72] IWYU with clang-9 --- .github/workflows/verify-build.yml | 61 ++++++++++++++++-------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 08053d72..000500b6 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -196,8 +196,8 @@ jobs: os: ubuntu-latest build-type: iwyu compiler-family: clang - c-compiler: clang-5 - cc-compiler: clang++-5 + c-compiler: clang-9 + cc-compiler: clang++-9 debug: nodebug coverage: nocoverage steps: @@ -220,39 +220,40 @@ jobs: if: ${{ matrix.test-group == 'extra' && matrix.os == 'ubuntu-latest' }} - name: Install optional clang if needed - run: | - sudo apt-get install ${{ matrix.c-compiler }} + run: sudo apt-get install ${{ matrix.c-compiler }} if: ${{ matrix.compiler-family == 'clang' && matrix.os == 'ubuntu-latest' }} - name: Install optional gcc if needed - run: | - sudo apt-get install ${{ matrix.cc-compiler }} + run: sudo apt-get install ${{ matrix.cc-compiler }} if: ${{ matrix.compiler-family == 'gcc' && matrix.os == 'ubuntu-latest' }} - name: Install valgrind if needed - run: | - sudo apt-get install valgrind valgrind-dbg + run: sudo apt-get install valgrind valgrind-dbg if: ${{ matrix.build-type == 'valgrind' }} - - - name: Install IWYU if needed + + - name: Install IWYU dependencies if needed run: | - sudo apt-get install iwyu + # Use same deps used by iwyu in their setup for travis + sudo apt-get install llvm-9-dev llvm-9-tools libclang-9-dev ; + # Use same CMAKE used by iwyu in their setup for travis + wget -O cmake.sh https://cmake.org/files/v3.10/cmake-3.10.0-Linux-x86_64.sh ; + sudo sh cmake.sh --skip-license --exclude-subdir --prefix=/usr/local ; if: ${{ matrix.build-type == 'iwyu' }} # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. - #- name: Install IWYU if requested - # run: | - # CLANG_ROOT_PATH=`llvm-config-9 --prefix` ; - # CLANG_BIN_PATH=`llvm-config-9 --bindir` ; - # curl "https://libhttpserver.s3.amazonaws.com/travis_stuff/include-what-you-use-clang-9.tgz" -o "include-what-you-use-clang-9.tgz" ; - # tar -xzf "include-what-you-use-clang-9.tgz" ; - # cd include-what-you-use ; - # mkdir build_iwyu ; - # cd build_iwyu ; - # cmake -G "Unix Makefiles" -DCMAKE_CXX_FLAGS=-std=gnu++14 -DCMAKE_PREFIX_PATH=$ROOT_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../ ; - # make ; - # sudo make install ; - # if: ${{ matrix.build-type == 'iwyu' }} + - name: Install IWYU if requested + run: | + CLANG_ROOT_PATH=`llvm-config-9 --prefix` ; + CLANG_BIN_PATH=`llvm-config-9 --bindir` ; + curl "https://libhttpserver.s3.amazonaws.com/travis_stuff/include-what-you-use-clang-9.tgz" -o "include-what-you-use-clang-9.tgz" ; + tar -xzf "include-what-you-use-clang-9.tgz" ; + cd include-what-you-use ; + mkdir build_iwyu ; + cd build_iwyu ; + cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$CLANG_ROOT_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../ ; + make ; + sudo make install ; + if: ${{ matrix.build-type == 'iwyu' }} - name: CURL from cache (for testing) id: cache-CURL @@ -350,11 +351,13 @@ jobs: run: | cd build ; if [ "$BUILD_TYPE" = "iwyu" ]; then - clang-5 -print-resource-dir ; - /usr/bin/include-what-you-use -print-resource-dir ; - sudo ln -s `clang-5 -print-resource dir`/include `/usr/bin/include-what-you-use -print-resource-dir`/include ; - sudo ln -s `clang-5 -print-resource dir`/lib `/usr/bin/include-what-you-use -print-resource-dir`/lib ; - make -k CXX='/usr/bin/include-what-you-use -Xiwyu --mapping_file=${top_builddir}/../custom_iwyu.imp' CXXFLAGS="-std=c++11 -DHTTPSERVER_COMPILATION -D_REENTRANT $CXXFLAGS" ; + echo "Print resource directories" ; + clang-9 -print-resource-dir ; + /usr/local/bin/include-what-you-use -print-resource-dir ; + #sudo ln -s `clang-5 -print-resource dir`/include `/usr/local/bin/include-what-you-use -print-resource-dir`/include ; + #sudo ln -s `clang-5 -print-resource dir`/lib `/usr/local/bin/include-what-you-use -print-resource-dir`/lib ; + echo "Running IWYU" ; + 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" ; if [ $? -ne 2 ]; then return 1; fi From 75460dcb620150b91cc34a54b4ed131251e4e568 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sun, 28 Feb 2021 15:03:40 -0800 Subject: [PATCH 64/72] Remove resource dir printing --- .github/workflows/verify-build.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 000500b6..f5bd4716 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -351,12 +351,6 @@ jobs: run: | cd build ; if [ "$BUILD_TYPE" = "iwyu" ]; then - echo "Print resource directories" ; - clang-9 -print-resource-dir ; - /usr/local/bin/include-what-you-use -print-resource-dir ; - #sudo ln -s `clang-5 -print-resource dir`/include `/usr/local/bin/include-what-you-use -print-resource-dir`/include ; - #sudo ln -s `clang-5 -print-resource dir`/lib `/usr/local/bin/include-what-you-use -print-resource-dir`/lib ; - echo "Running IWYU" ; 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" ; if [ $? -ne 2 ]; then return 1; From f79df4b24e539c1d7d0d89fd7541212e37417144 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sun, 28 Feb 2021 23:24:07 +0000 Subject: [PATCH 65/72] Fix includes to match iwyu --- src/basic_auth_fail_response.cpp | 1 + src/deferred_response.cpp | 1 + src/details/http_endpoint.cpp | 2 +- src/digest_auth_fail_response.cpp | 1 + src/file_response.cpp | 1 + src/http_resource.cpp | 1 + src/http_utils.cpp | 1 - src/string_response.cpp | 1 + src/webserver.cpp | 3 +++ 9 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/basic_auth_fail_response.cpp b/src/basic_auth_fail_response.cpp index 49d9f5a9..36ea59bd 100644 --- a/src/basic_auth_fail_response.cpp +++ b/src/basic_auth_fail_response.cpp @@ -20,6 +20,7 @@ #include "httpserver/basic_auth_fail_response.hpp" #include +#include struct MHD_Connection; struct MHD_Response; diff --git a/src/deferred_response.cpp b/src/deferred_response.cpp index f3d44527..916b1174 100644 --- a/src/deferred_response.cpp +++ b/src/deferred_response.cpp @@ -20,6 +20,7 @@ #include "httpserver/deferred_response.hpp" #include +#include struct MHD_Response; diff --git a/src/details/http_endpoint.cpp b/src/details/http_endpoint.cpp index 584fb507..5d65aa9e 100644 --- a/src/details/http_endpoint.cpp +++ b/src/details/http_endpoint.cpp @@ -19,13 +19,13 @@ */ #include +#include #include #include #include #include #include #include -#include #include #include "httpserver/details/http_endpoint.hpp" diff --git a/src/digest_auth_fail_response.cpp b/src/digest_auth_fail_response.cpp index ca95526d..f232eac2 100644 --- a/src/digest_auth_fail_response.cpp +++ b/src/digest_auth_fail_response.cpp @@ -20,6 +20,7 @@ #include "httpserver/digest_auth_fail_response.hpp" #include +#include struct MHD_Connection; struct MHD_Response; diff --git a/src/file_response.cpp b/src/file_response.cpp index 66d13a1c..64396f10 100644 --- a/src/file_response.cpp +++ b/src/file_response.cpp @@ -23,6 +23,7 @@ #include #include #include +#include struct MHD_Response; diff --git a/src/http_resource.cpp b/src/http_resource.cpp index 46bdb0de..67fb555b 100644 --- a/src/http_resource.cpp +++ b/src/http_resource.cpp @@ -20,6 +20,7 @@ #include "httpserver/http_resource.hpp" #include +#include #include "httpserver/string_response.hpp" namespace httpserver { class http_response; } diff --git a/src/http_utils.cpp b/src/http_utils.cpp index 53c2230f..7f1ea0a6 100644 --- a/src/http_utils.cpp +++ b/src/http_utils.cpp @@ -33,7 +33,6 @@ #include #include -#include #include #include #include diff --git a/src/string_response.cpp b/src/string_response.cpp index 75a557f8..dec3c66a 100644 --- a/src/string_response.cpp +++ b/src/string_response.cpp @@ -21,6 +21,7 @@ #include "httpserver/string_response.hpp" #include #include +#include struct MHD_Response; diff --git a/src/webserver.cpp b/src/webserver.cpp index 38542f2a..8de4a9e7 100644 --- a/src/webserver.cpp +++ b/src/webserver.cpp @@ -41,6 +41,9 @@ #include #include #include +#include +#include +#include #include #include #include From a2b3c93528939c880b2cd26dbae119f9770424b6 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sun, 28 Feb 2021 23:45:10 +0000 Subject: [PATCH 66/72] Handle IWYU error code --- .github/workflows/verify-build.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index f5bd4716..3842427e 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -349,14 +349,22 @@ jobs: # 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). - name: Make or run IWYU run: | - cd build ; - if [ "$BUILD_TYPE" = "iwyu" ]; then + # IWYU always return an error code. If it returns "2" it indicates a success so we manage this within the function below. + function safe_make_iwyu() { + 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" ; if [ $? -ne 2 ]; then return 1; fi + + return 0; + } + + cd build ; + if [ "$BUILD_TYPE" = "iwyu" ]; then + safe_make_iwyu ; else - make; + make ; fi - name: Run tests From 41f49073e6351cdf1e0406176ff15b4abcaaf1eb Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Mon, 1 Mar 2021 00:00:00 +0000 Subject: [PATCH 67/72] Handle IWYU error code --- .github/workflows/verify-build.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 3842427e..9b35b459 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -351,11 +351,15 @@ jobs: run: | # IWYU always return an error code. If it returns "2" it indicates a success so we manage this within the function below. function safe_make_iwyu() { - - 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" ; - if [ $? -ne 2 ]; then - return 1; - fi + { + 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" ; + } || { + if [ $? -ne 2 ]; then + return 1; + else + return 0; + fi + } return 0; } From 171ef0bd8389257f79a422a11c4e2a919d4df0dc Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sun, 28 Feb 2021 18:18:35 -0800 Subject: [PATCH 68/72] Add performance tests and cleanup --- .github/workflows/verify-build.yml | 69 ++++++++++++++++++++++++------ 1 file changed, 56 insertions(+), 13 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 9b35b459..f9e03c0d 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -200,6 +200,30 @@ jobs: cc-compiler: clang++-9 debug: nodebug coverage: nocoverage + - test-group: performance + os: ubuntu-latest + build-type: select + compiler-family: gcc + c-compiler: gcc-7 + cc-compiler: g++-7 + debug: nodebug + coverage: nocoverage + - test-group: performance + os: ubuntu-latest + build-type: nodelay + compiler-family: gcc + c-compiler: gcc-7 + cc-compiler: g++-7 + debug: nodebug + coverage: nocoverage + - test-group: performance + os: ubuntu-latest + build-type: threads + compiler-family: gcc + c-compiler: gcc-7 + cc-compiler: g++-7 + debug: nodebug + coverage: nocoverage steps: - name: Checkout repository uses: actions/checkout@v2 @@ -218,7 +242,11 @@ jobs: sudo add-apt-repository ppa:ubuntu-toolchain-r/test ; sudo apt-get update ; if: ${{ matrix.test-group == 'extra' && matrix.os == 'ubuntu-latest' }} - + + - name: Install apache benchmark if needed + run: sudo apt-get install apache2-utils ; + if: ${{ matrix.test-group == 'performance' && matrix.os == 'ubuntu-latest' }} + - name: Install optional clang if needed run: sudo apt-get install ${{ matrix.c-compiler }} if: ${{ matrix.compiler-family == 'clang' && matrix.os == 'ubuntu-latest' }} @@ -229,7 +257,7 @@ jobs: - name: Install valgrind if needed run: sudo apt-get install valgrind valgrind-dbg - if: ${{ matrix.build-type == 'valgrind' }} + if: ${{ matrix.build-type == 'valgrind' && matrix.os == 'ubuntu-latest' }} - name: Install IWYU dependencies if needed run: | @@ -238,10 +266,18 @@ jobs: # Use same CMAKE used by iwyu in their setup for travis wget -O cmake.sh https://cmake.org/files/v3.10/cmake-3.10.0-Linux-x86_64.sh ; sudo sh cmake.sh --skip-license --exclude-subdir --prefix=/usr/local ; - if: ${{ matrix.build-type == 'iwyu' }} + if: ${{ matrix.build-type == 'iwyu' && matrix.os == 'ubuntu-latest' }} + + - name: IWYU from cache (for testing) + id: cache-IWYU + uses: actions/cache@v2 + with: + path: include-what-you-use + key: ${{ matrix.os }}-include-what-you-use-pre-built + if: ${{ matrix.build-type == 'iwyu' && matrix.os == 'ubuntu-latest' }} # Installing iwyu manually because clang and iwyu paths won't match on Ubuntu otherwise. - - name: Install IWYU if requested + - name: Build IWYU if requested run: | CLANG_ROOT_PATH=`llvm-config-9 --prefix` ; CLANG_BIN_PATH=`llvm-config-9 --bindir` ; @@ -253,7 +289,13 @@ jobs: cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$CLANG_ROOT_PATH -DCMAKE_C_COMPILER=$CLANG_BIN_PATH/clang -DCMAKE_CXX_COMPILER=$CLANG_BIN_PATH/clang++ ../ ; make ; sudo make install ; - if: ${{ matrix.build-type == 'iwyu' }} + if: ${{ matrix.build-type == 'iwyu' && matrix.os == 'ubuntu-latest' && steps.cache-IWYU.outputs.cache-hit != 'true' }} + + - name: Install IWYU if requested + run: | + cd include-what-you-use/build_iwyu ; + sudo make install ; + if: ${{ matrix.build-type == 'iwyu' && matrix.os == 'ubuntu-latest' }} - name: CURL from cache (for testing) id: cache-CURL @@ -261,6 +303,7 @@ jobs: with: path: curl-7.75.0 key: ${{ matrix.os }}-CURL-pre-built + if: ${{ matrix.os == 'macos-latest' }} - name: Build CURL (for testing) run: | @@ -269,7 +312,7 @@ jobs: cd curl-7.75.0 ; if [ "$matrix.os" = "ubuntu-latest" ]; then ./configure ; else ./configure --with-darwinssl ; fi make ; - if: steps.cache-CURL.outputs.cache-hit != 'true' + if: ${{ matrix.os == 'macos-latest' && steps.cache-CURL.outputs.cache-hit != 'true' }} - name: Install CURL (for testing on mac only) run: cd curl-7.75.0 ; sudo make install ; @@ -387,31 +430,31 @@ jobs: - name: Run performance tests (select) run: | - if [ "$PERFORMANCE" = "select" ]; then + if [ "$BUILD_TYPE" = "select" ]; then cd build cd examples ./benchmark_select 8080 $(nproc) & - sleep 5 && ab -n 10000000 -c 100 localhost:8080/plaintext + sleep 5 && ab -n 1000000 -c 100 localhost:8080/plaintext fi - name: Run performance tests (nodelay) run: | - if [ "$PERFORMANCE" = "nodelay" ]; then + if [ "$BUILD_TYPE" = "nodelay" ]; then cd build cd examples ./benchmark_nodelay 8080 $(nproc) & - sleep 5 && ab -n 10000000 -c 100 localhost:8080/plaintext + sleep 5 && ab -n 1000000 -c 100 localhost:8080/plaintext fi - name: Run performance tests (threads) run: | - if [ "$PERFORMANCE" = "threads" ]; then + if [ "$BUILD_TYPE" = "threads" ]; then cd build cd examples ./benchmark_threads 8080 & - sleep 5 && ab -n 10000000 -c 100 localhost:8080/plaintext + sleep 5 && ab -n 1000000 -c 100 localhost:8080/plaintext fi - name: Push code coverage data run: if [ "$DEBUG" = "debug" ] && [ "$COVERAGE" = "coverage" ]; then cd build ; bash <(curl -s https://codecov.io/bash); fi - if: ${{ matrix.os == 'ubuntu-latest' && matrix.c-compiler == 'gcc' }} + if: ${{ matrix.os == 'ubuntu-latest' && matrix.c-compiler == 'gcc' && success() }} From 65e4dcf46a78e8a2fcea6d283c9979e3f3e69a9d Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sun, 28 Feb 2021 18:34:16 -0800 Subject: [PATCH 69/72] Use github actions syntax for selective builds --- .github/workflows/verify-build.yml | 45 ++++++++++++++++++------------ 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index f9e03c0d..8072c90d 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -415,44 +415,53 @@ jobs: fi - name: Run tests - run: if [ "$BUILD_TYPE" != "iwyu" ]; then cd build ; make check; cat test/test-suite.log ; fi + run: | + cd build ; + make check; + if: ${{ matrix.build-type != 'iwyu' }} - name: Print tests results - run: if [ "$BUILD_TYPE" != "iwyu" ]; then cd build ; cat test/test-suite.log; fi - if: ${{ failure() }} + run: | + cd build ; + cat test/test-suite.log ; + if: ${{ failure() && matrix.build-type != 'iwyu' }} - name: Run Valgrind checks - run: if [ "$BUILD_TYPE" = "valgrind" ]; then cd build ; make check-valgrind; cat test/test-suite-memcheck.log; fi; + run: | + cd build ; + make check-valgrind ; + cat test/test-suite-memcheck.log ; + if: ${{ matrix.build-type == 'valgrind' }} - name: Run cppcheck - run: cd src/; cppcheck --error-exitcode=1 .; + run: | + cd src/ ; + cppcheck --error-exitcode=1 . ; if: ${{ matrix.os == 'ubuntu-latest' }} - name: Run performance tests (select) run: | - if [ "$BUILD_TYPE" = "select" ]; then - cd build - cd examples - ./benchmark_select 8080 $(nproc) & - sleep 5 && ab -n 1000000 -c 100 localhost:8080/plaintext - fi + cd build + cd examples + ./benchmark_select 8080 $(nproc) & + sleep 5 && ab -n 1000000 -c 100 localhost:8080/plaintext + if: ${{ matrix.build-type == 'select' }} - name: Run performance tests (nodelay) run: | - if [ "$BUILD_TYPE" = "nodelay" ]; then - cd build - cd examples - ./benchmark_nodelay 8080 $(nproc) & - sleep 5 && ab -n 1000000 -c 100 localhost:8080/plaintext - fi + cd build + cd examples + ./benchmark_nodelay 8080 $(nproc) & + sleep 5 && ab -n 1000000 -c 100 localhost:8080/plaintext + if: ${{ matrix.build-type == 'nodelay' }} - name: Run performance tests (threads) run: | - if [ "$BUILD_TYPE" = "threads" ]; then cd build cd examples ./benchmark_threads 8080 & sleep 5 && ab -n 1000000 -c 100 localhost:8080/plaintext + if: ${{ matrix.build-type == 'threads' }} fi - name: Push code coverage data From 53906c068e1c83905d3111404d21510fe90ec83a Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sun, 28 Feb 2021 18:39:03 -0800 Subject: [PATCH 70/72] Fix typo --- .github/workflows/verify-build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index 8072c90d..af56e50a 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -462,8 +462,9 @@ jobs: ./benchmark_threads 8080 & sleep 5 && ab -n 1000000 -c 100 localhost:8080/plaintext if: ${{ matrix.build-type == 'threads' }} - fi - name: Push code coverage data - run: if [ "$DEBUG" = "debug" ] && [ "$COVERAGE" = "coverage" ]; then cd build ; bash <(curl -s https://codecov.io/bash); fi - if: ${{ matrix.os == 'ubuntu-latest' && matrix.c-compiler == 'gcc' && success() }} + run: | + cd build ; + bash <(curl -s https://codecov.io/bash) ; + if: ${{ matrix.os == 'ubuntu-latest' && matrix.c-compiler == 'gcc' && matrix.debug == 'debug' && matrix.coverage == 'coverage' && success() }} From 7dad773c45ed2a609f2b94c07f543d08cdc5e3c2 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Sun, 28 Feb 2021 18:50:08 -0800 Subject: [PATCH 71/72] Use explicit IP address on ab --- .github/workflows/verify-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/verify-build.yml b/.github/workflows/verify-build.yml index af56e50a..09464e0d 100644 --- a/.github/workflows/verify-build.yml +++ b/.github/workflows/verify-build.yml @@ -444,7 +444,7 @@ jobs: cd build cd examples ./benchmark_select 8080 $(nproc) & - sleep 5 && ab -n 1000000 -c 100 localhost:8080/plaintext + sleep 5 && ab -n 1000000 -c 100 127.0.0.1:8080/plaintext if: ${{ matrix.build-type == 'select' }} - name: Run performance tests (nodelay) @@ -452,7 +452,7 @@ jobs: cd build cd examples ./benchmark_nodelay 8080 $(nproc) & - sleep 5 && ab -n 1000000 -c 100 localhost:8080/plaintext + sleep 5 && ab -n 1000000 -c 100 127.0.0.1:8080/plaintext if: ${{ matrix.build-type == 'nodelay' }} - name: Run performance tests (threads) @@ -460,7 +460,7 @@ jobs: cd build cd examples ./benchmark_threads 8080 & - sleep 5 && ab -n 1000000 -c 100 localhost:8080/plaintext + sleep 5 && ab -n 1000000 -c 100 127.0.0.1:8080/plaintext if: ${{ matrix.build-type == 'threads' }} - name: Push code coverage data From 8ffb0911b090673e14a4fcfc33f7cce030e74c46 Mon Sep 17 00:00:00 2001 From: Sebastiano Merlino Date: Mon, 1 Mar 2021 03:06:37 +0000 Subject: [PATCH 72/72] remove travis config --- .travis.yml | 358 ---------------------------------------------------- 1 file changed, 358 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5aa66c2e..00000000 --- a/.travis.yml +++ /dev/null @@ -1,358 +0,0 @@ -language: cpp -os: - - linux - - osx -compiler: - - gcc - - clang -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" ; - 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]$' ; - if [ $? -eq 0 ]; then - git checkout clang_${CLANG_PKG_VERSION} ; - else - git checkout clang_${CLANG_PKG_VERSION}.0 ; - fi; - 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 ; - 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 - - export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib - - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install info install-info; fi - - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo pip install codecov; fi - - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo pip install gcovr; fi - - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install cppcheck; fi - - if [ "$TRAVIS_OS_NAME" = "osx" ]; then export CFLAGS='-mtune=generic'; fi - - if [ "$TRAVIS_OS_NAME" = "osx" ]; then export IPV6_TESTS_ENABLED="true"; fi - - curl https://s3.amazonaws.com/libhttpserver/libmicrohttpd_releases/libmicrohttpd-0.9.59.tar.gz -o libmicrohttpd-0.9.59.tar.gz - - tar -xzf libmicrohttpd-0.9.59.tar.gz - - cd libmicrohttpd-0.9.59 - - ./configure --disable-examples - - make - - sudo make install - - cd .. - - if [ "$BUILD_TYPE" = "asan" ]; then export CFLAGS='-fsanitize=address'; export CXXLAGS='-fsanitize=address'; export LDFLAGS='-fsanitize=address'; fi - - if [ "$BUILD_TYPE" = "msan" ]; then export CFLAGS='-fsanitize=memory'; export CXXLAGS='-fsanitize=memory'; export LDFLAGS='-fsanitize=memory'; fi - - if [ "$BUILD_TYPE" = "lsan" ]; then export CFLAGS='-fsanitize=leak'; export CXXLAGS='-fsanitize=leak'; export LDFLAGS='-fsanitize=leak'; fi - - if [ "$BUILD_TYPE" = "tsan" ]; then export CFLAGS='-fsanitize=thread'; export CXXLAGS='-fsanitize=thread'; export LDFLAGS='-fsanitize=thread'; fi - - if [ "$BUILD_TYPE" = "ubsan" ]; then export export CFLAGS='-fsanitize=undefined'; export CXXLAGS='-fsanitize=undefined'; export LDFLAGS='-fsanitize=undefined'; fi -install: - - ./bootstrap - - mkdir build - - cd build - - | - if [ "$LINKING" = "static" ]; then - ../configure --enable-static --disable-fastopen; - elif [ "$DEBUG" = "debug" ] && [ "$COVERAGE" = "coverage" ]; then - ../configure --enable-debug --enable-coverage --disable-shared --disable-fastopen; - elif [ "$DEBUG" = "debug" ]; then - ../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 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" ; - if [ $? -ne 2 ]; then - return 1; - fi - else - make; - fi -script: - - 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 - - | - if [ "$PERFORMANCE" = "select" ]; then - cd examples - ./benchmark_select 8080 $(nproc) & - sleep 5 && ab -n 10000000 -c 100 localhost:8080/plaintext - fi - - | - if [ "$PERFORMANCE" = "nodelay" ]; then - cd examples - ./benchmark_nodelay 8080 $(nproc) & - sleep 5 && ab -n 10000000 -c 100 localhost:8080/plaintext - fi - - | - if [ "$PERFORMANCE" = "threads" ]; then - cd examples - ./benchmark_threads 8080 & - sleep 5 && ab -n 10000000 -c 100 localhost:8080/plaintext - fi -after_success: - - if [ "$DEBUG" = "debug" ] && [ "$COVERAGE" = "coverage" ] && [ "$TRAVIS_OS_NAME" = "linux" ]; then bash <(curl -s https://codecov.io/bash); fi -matrix: - exclude: - - 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 - 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"