From 38101bca002e608f88a597c99159023cb54d5995 Mon Sep 17 00:00:00 2001 From: Till-JS <101404291+Till-JS@users.noreply.github.com> Date: Sun, 1 Feb 2026 14:58:05 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(matrix-bots):=20add=20pnpm?= =?UTF-8?q?=20rebuild=20for=20native=20crypto=20module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The @matrix-org/matrix-sdk-crypto-nodejs package needs a rebuild step after install to properly select the platform-specific prebuilt binary. Without this, the module fails to find the correct binding at runtime. Adds `pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true` after both the dev and prod install steps in all matrix bot Dockerfiles. Co-Authored-By: Claude Opus 4.5 --- services/matrix-calendar-bot/Dockerfile | 6 ++++++ services/matrix-clock-bot/Dockerfile | 6 ++++++ services/matrix-mana-bot/Dockerfile | 6 ++++++ services/matrix-nutriphi-bot/Dockerfile | 6 ++++++ services/matrix-ollama-bot/Dockerfile | 6 ++++++ services/matrix-project-doc-bot/Dockerfile | 6 ++++++ services/matrix-stats-bot/Dockerfile | 6 ++++++ services/matrix-todo-bot/Dockerfile | 6 ++++++ services/matrix-tts-bot/Dockerfile | 6 ++++++ services/matrix-zitare-bot/Dockerfile | 6 ++++++ 10 files changed, 60 insertions(+) diff --git a/services/matrix-calendar-bot/Dockerfile b/services/matrix-calendar-bot/Dockerfile index 4d6eb8a26..23d108502 100644 --- a/services/matrix-calendar-bot/Dockerfile +++ b/services/matrix-calendar-bot/Dockerfile @@ -19,6 +19,9 @@ COPY services/matrix-calendar-bot ./services/matrix-calendar-bot # Install all dependencies RUN pnpm install --frozen-lockfile --ignore-scripts +# Rebuild native modules to ensure platform-specific binaries are selected +RUN pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true + # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build RUN pnpm --filter @manacore/matrix-bot-common build @@ -50,6 +53,9 @@ COPY --from=builder /app/services/matrix-calendar-bot/package.json ./services/ma # Install production dependencies only RUN pnpm install --frozen-lockfile --prod --ignore-scripts +# Rebuild native modules to ensure platform-specific binaries are selected +RUN pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true + # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-clock-bot/Dockerfile b/services/matrix-clock-bot/Dockerfile index deb4d78eb..e86835e0a 100644 --- a/services/matrix-clock-bot/Dockerfile +++ b/services/matrix-clock-bot/Dockerfile @@ -19,6 +19,9 @@ COPY services/matrix-clock-bot ./services/matrix-clock-bot # Install all dependencies RUN pnpm install --frozen-lockfile --ignore-scripts +# Rebuild native modules to ensure platform-specific binaries are selected +RUN pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true + # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build RUN pnpm --filter @manacore/matrix-bot-common build @@ -50,6 +53,9 @@ COPY --from=builder /app/services/matrix-clock-bot/package.json ./services/matri # Install production dependencies only RUN pnpm install --frozen-lockfile --prod --ignore-scripts +# Rebuild native modules to ensure platform-specific binaries are selected +RUN pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true + # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-mana-bot/Dockerfile b/services/matrix-mana-bot/Dockerfile index 4e45bce03..092389a1c 100644 --- a/services/matrix-mana-bot/Dockerfile +++ b/services/matrix-mana-bot/Dockerfile @@ -19,6 +19,9 @@ COPY services/matrix-mana-bot ./services/matrix-mana-bot # Install all dependencies (--ignore-scripts to skip root postinstall hooks) RUN pnpm install --frozen-lockfile --ignore-scripts +# Rebuild native modules to ensure platform-specific binaries are selected +RUN pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true + # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build RUN pnpm --filter @manacore/matrix-bot-common build @@ -50,6 +53,9 @@ COPY --from=builder /app/services/matrix-mana-bot/package.json ./services/matrix # Install production dependencies only (--ignore-scripts to skip root postinstall hooks) RUN pnpm install --frozen-lockfile --prod --ignore-scripts +# Rebuild native modules to ensure platform-specific binaries are selected +RUN pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true + # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-nutriphi-bot/Dockerfile b/services/matrix-nutriphi-bot/Dockerfile index bd6f0ffb5..94ffef8cc 100644 --- a/services/matrix-nutriphi-bot/Dockerfile +++ b/services/matrix-nutriphi-bot/Dockerfile @@ -19,6 +19,9 @@ COPY services/matrix-nutriphi-bot ./services/matrix-nutriphi-bot # Install all dependencies RUN pnpm install --frozen-lockfile --ignore-scripts +# Rebuild native modules to ensure platform-specific binaries are selected +RUN pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true + # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build RUN pnpm --filter @manacore/matrix-bot-common build @@ -50,6 +53,9 @@ COPY --from=builder /app/services/matrix-nutriphi-bot/package.json ./services/ma # Install production dependencies only RUN pnpm install --frozen-lockfile --prod --ignore-scripts +# Rebuild native modules to ensure platform-specific binaries are selected +RUN pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true + # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-ollama-bot/Dockerfile b/services/matrix-ollama-bot/Dockerfile index 2f0710765..680872e3d 100644 --- a/services/matrix-ollama-bot/Dockerfile +++ b/services/matrix-ollama-bot/Dockerfile @@ -19,6 +19,9 @@ COPY services/matrix-ollama-bot ./services/matrix-ollama-bot # Install all dependencies RUN pnpm install --frozen-lockfile --ignore-scripts +# Rebuild native modules to ensure platform-specific binaries are selected +RUN pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true + # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build RUN pnpm --filter @manacore/matrix-bot-common build @@ -50,6 +53,9 @@ COPY --from=builder /app/services/matrix-ollama-bot/package.json ./services/matr # Install production dependencies only RUN pnpm install --frozen-lockfile --prod --ignore-scripts +# Rebuild native modules to ensure platform-specific binaries are selected +RUN pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true + # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-project-doc-bot/Dockerfile b/services/matrix-project-doc-bot/Dockerfile index a3765371c..fd8d7b4c8 100644 --- a/services/matrix-project-doc-bot/Dockerfile +++ b/services/matrix-project-doc-bot/Dockerfile @@ -19,6 +19,9 @@ COPY services/matrix-project-doc-bot ./services/matrix-project-doc-bot # Install all dependencies RUN pnpm install --frozen-lockfile --ignore-scripts +# Rebuild native modules to ensure platform-specific binaries are selected +RUN pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true + # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build RUN pnpm --filter @manacore/matrix-bot-common build @@ -50,6 +53,9 @@ COPY --from=builder /app/services/matrix-project-doc-bot/package.json ./services # Install production dependencies only RUN pnpm install --frozen-lockfile --prod --ignore-scripts +# Rebuild native modules to ensure platform-specific binaries are selected +RUN pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true + # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-stats-bot/Dockerfile b/services/matrix-stats-bot/Dockerfile index 2183efab8..73070748a 100644 --- a/services/matrix-stats-bot/Dockerfile +++ b/services/matrix-stats-bot/Dockerfile @@ -19,6 +19,9 @@ COPY services/matrix-stats-bot ./services/matrix-stats-bot # Install all dependencies RUN pnpm install --frozen-lockfile --ignore-scripts +# Rebuild native modules to ensure platform-specific binaries are selected +RUN pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true + # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build RUN pnpm --filter @manacore/matrix-bot-common build @@ -50,6 +53,9 @@ COPY --from=builder /app/services/matrix-stats-bot/package.json ./services/matri # Install production dependencies only RUN pnpm install --frozen-lockfile --prod --ignore-scripts +# Rebuild native modules to ensure platform-specific binaries are selected +RUN pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true + # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-todo-bot/Dockerfile b/services/matrix-todo-bot/Dockerfile index 8f03306ed..20580171a 100644 --- a/services/matrix-todo-bot/Dockerfile +++ b/services/matrix-todo-bot/Dockerfile @@ -19,6 +19,9 @@ COPY services/matrix-todo-bot ./services/matrix-todo-bot # Install all dependencies RUN pnpm install --frozen-lockfile --ignore-scripts +# Rebuild native modules to ensure platform-specific binaries are selected +RUN pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true + # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build RUN pnpm --filter @manacore/matrix-bot-common build @@ -50,6 +53,9 @@ COPY --from=builder /app/services/matrix-todo-bot/package.json ./services/matrix # Install production dependencies only RUN pnpm install --frozen-lockfile --prod --ignore-scripts +# Rebuild native modules to ensure platform-specific binaries are selected +RUN pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true + # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-tts-bot/Dockerfile b/services/matrix-tts-bot/Dockerfile index 8e2e820d2..efd308c5a 100644 --- a/services/matrix-tts-bot/Dockerfile +++ b/services/matrix-tts-bot/Dockerfile @@ -19,6 +19,9 @@ COPY services/matrix-tts-bot ./services/matrix-tts-bot # Install all dependencies RUN pnpm install --frozen-lockfile --ignore-scripts +# Rebuild native modules to ensure platform-specific binaries are selected +RUN pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true + # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build RUN pnpm --filter @manacore/matrix-bot-common build @@ -50,6 +53,9 @@ COPY --from=builder /app/services/matrix-tts-bot/package.json ./services/matrix- # Install production dependencies only RUN pnpm install --frozen-lockfile --prod --ignore-scripts +# Rebuild native modules to ensure platform-specific binaries are selected +RUN pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true + # Create data directory RUN mkdir -p /app/data diff --git a/services/matrix-zitare-bot/Dockerfile b/services/matrix-zitare-bot/Dockerfile index dc7e29113..89a5caad8 100644 --- a/services/matrix-zitare-bot/Dockerfile +++ b/services/matrix-zitare-bot/Dockerfile @@ -19,6 +19,9 @@ COPY services/matrix-zitare-bot ./services/matrix-zitare-bot # Install all dependencies RUN pnpm install --frozen-lockfile --ignore-scripts +# Rebuild native modules to ensure platform-specific binaries are selected +RUN pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true + # Build shared packages first (in dependency order) RUN pnpm --filter @manacore/bot-services build RUN pnpm --filter @manacore/matrix-bot-common build @@ -50,6 +53,9 @@ COPY --from=builder /app/services/matrix-zitare-bot/package.json ./services/matr # Install production dependencies only RUN pnpm install --frozen-lockfile --prod --ignore-scripts +# Rebuild native modules to ensure platform-specific binaries are selected +RUN pnpm rebuild @matrix-org/matrix-sdk-crypto-nodejs || true + # Create data directory RUN mkdir -p /app/data