From 12652009c06d15340dcaf96f69e1303b8bc6b987 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 19 Jun 2024 13:21:44 -0400 Subject: [PATCH] Prepare changes for build_python.sh for ubuntu 24.04 usage (#34016) Changes: - use `-m venv` to create the virtualenv - ensure `libgirepository1.0-dev` is installed, so that we are able to build/install pygobject --- integrations/docker/images/base/chip-build/Dockerfile | 1 + integrations/docker/images/base/chip-build/version | 2 +- scripts/build_python.sh | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/integrations/docker/images/base/chip-build/Dockerfile b/integrations/docker/images/base/chip-build/Dockerfile index 52009834302249..ebe222b8a7e468 100644 --- a/integrations/docker/images/base/chip-build/Dockerfile +++ b/integrations/docker/images/base/chip-build/Dockerfile @@ -59,6 +59,7 @@ RUN set -x \ libdmalloc-dev \ libgif-dev \ libgirepository-1.0-1 \ + libgirepository1.0-dev \ libglib2.0-dev \ libical-dev \ libjpeg-dev \ diff --git a/integrations/docker/images/base/chip-build/version b/integrations/docker/images/base/chip-build/version index 8dba8b6189e6a3..94561c77a986e4 100644 --- a/integrations/docker/images/base/chip-build/version +++ b/integrations/docker/images/base/chip-build/version @@ -1 +1 @@ -57 : [Telink] Update Docker image (Zephyr update) +58 : Add libgirepository1.0-dev to the base image, to make build_python.sh work (assume we want this everywhere) diff --git a/scripts/build_python.sh b/scripts/build_python.sh index ce0e40f5dd1475..a946bb1b8f518b 100755 --- a/scripts/build_python.sh +++ b/scripts/build_python.sh @@ -222,10 +222,10 @@ if [ -n "$install_virtual_env" ]; then if [ "$clean_virtual_env" = "yes" ]; then # Create a virtual environment that has access to the built python tools echo_blue "Creating a clear VirtualEnv in '$ENVIRONMENT_ROOT' ..." - virtualenv --clear "$ENVIRONMENT_ROOT" + python -m venv --clear "$ENVIRONMENT_ROOT" elif [ ! -f "$ENVIRONMENT_ROOT"/bin/activate ]; then echo_blue "Creating a new VirtualEnv in '$ENVIRONMENT_ROOT' ..." - virtualenv "$ENVIRONMENT_ROOT" + python -m venv "$ENVIRONMENT_ROOT" fi source "$ENVIRONMENT_ROOT"/bin/activate