From 8945c29725207722183951576a603b5cd7016e95 Mon Sep 17 00:00:00 2001 From: Lotus CI Date: Sat, 12 Sep 2026 12:09:46 -0400 Subject: [PATCH] =?UTF-8?q?ci(lotus):=20install=20pnpm=20directly=20?= =?UTF-8?q?=E2=80=94=20corepack=20shim=20breaks=20the=20matrix-js-sdk=20pr?= =?UTF-8?q?epare?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Run #1854 failed in `pnpm install --frozen-lockfile`: matrix-js-sdk is a git dependency (upstream pins matrix-org/matrix-js-sdk#develop) that pnpm must build from source, and that source's devEngines pins pnpm 11.9.0. Under `corepack enable` the nested `pnpm install` runs the 11.21.0 shim, which refuses to switch versions ("pnpm does not switch versions when running under corepack") and the prepare step aborts. Reproduced locally with a fresh store; with a real pnpm binary the nested install downloads 11.9.0 itself and succeeds. Both jobs now `npm install -g pnpm@` with the version read from package.json's packageManager field. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA --- .gitea/workflows/ci.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 348cc77d..5637fd17 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -48,8 +48,15 @@ jobs: registry-url: "https://code.lotusguild.org/api/packages/LotusGuild/npm/" scope: "@lotusguild" - - name: Enable corepack (pnpm from packageManager field) - run: corepack enable + # pnpm is installed directly (NOT via `corepack enable`): matrix-js-sdk + # is a git dependency that pnpm has to build from source, and its own + # devEngines pins a different pnpm (11.9.0). A corepack-shimmed pnpm + # refuses to switch versions for that nested install and the whole + # `pnpm install` fails (run #1854); a real pnpm binary downloads the + # pinned version itself. Version is read from package.json's + # packageManager field so it cannot drift from the lockfile. + - name: Install pnpm (version from packageManager field) + run: npm install -g "pnpm@$(node -p "require('./package.json').packageManager.split('@')[1].split('+')[0]")" - name: Install dependencies run: pnpm install --frozen-lockfile @@ -110,8 +117,15 @@ jobs: registry-url: "https://code.lotusguild.org/api/packages/LotusGuild/npm/" scope: "@lotusguild" - - name: Enable corepack - run: corepack enable + # pnpm is installed directly (NOT via `corepack enable`): matrix-js-sdk + # is a git dependency that pnpm has to build from source, and its own + # devEngines pins a different pnpm (11.9.0). A corepack-shimmed pnpm + # refuses to switch versions for that nested install and the whole + # `pnpm install` fails (run #1854); a real pnpm binary downloads the + # pinned version itself. Version is read from package.json's + # packageManager field so it cannot drift from the lockfile. + - name: Install pnpm (version from packageManager field) + run: npm install -g "pnpm@$(node -p "require('./package.json').packageManager.split('@')[1].split('+')[0]")" - name: Install dependencies run: pnpm install --frozen-lockfile