Skip to content

Commit

Permalink
Merge branch 'master' into diagnostic_logs_implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
nivi-apple authored Oct 31, 2023
2 parents 86e01c7 + a9769a8 commit 38930dc
Show file tree
Hide file tree
Showing 1,123 changed files with 183,204 additions and 89,121 deletions.
13 changes: 6 additions & 7 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,13 @@ RUN curl https://raw.githubusercontent.com/restyled-io/restyler/master/bin/resty
RUN mkdir -p /opt/sdk/sdks/ \
&& chown -R $USERNAME:$USERNAME \
/opt/sdk/sdks/ `# NXP uses a patch_sdk script to change SDK files` \
/opt/espressif/esp-idf `# $USERNAME needs to own the esp-idf and tools for the examples to build` \
/opt/espressif/tools \
/opt/NordicSemiconductor/nrfconnect/ `# $USERNAME needs to own west configuration to build nRF Connect examples` \
/opt/ubuntu-21.04-aarch64-sysroot/usr/ `# allow read/write access to header and libraries` \
/opt/android/sdk `# allow licenses to be accepted` \
/opt/ameba/ambd_sdk_with_chip_non_NDA/ `# AmebaD requires access to change build_info.h` \
/opt/fsl-imx-xwayland/5.15-kirkstone/ \
/opt/openocd \
$IDF_PATH `# $USERNAME needs to own the esp-idf and tools for the examples to build` \
$IDF_TOOLS_PATH \
$SYSROOT_AARCH64 `# allow read/write access to header and libraries` \
$ANDROID_HOME `# allow licenses to be accepted` \
$AMEBA_PATH `# AmebaD requires access to change build_info.h` \
$IMX_SDK_ROOT \
&& :

