From b7105ca3adeb98389564a017dc7aed18abdef7c7 Mon Sep 17 00:00:00 2001 From: jerrykingxyz Date: Thu, 21 Sep 2023 14:06:15 +0800 Subject: [PATCH] debug --- .github/actions/env/action.yml | 4 +++- .github/workflows/scheduled_bench.yml | 2 ++ lib/rspack.js | 1 + lib/scenarios/index.js | 10 ++++++++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/actions/env/action.yml b/.github/actions/env/action.yml index c03ccb31..8fa36fdc 100644 --- a/.github/actions/env/action.yml +++ b/.github/actions/env/action.yml @@ -16,7 +16,9 @@ runs: cache: 'pnpm' - name: Install dependencies shell: bash - run: $PNPM_HOME/pnpm --version && $PNPM_HOME/pnpm install + run: | + export PATH=$PNPM_HOME:$PATH + pnpm --version && pnpm install - name: Use rust cache uses: actions/cache@v3 with: diff --git a/.github/workflows/scheduled_bench.yml b/.github/workflows/scheduled_bench.yml index 0eb818ce..b59b7938 100644 --- a/.github/workflows/scheduled_bench.yml +++ b/.github/workflows/scheduled_bench.yml @@ -15,6 +15,8 @@ jobs: uses: ./.github/actions/env - name: Build rspack run: node bin/build-rspack.js + - name: Debug + uses: csexton/debugger-action@master - name: Run benchmark run: node bin/bench.js - id: print-compare-results diff --git a/lib/rspack.js b/lib/rspack.js index cbb619b6..75979b91 100644 --- a/lib/rspack.js +++ b/lib/rspack.js @@ -39,6 +39,7 @@ export async function buildRspack(remote, branch) { await switchToBranch(remote, branch); console.log("== install deps =="); + await runCommand("pnpm", ["--version"]); await runCommand("pnpm", ["install"]); console.log("== build rspack =="); diff --git a/lib/scenarios/index.js b/lib/scenarios/index.js index 57cb1770..73ce4807 100644 --- a/lib/scenarios/index.js +++ b/lib/scenarios/index.js @@ -2,6 +2,7 @@ import path from "path"; import { readFile, unlink, writeFile } from "fs/promises"; import { fileURLToPath } from "url"; import { runCommand } from "../utils.js"; +import { spawnSync } from "child_process"; import { getDirSizes, calcStatistics, @@ -41,6 +42,15 @@ async function runRspack(ctx) { } }; let remainingLine = ""; + + console.log(123); + spawnSync( + process.env.RSPACK_CLI_BIN || + path.resolve(rootDir, ".rspack/packages/rspack-cli/bin/rspack"), + ctx.rspackArgs, + { stdio: [process.stdin, process.stdout, process.stderr] } + ); + console.log(321); await runCommand( process.env.RSPACK_CLI_BIN || path.resolve(rootDir, ".rspack/packages/rspack-cli/bin/rspack"),