Skip to content

Commit

Permalink
Merge remote-tracking branch 'official/master' into update_sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
wy-hh committed Jan 19, 2023
2 parents a12a2a1 + 36133b1 commit 0149f81
Show file tree
Hide file tree
Showing 1,891 changed files with 138,639 additions and 161,147 deletions.
75 changes: 29 additions & 46 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ ENV LANG en_US.utf8

# these are installed for terminal/dev convenience. If more tooling for build is required, please
# add them to chip-build (in integrations/docker/images/chip-build)
RUN apt-get update
RUN apt-get install -y locales && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
RUN apt-get -fy install git vim emacs sudo \
RUN apt-get update \
&& apt-get install -y locales \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \
&& apt-get -fy install git vim emacs sudo \
apt-utils dialog zsh \
iproute2 procps lsb-release \
bash-completion \
Expand All @@ -36,49 +37,31 @@ RUN apt-get -fy install git vim emacs sudo \
docker.io \
iputils-ping net-tools \
libncurses5 \
libpython2.7

RUN groupadd -g $USER_GID $USERNAME
RUN useradd -s /bin/bash -u $USER_UID -g $USER_GID -G docker -m $USERNAME
RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME
RUN chmod 0440 /etc/sudoers.d/$USERNAME

RUN mkdir -p /var/downloads
RUN cd /var/downloads
RUN curl -JL https://github.com/microsoft/vscode-cpptools/releases/download/0.27.0/cpptools-linux.vsix > extension.zip
RUN unzip extension.zip
RUN mkdir -p /home/$USERNAME/.vscode-server/extensions
RUN mv extension /home/$USERNAME/.vscode-server/extensions/ms-vscode.cpptools-0.27.0
RUN mkdir -p /home/$USERNAME/bin
RUN curl https://raw.githubusercontent.com/restyled-io/restyler/master/bin/restyle-path -o /home/$USERNAME/bin/restyle-path
RUN chmod +x /home/$USERNAME/bin/restyle-path
RUN chown -R $USERNAME:$USERNAME /home/$USERNAME
RUN echo "PATH=/home/$USERNAME/bin:${PATH}" >> /home/$USERNAME/.bashrc

# $USERNAME needs to own the esp-idf and tools for the examples to build
RUN chown -R $USERNAME:$USERNAME /opt/espressif/esp-idf
RUN chown -R $USERNAME:$USERNAME /opt/espressif/tools

# $USERNAME needs to own west configuration to build nRF Connect examples
RUN chown -R $USERNAME:$USERNAME /opt/NordicSemiconductor/nrfconnect/

# allow read/write access to header and libraries
RUN chown -R $USERNAME:$USERNAME /opt/ubuntu-21.04-aarch64-sysroot/usr/

# allow licenses to be accepted
RUN chown -R $USERNAME:$USERNAME /opt/android/sdk

# AmebaD requires access to change build_info.h
RUN chown -R $USERNAME:$USERNAME /opt/ameba/ambd_sdk_with_chip_non_NDA/

# NXP uses a patch_sdk script to change SDK files
RUN mkdir -p /opt/sdk/sdks/
RUN chown -R $USERNAME:$USERNAME /opt/sdk/sdks/

RUN chown -R $USERNAME:$USERNAME /opt/fsl-imx-xwayland/5.15-kirkstone/

# Add access to openocd for VSCode debugging
RUN chown -R $USERNAME:$USERNAME /opt/openocd
libpython2.7 \
&& :

RUN groupadd -g $USER_GID $USERNAME \
&& useradd -s /bin/bash -u $USER_UID -g $USER_GID -G docker,sudo -m $USERNAME \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME \
&& :

RUN curl https://raw.githubusercontent.com/restyled-io/restyler/master/bin/restyle-path -o /usr/local/bin/restyle-path \
&& chmod +x /usr/local/bin/restyle-path \
&& :

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 \
&& :

# Fix Tizen SDK paths for new user
RUN sed -i '/^TIZEN_SDK_DATA_PATH/d' $TIZEN_SDK_ROOT/sdk.info \
Expand Down
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"build": {
"dockerfile": "Dockerfile",
"args": {
"BUILD_VERSION": "0.6.18"
"BUILD_VERSION": "0.6.30"
}
},
"remoteUser": "vscode",
Expand All @@ -34,6 +34,7 @@
"maelvalais.autoconf",
"marus25.cortex-debug",
"ms-azuretools.vscode-docker",
"ms-vscode.cpptools",
"msedge-dev.gnls",
"redhat.vscode-yaml",
"vadimcn.vscode-lldb",
Expand Down
2 changes: 1 addition & 1 deletion .github/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ bouffalolab
BRD
breakpoint
bredr
BridgedDeviceBasic
BridgedDeviceBasicInformation
bridgedLightEndpoint
bringup
BromateConcentrationMeasurement
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 @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest

container:
image: connectedhomeip/chip-build:0.6.18
image: connectedhomeip/chip-build:0.6.31

