diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ac80fd42766735..ad808d72571692 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -25,8 +25,6 @@ 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 ln -s /usr/bin/clang-format-9 /usr/local/bin/clang-format - 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 | bsdtar -xvf - extension diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2a5052ba41f153..4b930c8c822f9c 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -8,7 +8,7 @@ "dockerfile": "Dockerfile", "args": { // "BUILD_VERSION": "$(cat integrations/docker/images/chip-build/version)" // trying to get this to work - "BUILD_VERSION": "0.2.15" + "BUILD_VERSION": "0.3.0" } }, "remoteUser": "vscode", diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b195a8c7d68dbc..218dd34ed507e5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -13,25 +13,27 @@ jobs: type: [main, clang, linux-embedded, mbedtls] env: BUILD_TYPE: ${{ matrix.type }} - BUILD_VERSION: 0.2.14 - BUILD_IMAGE: chip-build-openssl + BUILD_VERSION: 0.3.0 + BUILD_IMAGE: chip-build BUILD_ORG: connectedhomeip runs-on: ubuntu-latest container: - image: "connectedhomeip/chip-build-openssl:0.2.18" + image: "connectedhomeip/chip-build:0.3.0" volumes: - "/tmp/log_output:/tmp/test_logs" steps: - name: Checkout uses: actions/checkout@v2 + with: + submodules: true - name: Bootstrap run: | case $BUILD_TYPE in "main") export BOOTSTRAP_ARGUMENTS="";; - "clang") export BOOTSTRAP_ARGUMENTS="CC=clang-9 CXX=clang++-9";; + "clang") export BOOTSTRAP_ARGUMENTS="CC=clang CXX=clang++";; "linux-embedded") export BOOTSTRAP_ARGUMENTS="--with-device-layer=linux";; "mbedtls") export BOOTSTRAP_ARGUMENTS="--with-crypto=mbedtls";; *) ;; diff --git a/.github/workflows/examples.yaml b/.github/workflows/examples.yaml index 954a0924e10fc3..3ae3952f4fed31 100644 --- a/.github/workflows/examples.yaml +++ b/.github/workflows/examples.yaml @@ -10,14 +10,14 @@ jobs: env: BUILD_TYPE: esp32 - BUILD_VERSION: 0.2.14 + BUILD_VERSION: 0.3.0 BUILD_IMAGE: chip-build-esp32 BUILD_ORG: connectedhomeip runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build-esp32:0.2.14 # $BUILD_IMAGE/$BUILD_ORG:$BUILD_VERSION + image: connectedhomeip/chip-build-esp32:0.3.0 # $BUILD_IMAGE/$BUILD_ORG:$BUILD_VERSION volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" - "/tmp/output_binaries:/tmp/output_binaries" @@ -25,6 +25,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + with: + submodules: true - name: Build example Echo App run: scripts/examples/esp_echo_app.sh - name: Copy aside build products @@ -63,14 +65,14 @@ jobs: env: BUILD_TYPE: nrf - BUILD_VERSION: 0.2.14 + BUILD_VERSION: 0.3.0 BUILD_IMAGE: chip-build-nrf-platform BUILD_ORG: connectedhomeip runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build-nrf-platform:0.2.14 # $BUILD_IMAGE/$BUILD_ORG:$BUILD_VERSION + image: connectedhomeip/chip-build-nrf-platform:0.3.0 # $BUILD_IMAGE/$BUILD_ORG:$BUILD_VERSION volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" - "/tmp/output_binaries:/tmp/output_binaries" @@ -78,6 +80,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + with: + submodules: true - name: Build example nRF5 Lock App run: scripts/examples/nrf_lock_app.sh - name: Preserve artifacts @@ -90,14 +94,14 @@ jobs: env: BUILD_TYPE: linux - BUILD_VERSION: 0.2.14 + BUILD_VERSION: 0.3.0 BUILD_IMAGE: chip-build BUILD_ORG: connectedhomeip runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build:0.2.14 # $BUILD_IMAGE/$BUILD_ORG:$BUILD_VERSION + image: connectedhomeip/chip-build:0.3.0 # $BUILD_IMAGE/$BUILD_ORG:$BUILD_VERSION volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" - "/tmp/output_binaries:/tmp/output_binaries" @@ -105,6 +109,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + with: + submodules: true - name: Build example Standalone Echo Client run: scripts/examples/standalone_echo_client.sh - name: Build example Standalone Shell diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index 9353713cb6a20a..1576ed8d5af19c 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -10,20 +10,22 @@ jobs: env: BUILD_TYPE: esp32-qemu - BUILD_VERSION: 0.2.14 + BUILD_VERSION: 0.3.0 BUILD_IMAGE: chip-build-esp32-qemu BUILD_ORG: connectedhomeip runs-on: ubuntu-latest container: - image: connectedhomeip/chip-build-esp32-qemu:0.2.14 # $BUILD_IMAGE/$BUILD_ORG:$BUILD_VERSION + image: connectedhomeip/chip-build-esp32-qemu:0.3.0 # $BUILD_IMAGE/$BUILD_ORG:$BUILD_VERSION volumes: - "/tmp/log_output:/tmp/test_logs" steps: - name: Checkout uses: actions/checkout@v2 + with: + submodules: true - name: Build example Echo App run: scripts/examples/esp_echo_app.sh - name: Build ESP32 QEMU and Run Tests diff --git a/.gitmodules b/.gitmodules index 220f560519b95e..ec96bf28415e29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -52,7 +52,7 @@ branch = master ignore = dirty commit = 5f0e36eeb236a507631e9c822e43f742b7b6738a -[submodule "third_party/ot-br-posix/repo"] +[submodule "ot-br-posix"] path = third_party/ot-br-posix/repo url = https://github.com/openthread/ot-br-posix.git branch = master diff --git a/Makefile.am b/Makefile.am index 23b5e0f6d36891..f3f816b75fde91 100644 --- a/Makefile.am +++ b/Makefile.am @@ -52,6 +52,7 @@ EXTRA_DIST = \ bootstrap \ bootstrap-configure \ repos.conf \ + .gitmodules \ $(srcdir)/build/autoconf \ $(srcdir)/config \ $(srcdir)/config/efr32 \ diff --git a/docs/BUILDING.md b/docs/BUILDING.md index 60906643d7d0a1..b6cd4d9646ab45 100644 --- a/docs/BUILDING.md +++ b/docs/BUILDING.md @@ -30,7 +30,7 @@ want: - GNU make (versions prior to 4.1 may produce spurious warnings/errors) - automake, autoconf, libtool - C and C++ compilers -- clang-format-9 +- clang-format (at least version 9) - gcov - pkg-config diff --git a/examples/wifi-echo/server/esp32/README.md b/examples/wifi-echo/server/esp32/README.md index 3befa5922366cd..e65c66678bebb6 100644 --- a/examples/wifi-echo/server/esp32/README.md +++ b/examples/wifi-echo/server/esp32/README.md @@ -49,10 +49,10 @@ step. To install these components manually, follow these steps: Currently building in VSCode _and_ deploying from native is not supported, so make sure the IDF_PATH has been exported(See the manual setup steps above). -- In the root of the example directory, sync the dependencies and source - `idf.sh`. Note: This does not have to be repeated for incremental builds. +- In the root of the example directory, sync the CHIP tree's submodules and + source `idf.sh`. Note: This does not have to be repeated for incremental + builds. - $ make -C third_party/connectedhomeip -f Makefile-bootstrap repos $ source idf.sh - Next, if you want to use the M5Stack with its display and show a QRCode run diff --git a/integrations/docker/build.sh b/integrations/docker/build.sh index 180ce5b788f1f5..caab51843652bb 100755 --- a/integrations/docker/build.sh +++ b/integrations/docker/build.sh @@ -58,6 +58,12 @@ set -ex [[ -n $VERSION ]] || die "version cannot be empty" +# go find and build any CHIP images this image is "FROM" +awk -F/ '/^FROM connectedhomeip/ {print $2}' Dockerfile | while read -r dep; do + dep=${dep%:*} + (cd "../$dep" && ./build.sh "$@") +done + BUILD_ARGS=() if [[ ${*/--no-cache//} != "${*}" ]]; then BUILD_ARGS+=(--no-cache) diff --git a/integrations/docker/images/build-all.sh b/integrations/docker/images/build-all.sh index 675bccd2129933..e2de228f3d84c2 100755 --- a/integrations/docker/images/build-all.sh +++ b/integrations/docker/images/build-all.sh @@ -23,5 +23,5 @@ find . -name Dockerfile | while read -r dockerfile; do dir=${dockerfile%/*} - (cd "$dir" && ./build.sh) || exit $? + (cd "$dir" && ./build.sh "$@") || exit $? done diff --git a/integrations/docker/images/chip-build-esp32/Dockerfile b/integrations/docker/images/chip-build-esp32/Dockerfile index 5c1170e26ebc68..0d6d3f8303c825 100644 --- a/integrations/docker/images/chip-build-esp32/Dockerfile +++ b/integrations/docker/images/chip-build-esp32/Dockerfile @@ -3,6 +3,8 @@ FROM connectedhomeip/chip-build:${VERSION} # Setup the ESP-IDF RUN set -x \ + && apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y python \ && cd /var \ && git clone --progress -b release/v4.0 https://github.com/espressif/esp-idf.git \ && cd esp-idf \ diff --git a/integrations/docker/images/chip-build-nrf-platform/Dockerfile b/integrations/docker/images/chip-build-nrf-platform/Dockerfile index 261d5da4251caa..a7cd4ed31fc80d 100644 --- a/integrations/docker/images/chip-build-nrf-platform/Dockerfile +++ b/integrations/docker/images/chip-build-nrf-platform/Dockerfile @@ -16,8 +16,8 @@ RUN set -x \ && (mkdir /var/nRF5_tools && cd /var/nRF5_tools \ && curl https://www.nordicsemi.com/-/media/Software-and-other-downloads/Desktop-software/nRF-command-line-tools/sw/Versions-10-x-x/10-7-0/nRFCommandLineTools1070Linuxamd64tar.gz \ | tar zxvf - \ - && dpkg -i JLink_Linux_*.deb \ - && dpkg -i nRF-Command-Line-Tools_*.deb \ + && dpkg -i --force-depends JLink_Linux_*.deb \ + && dpkg -i --force-depends nRF-Command-Line-Tools_*.deb \ && tar zxvf nRF-Command-Line-Tools_*.tar.gz) \ && rm -rf /var/nRF5_tools/*.tar.gz \ && rm -rf /var/nRF5_tools/*.deb \ diff --git a/integrations/docker/images/chip-build-openssl/Dockerfile b/integrations/docker/images/chip-build-openssl/Dockerfile deleted file mode 100644 index 9d1a0d46989dd6..00000000000000 --- a/integrations/docker/images/chip-build-openssl/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -ARG VERSION=latest -FROM connectedhomeip/chip-build:${VERSION} - -# Install specific release of openssl -RUN set -x \ - && cd /tmp && wget https://github.com/openssl/openssl/archive/OpenSSL_1_1_1f.zip \ - && mkdir -p /tmp/openssl && cd /tmp/openssl && unzip ../OpenSSL_1_1_1f.zip \ - && cd /tmp/openssl/openssl-OpenSSL_1_1_1f && ./config && make && make install \ - && rm -rf /tmp/OpenSSL_1_1_1f.zip \ - && : # last line diff --git a/integrations/docker/images/chip-build-openssl/build.sh b/integrations/docker/images/chip-build-openssl/build.sh deleted file mode 120000 index fcb4d4ee75d531..00000000000000 --- a/integrations/docker/images/chip-build-openssl/build.sh +++ /dev/null @@ -1 +0,0 @@ -../../build.sh \ No newline at end of file diff --git a/integrations/docker/images/chip-build-openssl/run.sh b/integrations/docker/images/chip-build-openssl/run.sh deleted file mode 120000 index ccbd3501b330d9..00000000000000 --- a/integrations/docker/images/chip-build-openssl/run.sh +++ /dev/null @@ -1 +0,0 @@ -../../run.sh \ No newline at end of file diff --git a/integrations/docker/images/chip-build-openssl/version b/integrations/docker/images/chip-build-openssl/version deleted file mode 120000 index a4280acd348e7f..00000000000000 --- a/integrations/docker/images/chip-build-openssl/version +++ /dev/null @@ -1 +0,0 @@ -../chip-build/version \ No newline at end of file diff --git a/integrations/docker/images/chip-build-vscode/Dockerfile b/integrations/docker/images/chip-build-vscode/Dockerfile index f6630b04353cd4..95e0311bcbb196 100644 --- a/integrations/docker/images/chip-build-vscode/Dockerfile +++ b/integrations/docker/images/chip-build-vscode/Dockerfile @@ -1,6 +1,5 @@ ARG VERSION=latest FROM connectedhomeip/chip-build:${VERSION} -FROM connectedhomeip/chip-build-openssl:${VERSION} FROM connectedhomeip/chip-build-nrf-platform:${VERSION} FROM connectedhomeip/chip-build-esp32:${VERSION} FROM connectedhomeip/chip-build-esp32-qemu:${VERSION} diff --git a/integrations/docker/images/chip-build/Dockerfile b/integrations/docker/images/chip-build/Dockerfile index 1086e3bb343b29..b6c5be6533d6ff 100644 --- a/integrations/docker/images/chip-build/Dockerfile +++ b/integrations/docker/images/chip-build/Dockerfile @@ -1,12 +1,12 @@ -# start with Ubuntu 18.04LTS -FROM ubuntu:bionic +# start with Ubuntu 20.04LTS +FROM ubuntu:focal VOLUME "/var/source" # base build and check tools and libraries layer RUN set -x \ && apt-get update \ - && apt-get install -fy \ + && DEBIAN_FRONTEND=noninteractive apt-get install -fy \ git \ curl \ jq \ @@ -16,19 +16,19 @@ RUN set -x \ libtool \ pkg-config \ g++ \ - clang-9 \ - clang-format-9 \ - clang-tidy-9 \ + clang \ + clang-format \ + clang-tidy \ + cmake \ lcov \ shellcheck \ libssl-dev \ unzip \ wget \ libmbedtls-dev \ - python-pip \ python3 \ python3-pip \ - libusb-1.0 \ + libusb-1.0-0 \ libncurses5-dev \ libncursesw5-dev \ libnspr4-dev \ @@ -39,25 +39,35 @@ RUN set -x \ zlib1g-dev \ libglib2.0-dev \ libpixman-1-dev \ + libdbus-1-dev \ ninja-build \ && rm -rf /var/lib/apt/lists/ \ && : # last line +# Python 2 and PIP RUN set -x \ - && pip3 install circleci attrs coloredlogs PyGithub \ + && apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common \ + && add-apt-repository universe \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y python python2 \ + && curl https://bootstrap.pypa.io/get-pip.py --output get-pip.py \ + && python2 get-pip.py \ + && rm -rf /var/lib/apt/lists/ \ + && : # last line + +RUN set -x \ + && pip3 install circleci attrs coloredlogs PyGithub pygit \ && : # last line -# Install newer cmake toolchain +# build and install gn RUN set -x \ - && wget https://cmake.org/files/v3.17/cmake-3.17.2.tar.gz \ - && tar xzf cmake-3.17.2.tar.gz \ - && cd cmake-3.17.2 \ - && ./bootstrap \ - && make \ - && make install \ + && git clone https://gn.googlesource.com/gn \ + && cd gn \ + && python3 build/gen.py \ + && ninja -C out \ + && cp out/gn /usr/local/bin \ && cd .. \ - && rm -rf cmake-3.17.2 \ - && rm cmake-3.17.2.tar.gz \ + && rm -rf gn \ && : # last line # Install bloat comparison tools diff --git a/integrations/docker/images/chip-build/version b/integrations/docker/images/chip-build/version index 9097948ffe8dc2..0d91a54c7d439e 100644 --- a/integrations/docker/images/chip-build/version +++ b/integrations/docker/images/chip-build/version @@ -1 +1 @@ -0.2.16 +0.3.0 diff --git a/repos.conf b/repos.conf deleted file mode 100644 index fecf19b5b20739..00000000000000 --- a/repos.conf +++ /dev/null @@ -1,45 +0,0 @@ -[submodule "nlassert"] - path = third_party/nlassert/repo - url = https://github.com/nestlabs/nlassert.git - branch = master - update = none -[submodule "nlfaultinjection"] - path = third_party/nlfaultinjection/repo - url = https://github.com/nestlabs/nlfaultinjection.git - branch = master - update = none -[submodule "nlio"] - path = third_party/nlio/repo - url = https://github.com/nestlabs/nlio.git - branch = master - update = none -[submodule "nlunit-test"] - path = third_party/nlunit-test/repo - url = https://github.com/nestlabs/nlunit-test.git - branch = master - update = none -[submodule "mbedtls"] - path = third_party/mbedtls/repo - url = https://github.com/ARMmbed/mbedtls.git - branch = mbedtls-2.18 - update = none -[submodule "qrcode"] - path = examples/common/QRCode/repo - url = https://github.com/nayuki/QR-Code-generator.git - branch = master - update = none -[submodule "m5stack-tft"] - path = examples/common/m5stack-tft/repo - url = https://github.com/jeremyjh/ESP32_TFT_library.git - branch = master - update = none -[submodule "openthread"] - path = third_party/openthread/repo - url = https://github.com/openthread/openthread.git - branch = master - update = none -[submodule "ot-br-posix"] - path = third_party/ot-br-posix/repo - url = https://github.com/openthread/ot-br-posix.git - branch = master - update = none diff --git a/repos.conf b/repos.conf new file mode 120000 index 00000000000000..7837f9c220680c --- /dev/null +++ b/repos.conf @@ -0,0 +1 @@ +.gitmodules \ No newline at end of file diff --git a/scripts/examples/esp_echo_app.sh b/scripts/examples/esp_echo_app.sh index 9e011cffed02c1..b22d27d6814be2 100755 --- a/scripts/examples/esp_echo_app.sh +++ b/scripts/examples/esp_echo_app.sh @@ -21,7 +21,6 @@ env root=examples/wifi-echo/server/esp32/ -make -j -f Makefile-bootstrap repos # shellcheck source=/dev/null source "$root"/idf.sh diff --git a/scripts/helpers/clean_tree.sh b/scripts/helpers/clean_tree.sh index f871a932d297c7..ac7bcec2108004 100755 --- a/scripts/helpers/clean_tree.sh +++ b/scripts/helpers/clean_tree.sh @@ -19,4 +19,4 @@ set -x env -make -f Makefile-bootstrap clean-repos && git clean -Xdf +git clean -Xdf