diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 012b054a929a99..49e7e515b00b19 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -66,6 +66,14 @@ jobs: run: | mkdir /tmp/cores || true sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh @@ -77,6 +85,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Setup Build run: scripts/build/gn_gen.sh --args="chip_config_memory_debug_checks=true chip_config_memory_debug_dmalloc=false" - name: Run Build @@ -173,6 +182,14 @@ jobs: run: | mkdir /tmp/cores || true sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh @@ -184,6 +201,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Setup and Build Simulated Device timeout-minutes: 20 run: | @@ -323,9 +341,18 @@ jobs: attempt_delay: 2000 - name: Checkout submodules run: scripts/checkout_submodules.py --shallow --platform linux + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh + - name: Setup Build, Run Build and Run Tests timeout-minutes: 50 run: | @@ -372,6 +399,14 @@ jobs: - name: Try to ensure the directory for diagnostic log collection exists run: | mkdir -p ~/Library/Logs/DiagnosticReports || true + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 run: scripts/build/gn_bootstrap.sh @@ -383,6 +418,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Setup and Build Simulated Device timeout-minutes: 20 run: | @@ -462,6 +498,14 @@ jobs: attempt_delay: 2000 - name: Checkout submodules run: scripts/checkout_submodules.py --shallow --platform linux + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh @@ -472,8 +516,8 @@ jobs: name: bootstrap-logs path: | .environment/gn_out/.ninja_log - .environment/pigweed-venv/*.log + .environment/pigweed-venv/*.log + - name: Run Build Coverage timeout-minutes: 20 run: ./scripts/build_coverage.sh - diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml index e3f9709180380a..fd5e1a9a7abfb6 100644 --- a/.github/workflows/chef.yaml +++ b/.github/workflows/chef.yaml @@ -43,6 +43,13 @@ jobs: attempt_delay: 2000 - name: Checkout submodules run: scripts/checkout_submodules.py --shallow --platform linux + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh @@ -71,6 +78,13 @@ jobs: attempt_delay: 2000 - name: Checkout submodules run: scripts/checkout_submodules.py --shallow --platform esp32 + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh @@ -99,6 +113,13 @@ jobs: attempt_delay: 2000 - name: Checkout submodules run: scripts/checkout_submodules.py --shallow --platform nrfconnect + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh diff --git a/.github/workflows/darwin-tests.yaml b/.github/workflows/darwin-tests.yaml index 0dcf3fbcec8732..0861d0bc54185a 100644 --- a/.github/workflows/darwin-tests.yaml +++ b/.github/workflows/darwin-tests.yaml @@ -64,6 +64,14 @@ jobs: sudo chown ${USER} /cores || true mkdir -p ~/Library/Logs/DiagnosticReports || true mkdir objdir-clone || true + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 run: scripts/build/gn_bootstrap.sh @@ -75,6 +83,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Delete Defaults run: defaults delete com.apple.dt.xctest.tool continue-on-error: true diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml index a2496446e3d8c8..76f728d3a99bb1 100644 --- a/.github/workflows/darwin.yaml +++ b/.github/workflows/darwin.yaml @@ -44,6 +44,14 @@ jobs: run: scripts/checkout_submodules.py --shallow --platform darwin - name: Setup Environment run: brew install python@3.9 + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 run: scripts/build/gn_bootstrap.sh @@ -55,6 +63,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Block zap-cli from being used # xcodebuild is NOT expected to require zap-cli run: scripts/run_in_build_env.sh 'mv $PW_ENVIRONMENT_ROOT/cipd/packages/zap/zap-cli $PW_ENVIRONMENT_ROOT/cipd/packages/zap/zap-cli.moved' diff --git a/.github/workflows/docbuild.yaml b/.github/workflows/docbuild.yaml index 5e5db83f8f00dc..676b4f0fac2350 100644 --- a/.github/workflows/docbuild.yaml +++ b/.github/workflows/docbuild.yaml @@ -27,14 +27,11 @@ jobs: path: matter fetch-depth: 0 - name: Install Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.8 - - name: cache-pip - uses: actions/cache@v1 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-doc-pip + cache-dependency-path: matter/docs/requirements.txt + cache: pip - name: Install base dependencies working-directory: matter run: | diff --git a/.github/workflows/examples-ameba.yaml b/.github/workflows/examples-ameba.yaml index 23c52d94fe0bf6..093bf386b627e7 100644 --- a/.github/workflows/examples-ameba.yaml +++ b/.github/workflows/examples-ameba.yaml @@ -49,6 +49,15 @@ jobs: attempt_delay: 2000 - name: Checkout submodules run: scripts/checkout_submodules.py --shallow --platform ameba + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni + - name: Bootstrap + run: scripts/build/gn_bootstrap.sh - name: Build example Ameba All Clusters App run: | ./scripts/run_in_build_env.sh \ diff --git a/.github/workflows/examples-bouffalolab.yaml b/.github/workflows/examples-bouffalolab.yaml index f18f9b933b310e..d1d6d618bd9dba 100644 --- a/.github/workflows/examples-bouffalolab.yaml +++ b/.github/workflows/examples-bouffalolab.yaml @@ -55,7 +55,14 @@ jobs: env: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" - + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 run: scripts/build/gn_bootstrap.sh @@ -67,6 +74,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build example BL602 Lighting App timeout-minutes: 30 run: | diff --git a/.github/workflows/examples-cc13x2x7_26x2x7.yaml b/.github/workflows/examples-cc13x2x7_26x2x7.yaml index c95d076834e0c9..3c73dadc17dd1c 100644 --- a/.github/workflows/examples-cc13x2x7_26x2x7.yaml +++ b/.github/workflows/examples-cc13x2x7_26x2x7.yaml @@ -56,6 +56,14 @@ jobs: env: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 run: scripts/build/gn_bootstrap.sh @@ -67,6 +75,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build examples timeout-minutes: 100 run: | diff --git a/.github/workflows/examples-cc32xx.yaml b/.github/workflows/examples-cc32xx.yaml index eb82b9c340d48f..ffd01cc97713f1 100644 --- a/.github/workflows/examples-cc32xx.yaml +++ b/.github/workflows/examples-cc32xx.yaml @@ -53,6 +53,14 @@ jobs: env: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 run: scripts/build/gn_bootstrap.sh @@ -64,6 +72,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build examples timeout-minutes: 60 run: | @@ -79,7 +88,7 @@ jobs: cc32xx CC3235SF_LAUNCHXL lock \ out/artifacts/cc32xx-lock/chip-CC3235SF_LAUNCHXL-lock-example.out \ /tmp/bloat_reports/ - + - name: Uploading Size Reports uses: actions/upload-artifact@v2 if: ${{ !env.ACT }} diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 17c089ef099dfa..e9dc5647bc6241 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -62,6 +62,13 @@ jobs: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 run: scripts/build/gn_bootstrap.sh diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index d28ba2d1c4657e..a265b7daa543e3 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -56,6 +56,13 @@ jobs: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh @@ -67,6 +74,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build some M5Stack variations timeout-minutes: 60 run: | @@ -164,10 +172,16 @@ jobs: - name: Checkout submodules run: scripts/checkout_submodules.py --shallow --platform esp32 + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh - - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} diff --git a/.github/workflows/examples-infineon.yaml b/.github/workflows/examples-infineon.yaml index 503312465b9d56..cab3b162beec71 100644 --- a/.github/workflows/examples-infineon.yaml +++ b/.github/workflows/examples-infineon.yaml @@ -56,6 +56,13 @@ jobs: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 run: scripts/build/gn_bootstrap.sh @@ -67,6 +74,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build PSoC6 lock-app example timeout-minutes: 15 run: | diff --git a/.github/workflows/examples-k32w.yaml b/.github/workflows/examples-k32w.yaml index 222b01cee31880..8781b1a874d55d 100644 --- a/.github/workflows/examples-k32w.yaml +++ b/.github/workflows/examples-k32w.yaml @@ -58,6 +58,13 @@ jobs: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 run: scripts/build/gn_bootstrap.sh @@ -69,6 +76,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build examples timeout-minutes: 50 run: | diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml index 0d3c6af18258e7..eb85b7d57cdfa2 100644 --- a/.github/workflows/examples-linux-arm.yaml +++ b/.github/workflows/examples-linux-arm.yaml @@ -56,6 +56,13 @@ jobs: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh diff --git a/.github/workflows/examples-linux-imx.yaml b/.github/workflows/examples-linux-imx.yaml index 5fb3d8a17a35ff..9936e100a584d0 100644 --- a/.github/workflows/examples-linux-imx.yaml +++ b/.github/workflows/examples-linux-imx.yaml @@ -48,6 +48,13 @@ jobs: - name: Checkout submodules run: scripts/checkout_submodules.py --shallow --platform linux + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap run: scripts/build/gn_bootstrap.sh diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml index 9cb447501b9c18..543c1c804953ee 100644 --- a/.github/workflows/examples-linux-standalone.yaml +++ b/.github/workflows/examples-linux-standalone.yaml @@ -56,6 +56,13 @@ jobs: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh diff --git a/.github/workflows/examples-mbed.yaml b/.github/workflows/examples-mbed.yaml index 6f24da71558367..f4b311ddf844bf 100644 --- a/.github/workflows/examples-mbed.yaml +++ b/.github/workflows/examples-mbed.yaml @@ -72,10 +72,16 @@ jobs: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh - - name: Uploading bootstrap logs uses: actions/upload-artifact@v3 if: ${{ always() && !env.ACT }} diff --git a/.github/workflows/examples-mw320.yaml b/.github/workflows/examples-mw320.yaml index 69f6e23ae06b85..2a1416a0d34f79 100755 --- a/.github/workflows/examples-mw320.yaml +++ b/.github/workflows/examples-mw320.yaml @@ -58,6 +58,13 @@ jobs: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 run: scripts/build/gn_bootstrap.sh @@ -69,6 +76,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build MW320 all clusters example app timeout-minutes: 20 run: | diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index 1d84e4629db0b8..2b34283f698e14 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -72,6 +72,14 @@ jobs: env: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 run: scripts/build/gn_bootstrap.sh @@ -83,6 +91,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Check nRF Connect SDK revision. timeout-minutes: 15 run: scripts/run_in_build_env.sh "python3 scripts/setup/nrfconnect/update_ncs.py --check" diff --git a/.github/workflows/examples-openiotsdk.yaml b/.github/workflows/examples-openiotsdk.yaml index 975ebce2e9510b..646cb280983dd0 100644 --- a/.github/workflows/examples-openiotsdk.yaml +++ b/.github/workflows/examples-openiotsdk.yaml @@ -58,6 +58,13 @@ jobs: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh @@ -108,7 +115,7 @@ jobs: scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME up scripts/run_in_ns.sh ${TEST_NETWORK_NAME}ns scripts/examples/openiotsdk_example.sh -C test -n ${TEST_NETWORK_NAME}tap lock-app scripts/setup/openiotsdk/network_setup.sh -n $TEST_NETWORK_NAME down - + - name: Run unit tests # Temporarily disable test due to performance issue with FVP if: false #steps.build_unit_tests.outcome == 'success' && github.event_name == 'pull_request' diff --git a/.github/workflows/examples-qpg.yaml b/.github/workflows/examples-qpg.yaml index 67f4db03565fbc..e4c5d536f81884 100644 --- a/.github/workflows/examples-qpg.yaml +++ b/.github/workflows/examples-qpg.yaml @@ -58,6 +58,13 @@ jobs: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 run: scripts/build/gn_bootstrap.sh @@ -69,6 +76,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build QPG6105 example apps timeout-minutes: 20 run: | diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index 4e025b0917f900..e8a8723b6759f6 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -57,6 +57,17 @@ jobs: GH_CONTEXT: ${{ toJson(github) }} run: scripts/tools/memory/gh_sizes_environment.py "${GH_CONTEXT}" + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni + - name: Bootstrap + timeout-minutes: 25 + run: scripts/build/gn_bootstrap.sh + - name: Build example Telink All Clusters App run: | ./scripts/run_in_build_env.sh \ diff --git a/.github/workflows/examples-tizen.yaml b/.github/workflows/examples-tizen.yaml index a4ed8444b01c90..886670662d397f 100644 --- a/.github/workflows/examples-tizen.yaml +++ b/.github/workflows/examples-tizen.yaml @@ -51,6 +51,13 @@ jobs: - name: Checkout submodules run: scripts/checkout_submodules.py --shallow --platform tizen + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap run: scripts/build/gn_bootstrap.sh diff --git a/.github/workflows/full-android.yaml b/.github/workflows/full-android.yaml index d8a5a13396c386..8177aefd0018b7 100644 --- a/.github/workflows/full-android.yaml +++ b/.github/workflows/full-android.yaml @@ -62,6 +62,14 @@ jobs: name: Checkout (ACT for local build) - name: Checkout submodules run: scripts/checkout_submodules.py --shallow --platform android + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh @@ -73,6 +81,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build Android arm-chip-tool run: | ./scripts/run_in_build_env.sh \ diff --git a/.github/workflows/fuzzing-build.yaml b/.github/workflows/fuzzing-build.yaml index eb3d222d4c7ee9..bcf3fa24a8151b 100644 --- a/.github/workflows/fuzzing-build.yaml +++ b/.github/workflows/fuzzing-build.yaml @@ -53,6 +53,14 @@ jobs: - name: Try to ensure the objdir-clone dir exists run: | mkdir objdir-clone || true + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh @@ -64,6 +72,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build all-clusters-app timeout-minutes: 20 run: | @@ -103,6 +112,14 @@ jobs: - name: Try to ensure the objdir-clone dir exists run: | mkdir objdir-clone || true + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 run: scripts/build/gn_bootstrap.sh @@ -114,6 +131,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build all-clusters-app timeout-minutes: 20 run: | diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2acff6d98983ab..83ee679efd2afb 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -54,6 +54,13 @@ jobs: # to run - name: Checkout submodules run: scripts/checkout_submodules.py --shallow --platform linux + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh @@ -128,7 +135,7 @@ jobs: if: always() run: | git grep -n "PRI.8" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)third_party/lwip/repo/lwip/src/include/lwip/arch.h' && exit 1 || exit 0 - + # git grep exits with 0 if it finds a match, but we want # to fail (exit nonzero) on match. And we want to exclude this file, # to avoid our grep regexp matching itself. @@ -136,7 +143,7 @@ jobs: if: always() run: | git grep -n "PRI.16" -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)third_party/lwip/repo/lwip/src/include/lwip/arch.h' && exit 1 || exit 0 - + # git grep exits with 0 if it finds a match, but we want # to fail (exit nonzero) on match. And we want to exclude this file, # to avoid our grep regexp matching itself. diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index 293ee31f955c64..f9e5be4bba2e63 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -52,6 +52,14 @@ jobs: attempt_delay: 2000 - name: Checkout submodules run: scripts/checkout_submodules.py --shallow --platform esp32 + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 run: scripts/build/gn_bootstrap.sh @@ -63,6 +71,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build ESP32 QEMU test images timeout-minutes: 20 run: | diff --git a/.github/workflows/release_artifacts.yaml b/.github/workflows/release_artifacts.yaml index 1b773d8c28d52c..6fd08c4a763a66 100644 --- a/.github/workflows/release_artifacts.yaml +++ b/.github/workflows/release_artifacts.yaml @@ -42,6 +42,14 @@ jobs: attempt_limit: 3 attempt_delay: 2000 ref: "${{ github.event.inputs.releaseTag }}" + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 run: scripts/build/gn_bootstrap.sh @@ -53,6 +61,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build run: scripts/examples/esp_example.sh all-clusters-app @@ -87,6 +96,14 @@ jobs: attempt_limit: 3 attempt_delay: 2000 ref: "${{ github.event.inputs.releaseTag }}" + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 run: scripts/build/gn_bootstrap.sh @@ -98,6 +115,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build example EFR32 Lock App run: scripts/examples/gn_efr32_example.sh examples/lock-app/efr32/ out/lock_app_debug $SILABS_BOARD diff --git a/.github/workflows/smoketest-android.yaml b/.github/workflows/smoketest-android.yaml index 1007d93e99f7ea..bdc5255bf0f651 100644 --- a/.github/workflows/smoketest-android.yaml +++ b/.github/workflows/smoketest-android.yaml @@ -52,6 +52,14 @@ jobs: attempt_delay: 2000 - name: Checkout submodules run: scripts/checkout_submodules.py --shallow --platform android + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh @@ -63,6 +71,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build Android CHIPTool and CHIPTest (ARM64) run: | ./scripts/run_in_build_env.sh \ diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 08176a52890f4f..4b2205f33e1e5a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -78,6 +78,14 @@ jobs: mkdir /tmp/cores || true sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true mkdir objdir-clone || true + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh @@ -89,6 +97,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Validate that xml are parsable timeout-minutes: 10 # The sub-items being run here are the same as the input XMLs listed @@ -313,6 +322,14 @@ jobs: sudo chown ${USER} /cores || true mkdir -p ~/Library/Logs/DiagnosticReports || true mkdir objdir-clone || true + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 run: scripts/build/gn_bootstrap.sh @@ -324,6 +341,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build Apps timeout-minutes: 90 run: | @@ -405,6 +423,14 @@ jobs: mkdir /tmp/cores || true sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true mkdir objdir-clone || true + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh @@ -416,6 +442,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build Python REPL and example apps timeout-minutes: 50 run: | @@ -481,6 +508,14 @@ jobs: mkdir /tmp/cores || true sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true mkdir objdir-clone || true + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh @@ -492,6 +527,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build Java Matter Controller and all clusters app timeout-minutes: 50 run: | @@ -537,7 +573,7 @@ jobs: --tool-cluster "pairing" \ --tool-args "already-discovered --nodeid 1 --setup-pin-code 20202021 --address ::1 --port 5540 -t 1000" \ --factoryreset \ - ' + ' - name: Uploading core files uses: actions/upload-artifact@v3 if: ${{ failure() && !env.ACT }} @@ -584,6 +620,14 @@ jobs: sudo chown ${USER} /cores || true mkdir -p ~/Library/Logs/DiagnosticReports || true mkdir objdir-clone || true + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 25 run: scripts/build/gn_bootstrap.sh @@ -595,6 +639,7 @@ jobs: path: | .environment/gn_out/.ninja_log .environment/pigweed-venv/*.log + - name: Build Python REPL and example apps timeout-minutes: 50 run: | diff --git a/.github/workflows/zap_regeneration.yaml b/.github/workflows/zap_regeneration.yaml index 35a48203405047..df550b33b57464 100644 --- a/.github/workflows/zap_regeneration.yaml +++ b/.github/workflows/zap_regeneration.yaml @@ -46,9 +46,18 @@ jobs: attempt_delay: 2000 - name: Checkout submodules run: scripts/checkout_submodules.py --shallow --platform linux + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh + - name: Generate all timeout-minutes: 5 run: ./scripts/run_in_build_env.sh scripts/tools/zap_regen_all.py diff --git a/.github/workflows/zap_templates.yaml b/.github/workflows/zap_templates.yaml index 7a49bde308a9ad..2cba44480285cf 100644 --- a/.github/workflows/zap_templates.yaml +++ b/.github/workflows/zap_templates.yaml @@ -46,9 +46,18 @@ jobs: attempt_delay: 2000 - name: Checkout submodules run: scripts/checkout_submodules.py --shallow --platform linux + + - name: Bootstrap cache + uses: actions/cache@v3 + with: + key: ${{ runner.os }}-env-${{ hashFiles('scripts/setup/*', 'third_party/pigweed/**') }} + path: | + .environment + build_overrides/pigweed_environment.gni - name: Bootstrap timeout-minutes: 10 run: scripts/build/gn_bootstrap.sh + - name: Generate all run: ./scripts/run_in_build_env.sh scripts/tools/zap_regen_all.py - name: Ensure git works in current working directory diff --git a/.gn b/.gn index 9577b6db802e79..604bc15b848d69 100644 --- a/.gn +++ b/.gn @@ -26,8 +26,8 @@ script_executable = "python3" default_args = { pw_unit_test_AUTOMATIC_RUNNER = "$dir_pigweed/targets/host/run_test" - pw_build_PIP_CONSTRAINTS = [ "//scripts/constraints.txt" ] - pw_build_PIP_REQUIREMENTS = [ "//scripts/requirements.txt" ] + pw_build_PIP_CONSTRAINTS = [ "//scripts/setup/constraints.txt" ] + pw_build_PIP_REQUIREMENTS = [ "//scripts/setup/requirements.txt" ] # GN target to use for the default Python build venv. pw_build_PYTHON_BUILD_VENV = "//:matter_build_venv" diff --git a/config/ameba/args.gni b/config/ameba/args.gni index 7d3d91a602ccf4..51634a9d738da6 100755 --- a/config/ameba/args.gni +++ b/config/ameba/args.gni @@ -36,5 +36,5 @@ chip_config_network_layer_ble = true custom_toolchain = "//third_party/connectedhomeip/config/ameba/toolchain:ameba" pw_build_PIP_CONSTRAINTS = - [ "//third_party/connectedhomeip/scripts/constraints.txt" ] + [ "//third_party/connectedhomeip/scripts/setup/constraints.txt" ] cpp_standard = "c++17" diff --git a/config/esp32/.gn b/config/esp32/.gn index 4b3520ab15c9a6..37684f9211c628 100644 --- a/config/esp32/.gn +++ b/config/esp32/.gn @@ -25,9 +25,9 @@ default_args = { target_os = "freertos" pw_build_PIP_CONSTRAINTS = - [ "//third_party/connectedhomeip/scripts/constraints.txt" ] + [ "//third_party/connectedhomeip/scripts/setup/constraints.txt" ] pw_build_PIP_REQUIREMENTS = - [ "//third_party/connectedhomeip/scripts/requirements.txt" ] + [ "//third_party/connectedhomeip/scripts/setup/requirements.txt" ] import("//args.gni") } diff --git a/config/esp32/args.gni b/config/esp32/args.gni index 939c39e85b8e2d..c8de67ddc87506 100644 --- a/config/esp32/args.gni +++ b/config/esp32/args.gni @@ -37,4 +37,4 @@ custom_toolchain = "//third_party/connectedhomeip/config/esp32/toolchain:esp32" # Matter already fixes python constraints, we use those instead of # whatever pigweed ships with pw_build_PIP_CONSTRAINTS = - [ "//third_party/connectedhomeip/scripts/constraints.txt" ] + [ "//third_party/connectedhomeip/scripts/setup/constraints.txt" ] diff --git a/config/genio/args.gni b/config/genio/args.gni index 074ff1481f82ea..50d0a514c10616 100644 --- a/config/genio/args.gni +++ b/config/genio/args.gni @@ -30,4 +30,4 @@ chip_inet_config_enable_udp_endpoint = true custom_toolchain = "//third_party/connectedhomeip/config/genio/toolchain:genio" pw_build_PIP_CONSTRAINTS = - [ "//third_party/connectedhomeip/scripts/constraints.txt" ] + [ "//third_party/connectedhomeip/scripts/setup/constraints.txt" ] diff --git a/config/ios/args.gni b/config/ios/args.gni index 74d75746f0dc19..b4426a61a43647 100644 --- a/config/ios/args.gni +++ b/config/ios/args.gni @@ -19,4 +19,4 @@ chip_device_platform = "darwin" chip_project_config_include_dirs = [ "${chip_root}/config/ios" ] -pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/constraints.txt" ] +pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/setup/constraints.txt" ] diff --git a/config/mbed/chip-gn/args.gni b/config/mbed/chip-gn/args.gni index 7162adfa40a635..5fd323b58eefd9 100644 --- a/config/mbed/chip-gn/args.gni +++ b/config/mbed/chip-gn/args.gni @@ -28,4 +28,4 @@ chip_custom_build_cflags = [] custom_toolchain = "//toolchain:mbed" mbedtls_target = "//mbedtls:mbedtls" -pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/constraints.txt" ] +pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/setup/constraints.txt" ] diff --git a/config/nrfconnect/chip-gn/args.gni b/config/nrfconnect/chip-gn/args.gni index 0963be64b3b289..847a6cff28a2fe 100644 --- a/config/nrfconnect/chip-gn/args.gni +++ b/config/nrfconnect/chip-gn/args.gni @@ -29,4 +29,4 @@ chip_external_mbedtls = true custom_toolchain = "${chip_root}/config/nrfconnect/chip-gn/toolchain:zephyr" -pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/constraints.txt" ] +pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/setup/constraints.txt" ] diff --git a/config/openiotsdk/chip-gn/args.gni b/config/openiotsdk/chip-gn/args.gni index 87c43e7a343dc2..a468c14510aad9 100644 --- a/config/openiotsdk/chip-gn/args.gni +++ b/config/openiotsdk/chip-gn/args.gni @@ -35,4 +35,4 @@ chip_external_mbedtls = true custom_toolchain = "${chip_root}/config/openiotsdk/chip-gn/toolchain:openiotsdk" -pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/constraints.txt" ] +pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/setup/constraints.txt" ] diff --git a/config/qpg/chip-gn/args.gni b/config/qpg/chip-gn/args.gni index 346a1d2cb3254e..cccb41016a6bd2 100644 --- a/config/qpg/chip-gn/args.gni +++ b/config/qpg/chip-gn/args.gni @@ -48,4 +48,4 @@ chip_ble_project_config_include = "" custom_toolchain = "//config/qpg/chip-gn/toolchain:qpgtoolchain" -pw_build_PIP_CONSTRAINTS = [ "//scripts/constraints.txt" ] +pw_build_PIP_CONSTRAINTS = [ "//scripts/setup/constraints.txt" ] diff --git a/config/standalone/args.gni b/config/standalone/args.gni index 89e186b4edb8a4..8ce29968cdd4a8 100644 --- a/config/standalone/args.gni +++ b/config/standalone/args.gni @@ -18,5 +18,5 @@ import("//build_overrides/chip.gni") # options are used from examples/. chip_build_tests = false -pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/constraints.txt" ] -pw_build_PIP_REQUIREMENTS = [ "${chip_root}/scripts/requirements.txt" ] +pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/setup/constraints.txt" ] +pw_build_PIP_REQUIREMENTS = [ "${chip_root}/scripts/setup/requirements.txt" ] diff --git a/config/telink/chip-gn/args.gni b/config/telink/chip-gn/args.gni index a84cc321a4bb88..504db8fdd73246 100644 --- a/config/telink/chip-gn/args.gni +++ b/config/telink/chip-gn/args.gni @@ -29,4 +29,4 @@ chip_external_mbedtls = true custom_toolchain = "${chip_root}/config/telink/chip-gn/toolchain:zephyr" -pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/constraints.txt" ] +pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/setup/constraints.txt" ] diff --git a/config/tizen/chip-gn/args.gni b/config/tizen/chip-gn/args.gni index 7cd1033eecc268..d63b149a2387ea 100644 --- a/config/tizen/chip-gn/args.gni +++ b/config/tizen/chip-gn/args.gni @@ -20,4 +20,4 @@ chip_build_tests = false chip_inet_config_enable_raw_endpoint = false -pw_build_PIP_CONSTRAINTS = [ "//scripts/constraints.txt" ] +pw_build_PIP_CONSTRAINTS = [ "//scripts/setup/constraints.txt" ] diff --git a/config/zephyr/chip-gn/args.gni b/config/zephyr/chip-gn/args.gni index 1421e79aa80edd..f49cfb708e104e 100644 --- a/config/zephyr/chip-gn/args.gni +++ b/config/zephyr/chip-gn/args.gni @@ -29,4 +29,4 @@ chip_external_mbedtls = true custom_toolchain = "${chip_root}/config/zephyr/chip-gn/toolchain:zephyr" -pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/constraints.txt" ] +pw_build_PIP_CONSTRAINTS = [ "${chip_root}/scripts/setup/constraints.txt" ] diff --git a/docs/code_generation.md b/docs/code_generation.md index 0465d8795e116c..f9b0d587f3fd9b 100644 --- a/docs/code_generation.md +++ b/docs/code_generation.md @@ -22,7 +22,7 @@ The selection of enabled clusters and files is done using [ZAP](https://github.com/project-chip/zap). You can download a recent release of zap from its [releases page](https://github.com/project-chip/zap/releases). It is recommended to download a release that is in sync with the currently in use -version by the SDK (see `scripts/zap.json` and +version by the SDK (see `scripts/setup/zap.json` and `scripts/tools/zap/zap_execution.py` for the minimum supported version). Beyond basic zap file selection, there are also `.json` zap settings that define @@ -37,8 +37,8 @@ There are only two such files currently in use: ### Installing zap and environment variables ZAP is generally installed as a third-party tool via CIPD during the build -environment bootstrap (see `scripts/zap.json`), which makes `zap-cli` available -in `$PATH` when running in a build environment. +environment bootstrap (see `scripts/setup/zap.json`), which makes `zap-cli` +available in `$PATH` when running in a build environment. **NOTE**: zap packages are currently NOT available for `arm64` (like when compiling on Raspberry PI.). In these cases one should check out zap from source diff --git a/docs/guides/nrfconnect_factory_data_configuration.md b/docs/guides/nrfconnect_factory_data_configuration.md index c0152276f00737..ef3c14b6801a20 100644 --- a/docs/guides/nrfconnect_factory_data_configuration.md +++ b/docs/guides/nrfconnect_factory_data_configuration.md @@ -482,7 +482,7 @@ as an additional argument. To do this, complete the following steps: - Install the `jsonschema` module together with all dependencies for Matter: ``` - $ python -m pip install -r ./scripts/requirements.nrfconnect.txt + $ python -m pip install -r ./scripts/setup/requirements.nrfconnect.txt ``` 2. Run the following command (remember to replace the __ diff --git a/examples/common/pigweed/rpc_console/.gn b/examples/common/pigweed/rpc_console/.gn index 066dd0cb8c49b6..963ca108a40545 100644 --- a/examples/common/pigweed/rpc_console/.gn +++ b/examples/common/pigweed/rpc_console/.gn @@ -21,9 +21,9 @@ default_args = { chip_enable_pw_rpc = true pw_build_PIP_CONSTRAINTS = - [ "//third_party/connectedhomeip/scripts/constraints.txt" ] + [ "//third_party/connectedhomeip/scripts/setup/constraints.txt" ] pw_build_PIP_REQUIREMENTS = - [ "//third_party/connectedhomeip/scripts/requirements.txt" ] + [ "//third_party/connectedhomeip/scripts/setup/requirements.txt" ] pw_build_USE_NEW_PYTHON_BUILD = true } diff --git a/scripts/activate.sh b/scripts/activate.sh index eba538975a899f..4092e5539d682e 120000 --- a/scripts/activate.sh +++ b/scripts/activate.sh @@ -1 +1 @@ -bootstrap.sh \ No newline at end of file +setup/bootstrap.sh \ No newline at end of file diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh deleted file mode 100644 index 67cad2a82d2b58..00000000000000 --- a/scripts/bootstrap.sh +++ /dev/null @@ -1,108 +0,0 @@ -# -# Copyright (c) 2020 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -_bootstrap_or_activate() { - if [ -n "$BASH" ]; then - local _BOOTSTRAP_PATH="${BASH_SOURCE[0]}" - else - local _BOOTSTRAP_PATH="$1" - fi - - local _BOOTSTRAP_NAME="${_BOOTSTRAP_PATH##*/}" - local _CHIP_ROOT="$(cd "${_BOOTSTRAP_PATH%/*}/.." && pwd)" - - local _CONFIG_FILE="scripts/environment.json" - - if [ ! -z "$PW_CONFIG_FILE" ]; then - _CONFIG_FILE="$PW_CONFIG_FILE" - fi - - if [ ! -f "$_CHIP_ROOT/third_party/pigweed/repo/pw_env_setup/util.sh" ]; then - # Make sure our submodule remotes are correct for this revision. - git submodule sync --recursive - git submodule update --init - elif [ "$_BOOTSTRAP_NAME" = "bootstrap.sh" ]; then - # In this case, only update already checked out submodules. - git submodule sync --recursive - git submodule update - fi - - PW_BRANDING_BANNER="$_CHIP_ROOT/scripts/matter_banner.txt" - export PW_BRANDING_BANNER - - PW_PROJECT_ROOT="$_CHIP_ROOT" - export PW_PROJECT_ROOT - - PW_ROOT="$_CHIP_ROOT/third_party/pigweed/repo" - export PW_ROOT - - . "$_CHIP_ROOT/third_party/pigweed/repo/pw_env_setup/util.sh" - - _chip_bootstrap_banner() { - if [ -z "$PW_ENVSETUP_QUIET" ] && [ -z "$PW_ENVSETUP_NO_BANNER" ]; then - cat "$PW_BRANDING_BANNER" - echo - fi - } - - local _PW_BANNER_FUNC="_chip_bootstrap_banner" - - # Force the Pigweed environment directory to be '.environment' - if [ -z "$PW_ENVIRONMENT_ROOT" ]; then - export PW_ENVIRONMENT_ROOT="$PW_PROJECT_ROOT/.environment" - fi - - export _PW_ACTUAL_ENVIRONMENT_ROOT="$(pw_get_env_root)" - local _SETUP_SH="$_PW_ACTUAL_ENVIRONMENT_ROOT/activate.sh" - - export PW_DOCTOR_SKIP_CIPD_CHECKS=1 - export PATH # https://bugs.chromium.org/p/pigweed/issues/detail?id=281 - - if test -n "$GITHUB_ACTION"; then - mkdir -p "$_PW_ACTUAL_ENVIRONMENT_ROOT" - tee <"${_PW_ACTUAL_ENVIRONMENT_ROOT}/pip.conf" -[global] -cache-dir = ${_PW_ACTUAL_ENVIRONMENT_ROOT}/pip-cache -EOF - export PIP_CONFIG_FILE="$_PW_ACTUAL_ENVIRONMENT_ROOT/pip.conf" - fi - - if [ "$_BOOTSTRAP_NAME" = "bootstrap.sh" ] || - [ ! -f "$_SETUP_SH" ] || - [ ! -s "$_SETUP_SH" ]; then - pw_bootstrap --shell-file "$_SETUP_SH" \ - --install-dir "$_PW_ACTUAL_ENVIRONMENT_ROOT" \ - --config-file "$_CHIP_ROOT/$_CONFIG_FILE" \ - --virtualenv-gn-out-dir "$_PW_ACTUAL_ENVIRONMENT_ROOT/gn_out" - pw_finalize bootstrap "$_SETUP_SH" - else - pw_activate - pw_finalize activate "$_SETUP_SH" - fi -} - -_bootstrap_or_activate "$0" -unset -f _bootstrap_or_activate - -pw_cleanup - -unset PW_CIPD_INSTALL_DIR -unset CIPD_CACHE_DIR -unset _PW_BANNER_FUNC -unset _PW_TEXT -unset PW_DOCTOR_SKIP_CIPD_CHECKS - -unset -f _chip_bootstrap_banner diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh new file mode 120000 index 00000000000000..4092e5539d682e --- /dev/null +++ b/scripts/bootstrap.sh @@ -0,0 +1 @@ +setup/bootstrap.sh \ No newline at end of file diff --git a/scripts/matter_banner.txt b/scripts/setup/banner.txt similarity index 100% rename from scripts/matter_banner.txt rename to scripts/setup/banner.txt diff --git a/scripts/setup/bootstrap.sh b/scripts/setup/bootstrap.sh new file mode 100644 index 00000000000000..18ae67e41a0601 --- /dev/null +++ b/scripts/setup/bootstrap.sh @@ -0,0 +1,110 @@ +# +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +_bootstrap_or_activate() { + if [ -n "$BASH" ]; then + local _BOOTSTRAP_PATH="${BASH_SOURCE[0]}" + else + local _BOOTSTRAP_PATH="$1" + fi + + local _BOOTSTRAP_NAME="${_BOOTSTRAP_PATH##*/}" + local _BOOTSTRAP_DIR="${_BOOTSTRAP_PATH%/*}" + # Strip off the 'scripts[/setup]' directory, leaving the root of the repo. + local _CHIP_ROOT="$(cd "${_BOOTSTRAP_DIR%/setup}/.." && pwd)" + + local _CONFIG_FILE="scripts/setup/environment.json" + + if [ -n "$PW_CONFIG_FILE" ]; then + _CONFIG_FILE="$PW_CONFIG_FILE" + fi + + if [ ! -f "$_CHIP_ROOT/third_party/pigweed/repo/pw_env_setup/util.sh" ]; then + # Make sure our submodule remotes are correct for this revision. + git submodule sync --recursive + git submodule update --init + elif [ "$_BOOTSTRAP_NAME" = "bootstrap.sh" ]; then + # In this case, only update already checked out submodules. + git submodule sync --recursive + git submodule update + fi + + PW_BRANDING_BANNER="$_CHIP_ROOT/scripts/setup/banner.txt" + export PW_BRANDING_BANNER + + PW_PROJECT_ROOT="$_CHIP_ROOT" + export PW_PROJECT_ROOT + + PW_ROOT="$_CHIP_ROOT/third_party/pigweed/repo" + export PW_ROOT + + . "$_CHIP_ROOT/third_party/pigweed/repo/pw_env_setup/util.sh" + + _chip_bootstrap_banner() { + if [ -z "$PW_ENVSETUP_QUIET" ] && [ -z "$PW_ENVSETUP_NO_BANNER" ]; then + cat "$PW_BRANDING_BANNER" + echo + fi + } + + local _PW_BANNER_FUNC="_chip_bootstrap_banner" + + # Force the Pigweed environment directory to be '.environment' + if [ -z "$PW_ENVIRONMENT_ROOT" ]; then + export PW_ENVIRONMENT_ROOT="$PW_PROJECT_ROOT/.environment" + fi + + export _PW_ACTUAL_ENVIRONMENT_ROOT="$(pw_get_env_root)" + local _SETUP_SH="$_PW_ACTUAL_ENVIRONMENT_ROOT/activate.sh" + + export PW_DOCTOR_SKIP_CIPD_CHECKS=1 + export PATH # https://bugs.chromium.org/p/pigweed/issues/detail?id=281 + + if test -n "$GITHUB_ACTION"; then + mkdir -p "$_PW_ACTUAL_ENVIRONMENT_ROOT" + tee <"${_PW_ACTUAL_ENVIRONMENT_ROOT}/pip.conf" +[global] +cache-dir = ${_PW_ACTUAL_ENVIRONMENT_ROOT}/pip-cache +EOF + export PIP_CONFIG_FILE="$_PW_ACTUAL_ENVIRONMENT_ROOT/pip.conf" + fi + + if [ "$_BOOTSTRAP_NAME" = "bootstrap.sh" ] || + [ ! -f "$_SETUP_SH" ] || + [ ! -s "$_SETUP_SH" ]; then + pw_bootstrap --shell-file "$_SETUP_SH" \ + --install-dir "$_PW_ACTUAL_ENVIRONMENT_ROOT" \ + --config-file "$_CHIP_ROOT/$_CONFIG_FILE" \ + --virtualenv-gn-out-dir "$_PW_ACTUAL_ENVIRONMENT_ROOT/gn_out" + pw_finalize bootstrap "$_SETUP_SH" + else + pw_activate + pw_finalize activate "$_SETUP_SH" + fi +} + +_bootstrap_or_activate "$0" +unset -f _bootstrap_or_activate + +pw_cleanup + +unset PW_CIPD_INSTALL_DIR +unset CIPD_CACHE_DIR +unset _PW_BANNER_FUNC +unset _PW_TEXT +unset PW_DOCTOR_SKIP_CIPD_CHECKS + +unset -f _chip_bootstrap_banner diff --git a/scripts/constraints.esp32.txt b/scripts/setup/constraints.esp32.txt similarity index 100% rename from scripts/constraints.esp32.txt rename to scripts/setup/constraints.esp32.txt diff --git a/scripts/constraints.txt b/scripts/setup/constraints.txt similarity index 100% rename from scripts/constraints.txt rename to scripts/setup/constraints.txt diff --git a/scripts/environment.json b/scripts/setup/environment.json similarity index 72% rename from scripts/environment.json rename to scripts/setup/environment.json index d9dabb8c96affa..ebe77d9db6dbc8 100644 --- a/scripts/environment.json +++ b/scripts/setup/environment.json @@ -2,14 +2,14 @@ "cipd_package_files": [ "third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/cipd_setup/arm.json", "third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/cipd_setup/pigweed.json", - "scripts/python.json", - "scripts/zap.json" + "scripts/setup/python.json", + "scripts/setup/zap.json" ], "virtualenv": { "gn_root": ".", "gn_targets": [":python_packages.install"], - "requirements": ["scripts/requirements.txt"], - "constraints": ["scripts/constraints.txt"], + "requirements": ["scripts/setup/requirements.txt"], + "constraints": ["scripts/setup/constraints.txt"], "gn_args": ["chip_crypto=\"boringssl\""] }, "required_submodules": ["third_party/pigweed/repo"], diff --git a/scripts/environment_no_cipd.json b/scripts/setup/environment_no_cipd.json similarity index 71% rename from scripts/environment_no_cipd.json rename to scripts/setup/environment_no_cipd.json index 1e0144898e16b8..b2a9075fc56fed 100644 --- a/scripts/environment_no_cipd.json +++ b/scripts/setup/environment_no_cipd.json @@ -2,8 +2,8 @@ "virtualenv": { "gn_root": ".", "gn_targets": [":python_packages.install"], - "requirements": ["scripts/requirements.txt"], - "constraints": ["scripts/constraints.txt"], + "requirements": ["scripts/setup/requirements.txt"], + "constraints": ["scripts/setup/constraints.txt"], "gn_args": ["chip_crypto=\"boringssl\""] }, "required_submodules": ["third_party/pigweed/repo"], diff --git a/scripts/python.json b/scripts/setup/python.json similarity index 100% rename from scripts/python.json rename to scripts/setup/python.json diff --git a/scripts/requirements.bouffalolab.txt b/scripts/setup/requirements.bouffalolab.txt similarity index 100% rename from scripts/requirements.bouffalolab.txt rename to scripts/setup/requirements.bouffalolab.txt diff --git a/scripts/requirements.esp32.txt b/scripts/setup/requirements.esp32.txt similarity index 100% rename from scripts/requirements.esp32.txt rename to scripts/setup/requirements.esp32.txt diff --git a/scripts/requirements.infineon.txt b/scripts/setup/requirements.infineon.txt similarity index 100% rename from scripts/requirements.infineon.txt rename to scripts/setup/requirements.infineon.txt diff --git a/scripts/requirements.mbed.txt b/scripts/setup/requirements.mbed.txt similarity index 100% rename from scripts/requirements.mbed.txt rename to scripts/setup/requirements.mbed.txt diff --git a/scripts/requirements.nrfconnect.txt b/scripts/setup/requirements.nrfconnect.txt similarity index 100% rename from scripts/requirements.nrfconnect.txt rename to scripts/setup/requirements.nrfconnect.txt diff --git a/scripts/requirements.openiotsdk.txt b/scripts/setup/requirements.openiotsdk.txt similarity index 100% rename from scripts/requirements.openiotsdk.txt rename to scripts/setup/requirements.openiotsdk.txt diff --git a/scripts/requirements.telink.txt b/scripts/setup/requirements.telink.txt similarity index 100% rename from scripts/requirements.telink.txt rename to scripts/setup/requirements.telink.txt diff --git a/scripts/requirements.ti.txt b/scripts/setup/requirements.ti.txt similarity index 100% rename from scripts/requirements.ti.txt rename to scripts/setup/requirements.ti.txt diff --git a/scripts/requirements.txt b/scripts/setup/requirements.txt similarity index 100% rename from scripts/requirements.txt rename to scripts/setup/requirements.txt diff --git a/scripts/zap.json b/scripts/setup/zap.json similarity index 100% rename from scripts/zap.json rename to scripts/setup/zap.json diff --git a/scripts/tools/zap/version_update.py b/scripts/tools/zap/version_update.py index 22a964c9c0b471..394e2048b17646 100755 --- a/scripts/tools/zap/version_update.py +++ b/scripts/tools/zap/version_update.py @@ -50,7 +50,7 @@ # files is not likely to change often USAGE_FILES_DEPENDING_ON_ZAP_VERSION = [ 'integrations/docker/images/chip-cert-bins/Dockerfile', - 'scripts/zap.json', + 'scripts/setup/zap.json', ] diff --git a/src/test_driver/efr32/.gn b/src/test_driver/efr32/.gn index 15c1de83e74c26..f7a835ede9461e 100644 --- a/src/test_driver/efr32/.gn +++ b/src/test_driver/efr32/.gn @@ -25,9 +25,9 @@ default_args = { target_os = "freertos" pw_build_PIP_CONSTRAINTS = - [ "//third_party/connectedhomeip/scripts/constraints.txt" ] + [ "//third_party/connectedhomeip/scripts/setup/constraints.txt" ] pw_build_PIP_REQUIREMENTS = - [ "//third_party/connectedhomeip/scripts/requirements.txt" ] + [ "//third_party/connectedhomeip/scripts/setup/requirements.txt" ] import("//args.gni") }