From 55883a9f39a45cff3e3a735676f8d893cd478f9f Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 24 Aug 2022 12:48:46 -0400 Subject: [PATCH 1/7] Update build steps for Build On Linux `Build on Linux (fake, gcc_release, clang, simulated)` periodically times out, like for https://github.com/project-chip/connectedhomeip/runs/7996944701?check_suite_focus=true Fixes #22134 --- .github/workflows/build.yaml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ecef4f5a31da24..d5483e470de0ff 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -122,7 +122,7 @@ jobs: retention-days: 5 build_linux: name: Build on Linux (fake, gcc_release, clang, simulated) - timeout-minutes: 120 + timeout-minutes: 150 runs-on: ubuntu-latest if: github.actor != 'restyled-io[bot]' @@ -185,16 +185,9 @@ jobs: - name: Setup Build, Run Build and Run Tests timeout-minutes: 90 run: | - for BUILD_TYPE in gcc_release clang; do - case $BUILD_TYPE in - "gcc_release") GN_ARGS='is_debug=false';; - "clang") GN_ARGS='is_clang=true';; - esac - - BUILD_TYPE=$BUILD_TYPE scripts/build/gn_gen.sh --args="$GN_ARGS" --export-compile-commands - scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE" - BUILD_TYPE=$BUILD_TYPE scripts/tests/gn_tests.sh - done + BUILD_TYPE=gcc_release scripts/build/gn_gen.sh --args="is_debug=false" --export-compile-commands + scripts/run_in_build_env.sh "ninja -C ./out/gcc_release" + BUILD_TYPE=gcc_release scripts/tests/gn_tests.sh - name: Clang-tidy validation timeout-minutes: 45 run: | From ae4679be6c2d805b4451bfc988339bf39d3353b3 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 24 Aug 2022 12:54:02 -0400 Subject: [PATCH 2/7] Move clang tidy validation to use one of the builds in sanitizer builds --- .github/workflows/build.yaml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d5483e470de0ff..1d03006007cfbd 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -185,24 +185,14 @@ jobs: - name: Setup Build, Run Build and Run Tests timeout-minutes: 90 run: | - BUILD_TYPE=gcc_release scripts/build/gn_gen.sh --args="is_debug=false" --export-compile-commands + BUILD_TYPE=gcc_release scripts/build/gn_gen.sh --args="is_debug=false" scripts/run_in_build_env.sh "ninja -C ./out/gcc_release" BUILD_TYPE=gcc_release scripts/tests/gn_tests.sh - - name: Clang-tidy validation - timeout-minutes: 45 - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/run-clang-tidy-on-compile-commands.py \ - --no-log-timestamps \ - --compile-database out/clang/compile_commands.json \ - check \ - " - name: Run Tests with sanitizers timeout-minutes: 60 env: LSAN_OPTIONS: detect_leaks=1 run: | - # for BUILD_TYPE in asan msan tsan ubsan; do for BUILD_TYPE in asan tsan ubsan; do case $BUILD_TYPE in "asan") GN_ARGS='is_clang=true is_asan=true';; @@ -211,9 +201,18 @@ jobs: "ubsan") GN_ARGS='is_clang=true is_ubsan=true';; esac - scripts/build/gn_gen.sh --args="$GN_ARGS" + scripts/build/gn_gen.sh --args="$GN_ARGS" --export-compile-commands scripts/tests/gn_tests.sh done + - name: Clang-tidy validation + timeout-minutes: 45 + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/run-clang-tidy-on-compile-commands.py \ + --no-log-timestamps \ + --compile-database out/ubsan/compile_commands.json \ + check \ + " - name: Build using build_examples.py timeout-minutes: 60 run: | From b0a5fb75fcecc2b4ee3ac8f7758d45cd0dbe8e00 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 24 Aug 2022 14:55:49 -0400 Subject: [PATCH 3/7] Ensure build output is known and cleaned after each sanitizer build and test, fix clang-tidy --- .github/workflows/build.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1d03006007cfbd..5fee7c85b829d9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -201,8 +201,9 @@ jobs: "ubsan") GN_ARGS='is_clang=true is_ubsan=true';; esac - scripts/build/gn_gen.sh --args="$GN_ARGS" --export-compile-commands - scripts/tests/gn_tests.sh + rm -rf ./out/sanitizers + BUILD_TYPE=sanitizers scripts/build/gn_gen.sh --args="$GN_ARGS" --export-compile-commands + BUILD_TYPE=sanitizers scripts/tests/gn_tests.sh done - name: Clang-tidy validation timeout-minutes: 45 @@ -210,7 +211,7 @@ jobs: ./scripts/run_in_build_env.sh \ "./scripts/run-clang-tidy-on-compile-commands.py \ --no-log-timestamps \ - --compile-database out/ubsan/compile_commands.json \ + --compile-database out/sanitizers/compile_commands.json \ check \ " - name: Build using build_examples.py From 29bbaeb909eec401b4cbcaf660d646140b6a05af Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 25 Aug 2022 10:31:51 -0400 Subject: [PATCH 4/7] Exclude lwip from clang-tidy validation --- .github/workflows/build.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5fee7c85b829d9..3a175c40534552 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -212,6 +212,7 @@ jobs: "./scripts/run-clang-tidy-on-compile-commands.py \ --no-log-timestamps \ --compile-database out/sanitizers/compile_commands.json \ + --file-exclude-regex "/(repo|zzz_generated|lwip/standalone)/", check \ " - name: Build using build_examples.py From 41c55679cbe1dfc4f308f3b64dfd8201accea62e Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 25 Aug 2022 10:33:54 -0400 Subject: [PATCH 5/7] do NOT upload objdir for linux ... it is way too big --- .github/workflows/build.yaml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3a175c40534552..8692449499804a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -239,14 +239,19 @@ jobs: path: /tmp/cores/ # Cores are big; don't hold on to them too long. retention-days: 5 - - name: Uploading objdir for debugging - uses: actions/upload-artifact@v2 - if: ${{ failure() && !env.ACT }} - with: - name: crash-objdir-linux - path: out/ - # objdirs are big; don't hold on to them too long. - retention-days: 5 + # OBJDIR on linux is > 10K files and takes more than 50 minutes to upload, usually + # having the job timeout. + # + # If re-enabling, some subset of this should be picked + # + # - name: Uploading objdir for debugging + # uses: actions/upload-artifact@v2 + # if: ${{ failure() && !env.ACT }} + # with: + # name: crash-objdir-linux + # path: out/ + # # objdirs are big; don't hold on to them too long. + # retention-days: 5 # TODO Log Upload https://github.com/project-chip/connectedhomeip/issues/2227 # TODO https://github.com/project-chip/connectedhomeip/issues/1512 From c9d65c703728e0c88940be6d4db12310bd7c5cbc Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 25 Aug 2022 16:40:00 -0400 Subject: [PATCH 6/7] Fix typo --- .github/workflows/build.yaml | 2 +- third_party/bouffalolab/bl602_sdk/repo | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8692449499804a..cbd106bd568687 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -212,7 +212,7 @@ jobs: "./scripts/run-clang-tidy-on-compile-commands.py \ --no-log-timestamps \ --compile-database out/sanitizers/compile_commands.json \ - --file-exclude-regex "/(repo|zzz_generated|lwip/standalone)/", + --file-exclude-regex "/(repo|zzz_generated|lwip/standalone)/" \ check \ " - name: Build using build_examples.py diff --git a/third_party/bouffalolab/bl602_sdk/repo b/third_party/bouffalolab/bl602_sdk/repo index 12e69c3f71fcad..38b4bd921d3620 160000 --- a/third_party/bouffalolab/bl602_sdk/repo +++ b/third_party/bouffalolab/bl602_sdk/repo @@ -1 +1 @@ -Subproject commit 12e69c3f71fcadbc048f7bd604d52b427f558d48 +Subproject commit 38b4bd921d3620a85d5306874247f45aab64eace From b843f0bc2a455596e7f84213eca1e6960fe8b6dd Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 25 Aug 2022 16:41:05 -0400 Subject: [PATCH 7/7] Another typo fix - remove invalid quotes --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index cbd106bd568687..6bf171d668b920 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -212,7 +212,7 @@ jobs: "./scripts/run-clang-tidy-on-compile-commands.py \ --no-log-timestamps \ --compile-database out/sanitizers/compile_commands.json \ - --file-exclude-regex "/(repo|zzz_generated|lwip/standalone)/" \ + --file-exclude-regex '/(repo|zzz_generated|lwip/standalone)/' \ check \ " - name: Build using build_examples.py