steps:
- uses: Wandalen/wretry.action@v1.0.36
Expand Down
102 changes: 75 additions & 27 deletions .github/workflows/build.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: connectedhomeip/chip-build:0.6.18
image: connectedhomeip/chip-build:0.6.31
volumes:
- "/tmp/log_output:/tmp/test_logs"
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build:0.6.18
image: connectedhomeip/chip-build:0.6.31
volumes:
- "/tmp/log_output:/tmp/test_logs"
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
Expand Down Expand Up @@ -251,6 +251,14 @@ jobs:
--pregen-dir ./zzz_pregenerated \
build \
"
- name: Check no code generation in output
run: |
CNT=$(find -name "CHIPClusters.h" out | wc -l)
if [ "${CNT}" != "0" ]; then
echo "ERROR: found unexpected generated files:"
find -name "CHIPClusters.h" out
exit 1
fi
- name: Undo code pre-generation changes (make compile time codegen work again)
run: |
rm -rf ./zzz_pregenerated
Expand Down Expand Up @@ -282,24 +290,6 @@ jobs:
# # 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
# - name: Run Code Coverage
# if: ${{ contains('main', env.BUILD_TYPE) }}
# run: scripts/tools/codecoverage.sh
# - name: Upload Code Coverage
# if: ${{ contains('main', env.BUILD_TYPE) }}
# run: bash <(curl -s https://codecov.io/bash)
# - name: Remove third_party binaries for CodeQL Analysis
# run: find out -type d -name "third_party" -exec rm -rf {} +
# - name: Remove dbus binaries for CodeQL Analysis
# run: find out -type d -name "dbus" -exec rm -rf {} +
# - name: Remove nrfxlib binaries for CodeQL Analysis
# run: find . -type d -name "nrfxlib" -exec rm -rf {} +
# - name: Perform CodeQL Analysis
# if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/master' }}
# uses: github/codeql-action/analyze@v1

build_linux_python_lib:
name: Build on Linux (python_lib)
timeout-minutes: 60
Expand All @@ -308,7 +298,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build:0.6.18
image: connectedhomeip/chip-build:0.6.31
volumes:
- "/tmp/log_output:/tmp/test_logs"
options: --sysctl "net.ipv6.conf.all.disable_ipv6=0
Expand Down Expand Up @@ -350,11 +340,24 @@ jobs:
scripts/run_in_build_env.sh 'pip3 install ./out/controller/python/chip_repl-0.0-py3-none-any.whl'
scripts/run_in_build_env.sh '(cd src/controller/python/test/unit_tests/ && python3 -m unittest -v)'
- name: Run Python Setup Payload Generator Test
timeout-minutes: 10
run: |
scripts/run_in_build_env.sh 'scripts/examples/gn_build_example.sh examples/chip-tool out/'
scripts/run_in_build_env.sh 'pip3 install -r src/setup_payload/python/requirements.txt'
scripts/run_in_build_env.sh 'python3 src/setup_payload/tests/run_python_setup_payload_gen_test.py out/chip-tool'
build_darwin:
name: Build on Darwin (clang, python_lib, simulated)
timeout-minutes: 200
runs-on: macos-latest
if: github.actor != 'restyled-io[bot]'

env:
# NOTE: Generally kept in sync within the repo using
# scripts/tools/zap/version_update.py
ZAP_VERSION: v2023.01.09-nightly
ZAP_INSTALL_PATH: /usr/local/zap/zap-v2023.01.09-nightly