# Fix Tizen SDK paths for new user
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"mounts": [
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"
],
"initializeCommand": ".devcontainer/build.sh --tag matter-dev-environment:local --version 20",
"initializeCommand": ".devcontainer/build.sh --tag matter-dev-environment:local --version 22",
"image": "matter-dev-environment:local",
"remoteUser": "vscode",
"customizations": {
Expand Down
11 changes: 2 additions & 9 deletions .github/actions/checkout-submodules-and-bootstrap/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,10 @@ runs:
uses: ./.github/actions/bootstrap-cache
- name: Bootstrap
uses: ./.github/actions/bootstrap
env:
PW_NO_CIPD_CACHE_DIR: Y
with:
platform: ${{ inputs.platform }}
- name: Remove CIPD cache directory
# If there is a bootstrap-cache miss, and bootstrap installs CIPD itself,
# there is roughly 1.4GB that remains in this cache that is useless from
# this point onwards.
shell: bash
continue-on-error: true
run: |
du -sh $HOME/.cipd-cache-dir/
rm -rf $HOME/.cipd-cache-dir/ || echo "Removing cipd cache dir failed"
- name: Dump disk info after checkout submodule & Bootstrap
shell: bash
run: scripts/dump_diskspace_info.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bloat_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest

container:
image: ghcr.io/project-chip/chip-build:21
image: ghcr.io/project-chip/chip-build:22

steps:
- name: Checkout
Expand Down
51 changes: 44 additions & 7 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build:21
image: ghcr.io/project-chip/chip-build:22
volumes:
- "/tmp/log_output:/tmp/test_logs"
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
Expand Down Expand Up @@ -85,18 +85,22 @@ jobs:
# - name: Upload Code Coverage
# if: ${{ contains('main', env.BUILD_TYPE) }}
# run: bash <(curl -s https://codecov.io/bash)
- name: Setup Build Without Detail Logging
- name: Set up Build Without Detail Logging
run: scripts/build/gn_gen.sh --args="chip_detail_logging=false"
- name: Run Build Without Detail Logging
run: scripts/run_in_build_env.sh "ninja -C ./out"
- name: Setup Build Without Progress Logging
- name: Set up Build Without Progress Logging
run: scripts/build/gn_gen.sh --args="chip_detail_logging=false chip_progress_logging=false"
- name: Run Build Without Progress Logging
run: scripts/run_in_build_env.sh "ninja -C ./out"
- name: Setup Build Without Error Logging
- name: Set up Build Without Error Logging
run: scripts/build/gn_gen.sh --args="chip_detail_logging=false chip_progress_logging=false chip_error_logging=false"
- name: Run Build Without Error Logging
run: scripts/run_in_build_env.sh "ninja -C ./out"
- name: Set up Build Without Logging
run: scripts/build/gn_gen.sh --args="chip_logging=false"
- name: Run Build Without Logging
run: scripts/run_in_build_env.sh "ninja -C ./out"
- name: Uploading core files
uses: actions/upload-artifact@v3
if: ${{ failure() && !env.ACT }}
Expand Down Expand Up @@ -131,7 +135,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build:21
image: ghcr.io/project-chip/chip-build:22
volumes:
- "/tmp/log_output:/tmp/test_logs"
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
Expand Down Expand Up @@ -279,7 +283,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build:21
image: ghcr.io/project-chip/chip-build:22
volumes:
- "/tmp/log_output:/tmp/test_logs"
options: --sysctl "net.ipv6.conf.all.disable_ipv6=0
Expand Down Expand Up @@ -332,6 +336,39 @@ jobs:
pip3 install -r src/setup_payload/python/requirements.txt
python3 src/setup_payload/tests/run_python_setup_payload_gen_test.py out/chip-tool
build_linux_python_lighting_device:
name: Build on Linux (python lighting-app)

runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build:22
volumes:
- "/tmp/log_output:/tmp/test_logs"
options: --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"

steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Dump Concurrency context
env:
CONCURRENCY_CONTEXT: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
run: echo "$CONCURRENCY_CONTEXT"
- name: Checkout
uses: actions/checkout@v4
- name: Checkout submodules & Bootstrap
uses: ./.github/actions/checkout-submodules-and-bootstrap
with:
platform: linux

- name: Setup Build
run: |
scripts/build_python_device.sh --chip_detail_logging true
build_darwin:
name: Build on Darwin (clang, python_lib, simulated)
runs-on: macos-latest
Expand Down Expand Up @@ -414,7 +451,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build:21
image: ghcr.io/project-chip/chip-build:22
volumes:
- "/tmp/log_output:/tmp/test_logs"
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/chef.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build:21
image: ghcr.io/project-chip/chip-build:22
options: --user root

steps:
Expand All @@ -54,7 +54,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-esp32:21
image: ghcr.io/project-chip/chip-build-esp32:22
options: --user root

steps:
Expand All @@ -75,7 +75,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-nrf-platform:21
image: ghcr.io/project-chip/chip-build-nrf-platform:22
options: --user root

steps:
Expand All @@ -96,7 +96,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-telink:21
image: ghcr.io/project-chip/chip-build-telink:22
options: --user root

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cirque.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
# need to run with privilege, which isn't supported by job.XXX.contaner
# https://github.com/actions/container-action/issues/2
# container:
# image: ghcr.io/project-chip/chip-build-cirque:21
# image: ghcr.io/project-chip/chip-build-cirque:22
# volumes:
# - "/tmp:/tmp"
# - "/dev/pts:/dev/pts"
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/darwin-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ concurrency:

env:
CHIP_NO_LOG_TIMESTAMPS: true

jobs:
test_suites_chip_tool_darwin:
name: Test Suites - Darwin
Expand All @@ -38,6 +38,14 @@ jobs:
build_variant: [no-ble-asan-clang]
env:
BUILD_VARIANT: ${{matrix.build_variant}}

# We can't use the pigweed clang to build the Darwin framework once we start using
# Swift, because it does not handle CLANG_ENABLE_MODULES correctly.
#
# But the Xcode clang does not handle LSan correctly. Since we can't easily apply
# LSAN_OPTIONS to just everything except darwin-framework-tool, instead disable asan for
# it.
BUILD_VARIANT_FRAMEWORK_TOOL: no-ble
LSAN_OPTIONS: detect_leaks=1 malloc_context_size=40 suppressions=scripts/tests/chiptest/lsan-mac-suppressions.txt

if: github.actor != 'restyled-io[bot]'
Expand Down Expand Up @@ -83,7 +91,7 @@ jobs:
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py \
--target darwin-x64-darwin-framework-tool-${BUILD_VARIANT} \
--target darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL} \
--target darwin-x64-all-clusters-${BUILD_VARIANT} \
--target darwin-x64-lock-${BUILD_VARIANT} \
--target darwin-x64-ota-provider-${BUILD_VARIANT} \
Expand All @@ -97,7 +105,7 @@ jobs:
run: |
./scripts/run_in_build_env.sh \
"./scripts/tests/run_test_suite.py \
--chip-tool ./out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT}/darwin-framework-tool \
--chip-tool ./out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL}/darwin-framework-tool \
--target-skip-glob '{TestAccessControlConstraints}' \
run \
--iterations 1 \
Expand All @@ -114,7 +122,7 @@ jobs:
./scripts/run_in_build_env.sh \
"./scripts/tests/run_darwin_framework_ota_test.py \
run \
--darwin-framework-tool ./out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT}/darwin-framework-tool \
--darwin-framework-tool ./out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL}/darwin-framework-tool \
--ota-requestor-app ./out/darwin-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \
--ota-data-file /tmp/rawImage \
--ota-image-file /tmp/otaImage \
Expand All @@ -139,8 +147,8 @@ jobs:
uses: actions/upload-artifact@v3
if: ${{ failure() && !env.ACT }}
with:
name: framework-build-log-darwin-${{ matrix.build_variant }}
path: out/darwin-x64-darwin-framework-tool-${{ matrix.build_variant }}/darwin_framework_build.log
name: framework-build-log-darwin-${{BUILD_VARIANT_FRAMEWORK_TOOL}}
path: out/darwin-x64-darwin-framework-tool-${{BUILD_VARIANT_FRAMEWORK_TOOL}}/darwin_framework_build.log
- name: Uploading objdir for debugging
uses: actions/upload-artifact@v3
if: ${{ failure() && !env.ACT }}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/darwin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ jobs:
# but to instrument the code in the underlying libCHIP we need to pass CHIP_IS_UBSAN=YES
TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_UBSAN=YES CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1'> >(tee /tmp/darwin/framework-tests/darwin-tests-asan.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-err.log >&2)
# And the same thing, but with MTR_PER_CONTROLLER_STORAGE_ENABLED turned on.
TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_UBSAN=YES CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1 MTR_PER_CONTROLLER_STORAGE_ENABLED=1' > >(tee /tmp/darwin/framework-tests/darwin-tests-asan-provisional.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-provisional-err.log >&2)
TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_UBSAN=YES CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1 MTR_PER_CONTROLLER_STORAGE_ENABLED=1' > >(tee /tmp/darwin/framework-tests/darwin-tests-asan-controller-storage.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-controller-storage-err.log >&2)
# And the same thing, but with MTR_ENABLE_PROVISIONAL also turned on.
TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion' CHIP_IS_UBSAN=YES CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1 MTR_PER_CONTROLLER_STORAGE_ENABLED=1 MTR_ENABLE_PROVISIONAL=1' > >(tee /tmp/darwin/framework-tests/darwin-tests-asan-provisional.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-provisional-err.log >&2)
# And the same thing, but with MTR_NO_AVAILABILITY not turned on. This requires -Wno-unguarded-availability-new to avoid availability errors.
TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new' CHIP_IS_UBSAN=YES CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited}' > >(tee /tmp/darwin/framework-tests/darwin-tests-asan-with-availability-annotations.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-with-availability-annotations-err.log >&2)
# -enableThreadSanitizer instruments the code in Matter.framework,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doxygen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:

