From 29116ca0502ba0ce626e716ad6b7b4dea788131d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Tomkiel?= Date: Wed, 4 Sep 2024 15:02:21 +0200 Subject: [PATCH 1/9] Version bump, remove unnecessary libs --- .devcontainer/Dockerfile | 3 --- .devcontainer/devcontainer.json | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index da4e2c4171171e..422fdc87e96825 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -37,9 +37,6 @@ RUN apt-get update \ wget curl telnet \ docker.io \ iputils-ping net-tools \ - libncurses5 \ - libncursesw5 \ - libpython2.7 \ && : RUN groupadd -g $USER_GID $USERNAME \ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4d5be76434e8f8..521cc9d9480ed3 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -14,7 +14,7 @@ "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ], - "initializeCommand": "bash .devcontainer/build.sh --tag matter-dev-environment:local --version 22", + "initializeCommand": "bash .devcontainer/build.sh --tag matter-dev-environment:local --version 74", "image": "matter-dev-environment:local", "remoteUser": "vscode", "customizations": { From db3e1515a161fec8359b12462d3b5fef23ed6306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Tomkiel?= Date: Wed, 4 Sep 2024 15:05:00 +0200 Subject: [PATCH 2/9] Allow environment location modification --- .devcontainer/devcontainer.json | 3 +++ integrations/docker/images/vscode/chip-build-vscode/Dockerfile | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 521cc9d9480ed3..744beed2237d62 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -17,6 +17,9 @@ "initializeCommand": "bash .devcontainer/build.sh --tag matter-dev-environment:local --version 74", "image": "matter-dev-environment:local", "remoteUser": "vscode", + "containerEnv": { + "PW_ENVIRONMENT_ROOT": "/workspaces/connectedhomeip/.environment-vscode" + }, "customizations": { "vscode": { // Add the IDs of extensions you want installed when the container is created in the array below. diff --git a/integrations/docker/images/vscode/chip-build-vscode/Dockerfile b/integrations/docker/images/vscode/chip-build-vscode/Dockerfile index 9d6e24b1d259ea..7040eb7c3335a2 100644 --- a/integrations/docker/images/vscode/chip-build-vscode/Dockerfile +++ b/integrations/docker/images/vscode/chip-build-vscode/Dockerfile @@ -130,7 +130,6 @@ ENV NXP_K32W0_SDK_ROOT=/opt/k32w/core ENV NXP_K32W1_SDK_ROOT=/opt/k32w/k32w1 ENV NXP_SDK_ROOT=/opt/nxp-sdk/rw61x ENV OPENOCD_PATH=/opt/openocd/ -ENV PW_ENVIRONMENT_ROOT=/home/vscode/pigweed/env ENV QEMU_ESP32=/opt/espressif/qemu/qemu-system-xtensa ENV QEMU_ESP32_DIR=/opt/espressif/qemu ENV SYSROOT_AARCH64=/opt/ubuntu-22.04.1-aarch64-sysroot From e518d593b0efa92150dfeb549e723438bf955094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Tomkiel?= Date: Wed, 4 Sep 2024 15:08:26 +0200 Subject: [PATCH 3/9] Add apt installs to base image --- .devcontainer/Dockerfile | 3 +-- .../docker/images/vscode/chip-build-vscode/Dockerfile | 10 ++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 422fdc87e96825..b5d04be2490c11 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -24,8 +24,7 @@ ARG USER_UID=1000 ARG USER_GID=$USER_UID 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) +# TODO: remove these apt installs in the future as they will be in the base image from version 75+. 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 \ diff --git a/integrations/docker/images/vscode/chip-build-vscode/Dockerfile b/integrations/docker/images/vscode/chip-build-vscode/Dockerfile index 7040eb7c3335a2..0137b760f6ad76 100644 --- a/integrations/docker/images/vscode/chip-build-vscode/Dockerfile +++ b/integrations/docker/images/vscode/chip-build-vscode/Dockerfile @@ -106,6 +106,16 @@ RUN set -x \ telnet \ srecord \ openjdk-8-jdk \ + git vim emacs sudo \ + apt-utils dialog zsh \ + iproute2 procps lsb-release \ + bash-completion \ + build-essential cmake cppcheck valgrind \ + wget curl telnet \ + docker.io \ + iputils-ping net-tools \ + locales \ + && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/ \ && : # last line From 92333806e51695f097848640220c675e5930d421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Tomkiel?= Date: Wed, 4 Sep 2024 15:09:35 +0200 Subject: [PATCH 4/9] Speed-up image building --- .devcontainer/Dockerfile | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index b5d04be2490c11..a185373e2b6854 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -51,13 +51,22 @@ 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/NordicSemiconductor/nrfconnect/ `# $USERNAME needs to own west configuration to build nRF Connect examples` \ - $IDF_PATH `# $USERNAME needs to own the esp-idf and tools for the examples to build` \ + $ANDROID_HOME \ $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 \ + && find $AMEBA_PATH -name "inc_lp" -print0 | xargs -0 chown -R $USERNAME:$USERNAME \ + && find $AMEBA_PATH -name "inc_hp" -print0 | xargs -0 chown -R $USERNAME:$USERNAME \ + && find $AMEBA_PATH -name "project_lp" -print0 | xargs -0 chown -R $USERNAME:$USERNAME \ + && find $AMEBA_PATH -name "project_hp" -print0 | xargs -0 chown -R $USERNAME:$USERNAME \ + && chmod -R +x \ + $ANDROID_HOME/tools/bin `# sdkmanager for accepting licenses`\ + && chmod -R +w \ + $IDF_TOOLS_PATH \ + && find $AMEBA_PATH -name "inc_lp" -print0 | xargs -0 chmod -R +w \ + && find $AMEBA_PATH -name "inc_hp" -print0 | xargs -0 chmod -R +w \ + && find $AMEBA_PATH -name "project_lp" -print0 | xargs -0 chmod -R +w \ + && find $AMEBA_PATH -name "project_hp" -print0 | xargs -0 chmod -R +w \ + # Safe directory is preffered over chown. + && git config --global --add safe.directory "*" \ && : # Fix Tizen SDK paths for new user From 9017e3ba577772164f4a4f2eabb0eaa3d180c149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Tomkiel?= Date: Wed, 4 Sep 2024 16:15:25 +0200 Subject: [PATCH 5/9] Remove unneeded apt installs --- .devcontainer/Dockerfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index a185373e2b6854..6572826fc65298 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -24,18 +24,17 @@ ARG USER_UID=1000 ARG USER_GID=$USER_UID ENV LANG en_US.utf8 -# TODO: remove these apt installs in the future as they will be in the base image from version 75+. + 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-get -fy install vim emacs sudo \ apt-utils dialog zsh \ - iproute2 procps lsb-release \ + lsb-release \ bash-completion \ - build-essential cmake cppcheck valgrind \ - wget curl telnet \ + valgrind \ docker.io \ - iputils-ping net-tools \ + iputils-ping \ && : RUN groupadd -g $USER_GID $USERNAME \ From 9fb7f773ed3349619a677aa4bad331b07e3253b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Tomkiel?= Date: Wed, 4 Sep 2024 16:16:43 +0200 Subject: [PATCH 6/9] Expose and document important env variable --- .../images/vscode/chip-build-vscode/Dockerfile | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/integrations/docker/images/vscode/chip-build-vscode/Dockerfile b/integrations/docker/images/vscode/chip-build-vscode/Dockerfile index 0137b760f6ad76..37726292c8db6c 100644 --- a/integrations/docker/images/vscode/chip-build-vscode/Dockerfile +++ b/integrations/docker/images/vscode/chip-build-vscode/Dockerfile @@ -106,16 +106,6 @@ RUN set -x \ telnet \ srecord \ openjdk-8-jdk \ - git vim emacs sudo \ - apt-utils dialog zsh \ - iproute2 procps lsb-release \ - bash-completion \ - build-essential cmake cppcheck valgrind \ - wget curl telnet \ - docker.io \ - iputils-ping net-tools \ - locales \ - && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \ && apt-get clean \ && rm -rf /var/lib/apt/lists/ \ && : # last line @@ -153,6 +143,10 @@ ENV ZEPHYR_NXP_BASE=/opt/nxp-zephyr/zephyrproject/zephyr ENV ZEPHYR_NXP_SDK_INSTALL_DIR=/opt/nxp-zephyr/zephyr-sdk-0.16.5 ENV NXP_UPDATE_SDK_SCRIPT_DOCKER=/opt/nxp/nxp_matter_support/scripts/update_nxp_sdk.py +# Places bootstrap files there instead of the default one which is `.environment`. +# NOTE: This directory is NOT persistent. +ENV PW_ENVIRONMENT_ROOT=/home/vscode/pigweed/env + ENV TIZEN_VERSION 7.0 ENV TIZEN_SDK_ROOT /opt/tizen-sdk ENV TIZEN_SDK_TOOLCHAIN $TIZEN_SDK_ROOT/tools/arm-linux-gnueabi-gcc-9.2 From f7804313bcfc2821560e34bf5ae50b79d6e2215b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Tomkiel?= Date: Thu, 5 Sep 2024 07:33:10 +0200 Subject: [PATCH 7/9] Add all pigweed environments to .gitignore --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 1c2d1430263594..98dc6780fccc2a 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,7 @@ out/ /src/darwin/Framework/build/ # Pigweed Environment -.environment/ +.environment*/ build_overrides/pigweed_environment.gni # Temporary Directories @@ -84,4 +84,3 @@ examples/*/esp32/dependencies.lock # jupyter temporary files .ipynb_checkpoints - From 9938e43f667dc208c16ca52109b1b8f782df2513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Tomkiel?= Date: Thu, 5 Sep 2024 07:33:53 +0200 Subject: [PATCH 8/9] Revert and reformat comment --- .devcontainer/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 6572826fc65298..386253bb609e8e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -25,6 +25,8 @@ ARG USER_GID=$USER_UID 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 \ && apt-get install -y locales \ && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 \ From 51a8eb17797a8c3c837000190ebb0323f9104d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Tomkiel?= Date: Thu, 5 Sep 2024 09:33:24 +0200 Subject: [PATCH 9/9] Compatibility fix --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 744beed2237d62..9c7f6aeaef881b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -18,7 +18,7 @@ "image": "matter-dev-environment:local", "remoteUser": "vscode", "containerEnv": { - "PW_ENVIRONMENT_ROOT": "/workspaces/connectedhomeip/.environment-vscode" + "PW_ENVIRONMENT_ROOT": "${containerWorkspaceFolder}/.environment-vscode" }, "customizations": { "vscode": {