From 298e2e2b99d18bbab13a8d1167fcbc5e3835c594 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 4 Jan 2024 21:23:04 -1000 Subject: [PATCH] Attempt to fix 32bit docker builds (#107210) --- Dockerfile | 11 +++++++++-- script/hassfest/docker.py | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 43b21ab3ba8..da46f71ad22 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,12 +28,19 @@ RUN \ && if ls homeassistant/home_assistant_intents*.whl 1> /dev/null 2>&1; then \ pip3 install homeassistant/home_assistant_intents-*.whl; \ fi \ - && \ + && if [ "${BUILD_ARCH}" = "i386" ]; then \ + LD_PRELOAD="/usr/local/lib/libjemalloc.so.2" \ + MALLOC_CONF="background_thread:true,metadata_thp:auto,dirty_decay_ms:20000,muzzy_decay_ms:20000" \ + linux32 pip3 install \ + --only-binary=:all: \ + -r homeassistant/requirements_all.txt; \ + else \ LD_PRELOAD="/usr/local/lib/libjemalloc.so.2" \ MALLOC_CONF="background_thread:true,metadata_thp:auto,dirty_decay_ms:20000,muzzy_decay_ms:20000" \ pip3 install \ --only-binary=:all: \ - -r homeassistant/requirements_all.txt + -r homeassistant/requirements_all.txt; \ + fi ## Setup Home Assistant Core COPY . homeassistant/ diff --git a/script/hassfest/docker.py b/script/hassfest/docker.py index c9d81424229..2856c1ee0ea 100644 --- a/script/hassfest/docker.py +++ b/script/hassfest/docker.py @@ -34,12 +34,19 @@ RUN \ && if ls homeassistant/home_assistant_intents*.whl 1> /dev/null 2>&1; then \ pip3 install homeassistant/home_assistant_intents-*.whl; \ fi \ - && \ + && if [ "${{BUILD_ARCH}}" = "i386" ]; then \ + LD_PRELOAD="/usr/local/lib/libjemalloc.so.2" \ + MALLOC_CONF="background_thread:true,metadata_thp:auto,dirty_decay_ms:20000,muzzy_decay_ms:20000" \ + linux32 pip3 install \ + --only-binary=:all: \ + -r homeassistant/requirements_all.txt; \ + else \ LD_PRELOAD="/usr/local/lib/libjemalloc.so.2" \ MALLOC_CONF="background_thread:true,metadata_thp:auto,dirty_decay_ms:20000,muzzy_decay_ms:20000" \ pip3 install \ --only-binary=:all: \ - -r homeassistant/requirements_all.txt + -r homeassistant/requirements_all.txt; \ + fi ## Setup Home Assistant Core COPY . homeassistant/