steps:
- uses: Wandalen/wretry.action@v1.0.36
Expand Down Expand Up @@ -385,6 +388,16 @@ jobs:
ls -la /usr/local/Cellar/openssl@1.1
OPEN_SSL_VERSION=`ls -la /usr/local/Cellar/openssl@1.1 | cat | tail -n1 | awk '{print $NF}'`
ln -s /usr/local/Cellar/openssl@1.1/$OPEN_SSL_VERSION/lib/pkgconfig/* .
- name: Install zap
run: |
sudo mkdir -p $ZAP_INSTALL_PATH
sudo chown `whoami` $ZAP_INSTALL_PATH
curl -L https://github.com/project-chip/zap/releases/download/${ZAP_VERSION}/zap-mac.zip \
--output $ZAP_INSTALL_PATH/zap-mac.zip
cd $ZAP_INSTALL_PATH
unzip zap-mac.zip zap-cli
rm zap-mac.zip
./zap-cli --version
- name: Bootstrap
timeout-minutes: 25
run: scripts/build/gn_bootstrap.sh
Expand Down Expand Up @@ -449,9 +462,44 @@ jobs:
# uses: github/codeql-action/analyze@v1
# TODO Log Upload https://github.com/project-chip/connectedhomeip/issues/2227
# TODO https://github.com/project-chip/connectedhomeip/issues/1512
# - name: Run Code Coverage
# if: ${{ contains('main', env.BUILD_TYPE) }}
# run: scripts/tools/codecoverage.sh
# - name: Upload Code Coverage
# if: ${{ contains('main', env.BUILD_TYPE) }}
# run: bash <(curl -s https://codecov.io/bash)

build_linux_gcc_coverage:
name: Build on Linux (coverage)
timeout-minutes: 85

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

container:
image: connectedhomeip/chip-build:0.6.31
volumes:
- "/tmp/log_output:/tmp/test_logs"
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"

steps:
- uses: Wandalen/wretry.action@v1.0.36
name: Checkout
with:
action: actions/checkout@v3
with: |
token: ${{ github.token }}
attempt_limit: 3
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform linux
- name: Bootstrap
timeout-minutes: 10
run: scripts/build/gn_bootstrap.sh
- name: Uploading bootstrap logs
uses: actions/upload-artifact@v3
if: ${{ always() && !env.ACT }}
with:
name: bootstrap-logs
path: |
.environment/gn_out/.ninja_log
.environment/pigweed-venv/*.log
- name: Run Build Coverage
timeout-minutes: 20
run: ./scripts/build_coverage.sh

6 changes: 3 additions & 3 deletions .github/workflows/chef.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
if: github.actor != 'restyled-io[bot]'

container:
image: connectedhomeip/chip-build:0.6.18
image: connectedhomeip/chip-build:0.6.31
options: --user root

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

container:
image: connectedhomeip/chip-build-esp32:0.6.18
image: connectedhomeip/chip-build-esp32:0.6.31
options: --user root

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

container:
image: connectedhomeip/chip-build-nrf-platform:0.6.18
image: connectedhomeip/chip-build-nrf-platform:0.6.31
options: --user root

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cirque.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
timeout-minutes: 90

env:
DOCKER_RUN_VERSION: 0.6.18
DOCKER_RUN_VERSION: 0.6.31
GITHUB_CACHE_PATH: /tmp/cirque-cache/

runs-on: ubuntu-latest
Expand All @@ -38,7 +38,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: connectedhomeip/chip-build-cirque:0.6.18
# image: connectedhomeip/chip-build-cirque:0.6.31
# volumes:
# - "/tmp:/tmp"
# - "/dev/pts:/dev/pts"
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/darwin-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ jobs:
env:
BUILD_VARIANT: ${{matrix.build_variant}}
LSAN_OPTIONS: detect_leaks=1 malloc_context_size=40 suppressions=scripts/tests/chiptest/lsan-mac-suppressions.txt
# NOTE: Generally kept in sync within the repo using
# scripts/tools/zap/version_update.py
ZAP_VERSION: v2023.01.09-nightly
ZAP_INSTALL_PATH: /usr/local/zap/zap-v2023.01.09-nightly

if: github.actor != 'restyled-io[bot]'
runs-on: macos-latest
Expand Down Expand Up @@ -72,6 +76,16 @@ jobs:
ls -la /usr/local/Cellar/openssl@1.1
OPEN_SSL_VERSION=`ls -la /usr/local/Cellar/openssl@1.1 | cat | tail -n1 | awk '{print $NF}'`
ln -s /usr/local/Cellar/openssl@1.1/$OPEN_SSL_VERSION/lib/pkgconfig/* .
- name: Install zap
run: |
sudo mkdir -p $ZAP_INSTALL_PATH
sudo chown `whoami` $ZAP_INSTALL_PATH
curl -L https://github.com/project-chip/zap/releases/download/${ZAP_VERSION}/zap-mac.zip \
--output $ZAP_INSTALL_PATH/zap-mac.zip
cd $ZAP_INSTALL_PATH
unzip zap-mac.zip zap-cli
rm zap-mac.zip
./zap-cli --version
- name: Bootstrap
timeout-minutes: 25
run: scripts/build/gn_bootstrap.sh
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/darwin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ jobs:
if: github.actor != 'restyled-io[bot]'
runs-on: macos-latest

env:
# NOTE: Generally kept in sync within the repo using
# scripts/tools/zap/version_update.py
ZAP_VERSION: v2023.01.09-nightly
ZAP_INSTALL_PATH: /usr/local/zap/zap-v2023.01.09-nightly

steps:
- uses: Wandalen/wretry.action@v1.0.36
name: Checkout
Expand All @@ -52,6 +58,16 @@ jobs:
ls -la /usr/local/Cellar/openssl@1.1
OPEN_SSL_VERSION=`ls -la /usr/local/Cellar/openssl@1.1 | cat | tail -n1 | awk '{print $NF}'`
ln -s /usr/local/Cellar/openssl@1.1/$OPEN_SSL_VERSION/lib/pkgconfig/* .
- name: Install zap
run: |
sudo mkdir -p $ZAP_INSTALL_PATH
sudo chown `whoami` $ZAP_INSTALL_PATH
curl -L https://github.com/project-chip/zap/releases/download/${ZAP_VERSION}/zap-mac.zip \
--output $ZAP_INSTALL_PATH/zap-mac.zip
cd $ZAP_INSTALL_PATH
unzip zap-mac.zip zap-cli
rm zap-mac.zip
./zap-cli --version
- name: Bootstrap
timeout-minutes: 25
run: scripts/build/gn_bootstrap.sh
Expand Down
Loading

0 comments on commit 0149f81

Please sign in to comment.