runs-on: ubuntu-latest
container:
image: ghcr.io/project-chip/chip-build-doxygen:21
image: ghcr.io/project-chip/chip-build-doxygen:22

if: github.actor != 'restyled-io[bot]'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples-ameba.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-ameba:21
image: ghcr.io/project-chip/chip-build-ameba:22
options: --user root

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples-asr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-asr:21
image: ghcr.io/project-chip/chip-build-asr:22
options: --user root

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples-bouffalolab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-bouffalolab:21
image: ghcr.io/project-chip/chip-build-bouffalolab:22
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples-cc13x2x7_26x2x7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-ti:21
image: ghcr.io/project-chip/chip-build-ti:22
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/examples-cc32xx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-ti:21
image: ghcr.io/project-chip/chip-build-ti:22
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
Expand All @@ -57,7 +57,7 @@ jobs:
run: |
scripts/run_in_build_env.sh "\
./scripts/build/build_examples.py \
--target cc32xx-lock build \
--target cc32xx-lock --target cc32xx-air-purifier build \
--copy-artifacts-to out/artifacts \
"
- name: Get lock app size stats
Expand All @@ -67,6 +67,13 @@ jobs:
out/artifacts/cc32xx-lock/chip-CC3235SF_LAUNCHXL-lock-example.out \
/tmp/bloat_reports/
- name: Get air purifier app size stats
run: |
.environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \
cc32xx CC3235SF_LAUNCHXL air-purifier \
out/artifacts/cc32xx-air-purifier/chip-CC3235SF_LAUNCHXL-air-purifier-example.out \
/tmp/bloat_reports/
- name: Uploading Size Reports
uses: ./.github/actions/upload-size-reports
if: ${{ !env.ACT }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples-efr32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-efr32:21
image: ghcr.io/project-chip/chip-build-efr32:22
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/examples-esp32.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-esp32:21
image: ghcr.io/project-chip/chip-build-esp32:22
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"

Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-esp32:21
image: ghcr.io/project-chip/chip-build-esp32:22
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples-infineon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-infineon:21
image: ghcr.io/project-chip/chip-build-infineon:22
volumes:
- "/tmp/bloat_reports:/tmp/bloat_reports"
steps:
Expand Down
Loading

0 comments on commit 38930dc

Please sign in to comment.