From 6072891dc7ce8975cb93352fd4e25de7137c20ec Mon Sep 17 00:00:00 2001 From: Julia Kafarska Date: Sun, 21 Jun 2026 11:12:12 +0200 Subject: [PATCH 1/9] =?UTF-8?q?chore:=20debug-deploy=20=E2=80=94=20test=20?= =?UTF-8?q?pnpm=20deploy=20fixes=20collector?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/debug-deploy.yml | 45 ++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/debug-deploy.yml diff --git a/.github/workflows/debug-deploy.yml b/.github/workflows/debug-deploy.yml new file mode 100644 index 00000000..2c7edc64 --- /dev/null +++ b/.github/workflows/debug-deploy.yml @@ -0,0 +1,45 @@ +name: debug-deploy +on: + push: + branches: [fix/desktop-bundle] + workflow_dispatch: {} +jobs: + debug: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + - run: pnpm install --frozen-lockfile + - run: pnpm --filter @ice/db exec prisma generate + - name: build dist (prebuild + electron-vite) + run: | + set -e + pnpm --filter @ice/desktop run prebuild + pnpm --filter @ice/desktop exec electron-vite build + ls apps/desktop/dist + - name: pnpm deploy → flat self-contained dir + run: | + set +e + pnpm --filter @ice/desktop deploy --prod --legacy /tmp/deploy 2>&1 | tail -4 + echo "--- deploy dir ---" + ls /tmp/deploy 2>/dev/null + echo "--- @ice/core in deploy (symlink target inside deploy?) ---" + ls -ld /tmp/deploy/node_modules/@ice/core 2>/dev/null + readlink /tmp/deploy/node_modules/@ice/core 2>/dev/null + echo "--- size ---"; du -sh /tmp/deploy 2>/dev/null + echo "--- dist present in deploy? ---"; ls /tmp/deploy/dist 2>/dev/null + - name: electron-builder against the deploy dir (DOES THE COLLECTOR PASS?) + env: + NODE_OPTIONS: --max-old-space-size=8192 + run: | + set +e + pnpm --filter @ice/desktop exec electron-builder --linux --dir --publish never \ + -c.directories.app=/tmp/deploy \ + -c.electronVersion=41.0.3 2>&1 \ + | grep -E "error parsing|Node module collector|must be under|ENOENT|packaging|linux-unpacked|completed|rebuilding|installing native|⨯|file=" \ + | head -40 + echo "EB_EXIT=${PIPESTATUS[0]}" From 875dfd3c2716e41b8acdaba77aadf0f6390d0152 Mon Sep 17 00:00:00 2001 From: Julia Kafarska Date: Sun, 21 Jun 2026 11:16:33 +0200 Subject: [PATCH 2/9] chore: remove debug-deploy (pnpm deploy ruled out) --- .github/workflows/debug-deploy.yml | 45 ------------------------------ 1 file changed, 45 deletions(-) delete mode 100644 .github/workflows/debug-deploy.yml diff --git a/.github/workflows/debug-deploy.yml b/.github/workflows/debug-deploy.yml deleted file mode 100644 index 2c7edc64..00000000 --- a/.github/workflows/debug-deploy.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: debug-deploy -on: - push: - branches: [fix/desktop-bundle] - workflow_dispatch: {} -jobs: - debug: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: pnpm - - run: pnpm install --frozen-lockfile - - run: pnpm --filter @ice/db exec prisma generate - - name: build dist (prebuild + electron-vite) - run: | - set -e - pnpm --filter @ice/desktop run prebuild - pnpm --filter @ice/desktop exec electron-vite build - ls apps/desktop/dist - - name: pnpm deploy → flat self-contained dir - run: | - set +e - pnpm --filter @ice/desktop deploy --prod --legacy /tmp/deploy 2>&1 | tail -4 - echo "--- deploy dir ---" - ls /tmp/deploy 2>/dev/null - echo "--- @ice/core in deploy (symlink target inside deploy?) ---" - ls -ld /tmp/deploy/node_modules/@ice/core 2>/dev/null - readlink /tmp/deploy/node_modules/@ice/core 2>/dev/null - echo "--- size ---"; du -sh /tmp/deploy 2>/dev/null - echo "--- dist present in deploy? ---"; ls /tmp/deploy/dist 2>/dev/null - - name: electron-builder against the deploy dir (DOES THE COLLECTOR PASS?) - env: - NODE_OPTIONS: --max-old-space-size=8192 - run: | - set +e - pnpm --filter @ice/desktop exec electron-builder --linux --dir --publish never \ - -c.directories.app=/tmp/deploy \ - -c.electronVersion=41.0.3 2>&1 \ - | grep -E "error parsing|Node module collector|must be under|ENOENT|packaging|linux-unpacked|completed|rebuilding|installing native|⨯|file=" \ - | head -40 - echo "EB_EXIT=${PIPESTATUS[0]}" From 35b863f329eb5d1dfbcaec6bd5286c57e82a2552 Mon Sep 17 00:00:00 2001 From: Julia Kafarska Date: Sun, 21 Jun 2026 11:25:02 +0200 Subject: [PATCH 3/9] =?UTF-8?q?chore:=20debug-env=20=E2=80=94=20test=20san?= =?UTF-8?q?itized=20collector=20spawn=20env?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/debug-env.yml | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/debug-env.yml diff --git a/.github/workflows/debug-env.yml b/.github/workflows/debug-env.yml new file mode 100644 index 00000000..87f435b4 --- /dev/null +++ b/.github/workflows/debug-env.yml @@ -0,0 +1,39 @@ +name: debug-env +on: + push: + branches: [fix/desktop-bundle] + workflow_dispatch: {} +jobs: + debug: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + - run: pnpm install --frozen-lockfile + - run: pnpm --filter @ice/db exec prisma generate + - name: patch collector — spawn pnpm with a SANITIZED env (strip npm_* + NODE_OPTIONS) + run: | + F=$(find node_modules/.pnpm -path "*app-builder-lib@26*/out/node-module-collector/nodeModulesCollector.js" | head -1) + echo "patching: $F" + node -e ' + const fs=require("fs"); const f=process.argv[1]; let s=fs.readFileSync(f,"utf8"); + const marker = "env: { COREPACK_ENABLE_STRICT: \"0\", ...process.env }"; + const repl = "env: { COREPACK_ENABLE_STRICT: \"0\", ...Object.fromEntries(Object.entries(process.env).filter(([k]) => !/^npm_/i.test(k) && !/^pnpm_/i.test(k) && k !== \"NODE_OPTIONS\" && k !== \"INIT_CWD\")) }"; + if(!s.includes(marker)){console.error("MARKER NOT FOUND"); process.exit(1);} + s=s.replace(marker, repl); fs.writeFileSync(f,s); console.log("patched env-sanitize:", s.includes("filter(([k])")); + ' "$F" + - name: build — does the collector pass with a clean spawn env? + env: + NODE_OPTIONS: --max-old-space-size=8192 + run: | + set +e + pnpm --filter @ice/desktop run prebuild + pnpm --filter @ice/desktop exec electron-vite build + pnpm --filter @ice/desktop exec electron-builder --linux --dir --publish never 2>&1 \ + | grep -E "error parsing|Node module collector|packaging|linux-unpacked|completed|installing native|⨯|file=" \ + | head -25 + echo "EB_EXIT=${PIPESTATUS[0]}" From ba1b715540a3de5ad8e7f974bedb1797f3a2a41b Mon Sep 17 00:00:00 2001 From: Julia Kafarska Date: Sun, 21 Jun 2026 11:29:50 +0200 Subject: [PATCH 4/9] =?UTF-8?q?chore:=20debug=20=E2=80=94=20patch=20collec?= =?UTF-8?q?tor=20to=20shallow=20depth?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/debug-env.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/debug-env.yml b/.github/workflows/debug-env.yml index 87f435b4..2783ae3c 100644 --- a/.github/workflows/debug-env.yml +++ b/.github/workflows/debug-env.yml @@ -15,16 +15,16 @@ jobs: cache: pnpm - run: pnpm install --frozen-lockfile - run: pnpm --filter @ice/db exec prisma generate - - name: patch collector — spawn pnpm with a SANITIZED env (strip npm_* + NODE_OPTIONS) + - name: patch pnpm collector — use a SHALLOW depth so the dump isn't 105 MB run: | - F=$(find node_modules/.pnpm -path "*app-builder-lib@26*/out/node-module-collector/nodeModulesCollector.js" | head -1) + F=$(find node_modules/.pnpm -path "*app-builder-lib@26*/out/node-module-collector/pnpmNodeModulesCollector.js" | head -1) echo "patching: $F" node -e ' const fs=require("fs"); const f=process.argv[1]; let s=fs.readFileSync(f,"utf8"); - const marker = "env: { COREPACK_ENABLE_STRICT: \"0\", ...process.env }"; - const repl = "env: { COREPACK_ENABLE_STRICT: \"0\", ...Object.fromEntries(Object.entries(process.env).filter(([k]) => !/^npm_/i.test(k) && !/^pnpm_/i.test(k) && k !== \"NODE_OPTIONS\" && k !== \"INIT_CWD\")) }"; + const marker = "\"--depth\", \"6\""; + const repl = "\"--depth\", \"0\""; if(!s.includes(marker)){console.error("MARKER NOT FOUND"); process.exit(1);} - s=s.replace(marker, repl); fs.writeFileSync(f,s); console.log("patched env-sanitize:", s.includes("filter(([k])")); + s=s.replace(marker, repl); fs.writeFileSync(f,s); console.log("patched depth 6->0:", s.includes(repl)); ' "$F" - name: build — does the collector pass with a clean spawn env? env: From e5925f6b6f7df2cb015286631c0b7a0805e3c8fb Mon Sep 17 00:00:00 2001 From: Julia Kafarska Date: Sun, 21 Jun 2026 11:31:54 +0200 Subject: [PATCH 5/9] =?UTF-8?q?chore:=20debug=20=E2=80=94=20sed-patch=20co?= =?UTF-8?q?llector=20depth=206->0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/debug-env.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/debug-env.yml b/.github/workflows/debug-env.yml index 2783ae3c..c515cacd 100644 --- a/.github/workflows/debug-env.yml +++ b/.github/workflows/debug-env.yml @@ -19,13 +19,8 @@ jobs: run: | F=$(find node_modules/.pnpm -path "*app-builder-lib@26*/out/node-module-collector/pnpmNodeModulesCollector.js" | head -1) echo "patching: $F" - node -e ' - const fs=require("fs"); const f=process.argv[1]; let s=fs.readFileSync(f,"utf8"); - const marker = "\"--depth\", \"6\""; - const repl = "\"--depth\", \"0\""; - if(!s.includes(marker)){console.error("MARKER NOT FOUND"); process.exit(1);} - s=s.replace(marker, repl); fs.writeFileSync(f,s); console.log("patched depth 6->0:", s.includes(repl)); - ' "$F" + sed -i 's/"--depth", "6"/"--depth", "0"/' "$F" + echo "after patch:"; grep -E "depth" "$F" | head -2 - name: build — does the collector pass with a clean spawn env? env: NODE_OPTIONS: --max-old-space-size=8192 From 037b0c09f2a913b7c277bf505b71e633cb55997d Mon Sep 17 00:00:00 2001 From: Julia Kafarska Date: Sun, 21 Jun 2026 11:35:24 +0200 Subject: [PATCH 6/9] =?UTF-8?q?chore:=20debug=20=E2=80=94=20robust=20depth?= =?UTF-8?q?=20patch=20->0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/debug-env.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/debug-env.yml b/.github/workflows/debug-env.yml index c515cacd..b0bdb675 100644 --- a/.github/workflows/debug-env.yml +++ b/.github/workflows/debug-env.yml @@ -17,10 +17,11 @@ jobs: - run: pnpm --filter @ice/db exec prisma generate - name: patch pnpm collector — use a SHALLOW depth so the dump isn't 105 MB run: | - F=$(find node_modules/.pnpm -path "*app-builder-lib@26*/out/node-module-collector/pnpmNodeModulesCollector.js" | head -1) - echo "patching: $F" - sed -i 's/"--depth", "6"/"--depth", "0"/' "$F" - echo "after patch:"; grep -E "depth" "$F" | head -2 + for F in $(find node_modules/.pnpm -path "*app-builder-lib*/out/node-module-collector/pnpmNodeModulesCollector.js"); do + echo "patching: $F" + sed -i -E 's/("--depth", )"[^"]*"/\1"0"/' "$F" + grep -E '"--depth"' "$F" | head -1 + done - name: build — does the collector pass with a clean spawn env? env: NODE_OPTIONS: --max-old-space-size=8192 From f374a03fb1a0cc554980a65c3a96d4c5ed2069fe Mon Sep 17 00:00:00 2001 From: Julia Kafarska Date: Sun, 21 Jun 2026 11:37:45 +0200 Subject: [PATCH 7/9] =?UTF-8?q?chore:=20debug=20=E2=80=94=20verify=20depth?= =?UTF-8?q?-0=20app=20completeness?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/debug-env.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/debug-env.yml b/.github/workflows/debug-env.yml index b0bdb675..ba5a4857 100644 --- a/.github/workflows/debug-env.yml +++ b/.github/workflows/debug-env.yml @@ -33,3 +33,13 @@ jobs: | grep -E "error parsing|Node module collector|packaging|linux-unpacked|completed|installing native|⨯|file=" \ | head -25 echo "EB_EXIT=${PIPESTATUS[0]}" + echo "=== COMPLETENESS: are deep transitive deps packaged? ===" + ASAR=apps/desktop/release/linux-unpacked/resources/app.asar + if [ -f "$ASAR" ]; then + echo "deep-dep file count in app.asar:" + npx @electron/asar list "$ASAR" 2>/dev/null | grep -cE "node_modules/(better-sqlite3|@ibm-cloud|@google-cloud|@prisma/client|ioredis|bullmq|@aws-sdk|@azure)" || echo 0 + echo "--- samples ---" + npx @electron/asar list "$ASAR" 2>/dev/null | grep -oE "node_modules/(@[a-z-]+/)?[a-z][a-z0-9.-]*" | sort -u | grep -E "better-sqlite3|ibm-cloud|google-cloud|prisma|ioredis|bullmq|aws-sdk|azure|@ice" | head -20 + else + echo "no app.asar at $ASAR"; ls apps/desktop/release/linux-unpacked/resources 2>/dev/null + fi From 73141354df2aa72770160d0c594e9098f02ca5a5 Mon Sep 17 00:00:00 2001 From: Julia Kafarska Date: Sun, 21 Jun 2026 11:42:21 +0200 Subject: [PATCH 8/9] =?UTF-8?q?chore:=20debug=20=E2=80=94=20depth=206=20(p?= =?UTF-8?q?roven=20complete=20locally)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/debug-env.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/debug-env.yml b/.github/workflows/debug-env.yml index ba5a4857..48edde85 100644 --- a/.github/workflows/debug-env.yml +++ b/.github/workflows/debug-env.yml @@ -19,7 +19,7 @@ jobs: run: | for F in $(find node_modules/.pnpm -path "*app-builder-lib*/out/node-module-collector/pnpmNodeModulesCollector.js"); do echo "patching: $F" - sed -i -E 's/("--depth", )"[^"]*"/\1"0"/' "$F" + sed -i -E 's/("--depth", )"[^"]*"/\1"6"/' "$F" grep -E '"--depth"' "$F" | head -1 done - name: build — does the collector pass with a clean spawn env? From 9368d54c99bf5df6ddf24bf04a124142f88a9128 Mon Sep 17 00:00:00 2001 From: Julia Kafarska Date: Sun, 21 Jun 2026 16:01:08 +0200 Subject: [PATCH 9/9] chore: remove debug workflow (depth-6 fix found) --- .github/workflows/debug-env.yml | 45 --------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 .github/workflows/debug-env.yml diff --git a/.github/workflows/debug-env.yml b/.github/workflows/debug-env.yml deleted file mode 100644 index 48edde85..00000000 --- a/.github/workflows/debug-env.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: debug-env -on: - push: - branches: [fix/desktop-bundle] - workflow_dispatch: {} -jobs: - debug: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: pnpm - - run: pnpm install --frozen-lockfile - - run: pnpm --filter @ice/db exec prisma generate - - name: patch pnpm collector — use a SHALLOW depth so the dump isn't 105 MB - run: | - for F in $(find node_modules/.pnpm -path "*app-builder-lib*/out/node-module-collector/pnpmNodeModulesCollector.js"); do - echo "patching: $F" - sed -i -E 's/("--depth", )"[^"]*"/\1"6"/' "$F" - grep -E '"--depth"' "$F" | head -1 - done - - name: build — does the collector pass with a clean spawn env? - env: - NODE_OPTIONS: --max-old-space-size=8192 - run: | - set +e - pnpm --filter @ice/desktop run prebuild - pnpm --filter @ice/desktop exec electron-vite build - pnpm --filter @ice/desktop exec electron-builder --linux --dir --publish never 2>&1 \ - | grep -E "error parsing|Node module collector|packaging|linux-unpacked|completed|installing native|⨯|file=" \ - | head -25 - echo "EB_EXIT=${PIPESTATUS[0]}" - echo "=== COMPLETENESS: are deep transitive deps packaged? ===" - ASAR=apps/desktop/release/linux-unpacked/resources/app.asar - if [ -f "$ASAR" ]; then - echo "deep-dep file count in app.asar:" - npx @electron/asar list "$ASAR" 2>/dev/null | grep -cE "node_modules/(better-sqlite3|@ibm-cloud|@google-cloud|@prisma/client|ioredis|bullmq|@aws-sdk|@azure)" || echo 0 - echo "--- samples ---" - npx @electron/asar list "$ASAR" 2>/dev/null | grep -oE "node_modules/(@[a-z-]+/)?[a-z][a-z0-9.-]*" | sort -u | grep -E "better-sqlite3|ibm-cloud|google-cloud|prisma|ioredis|bullmq|aws-sdk|azure|@ice" | head -20 - else - echo "no app.asar at $ASAR"; ls apps/desktop/release/linux-unpacked/resources 2>/dev/null - fi