diff --git a/.github/workflows/manual.yaml b/.github/workflows/manual.yaml index 9efa680ba..0794a9518 100644 --- a/.github/workflows/manual.yaml +++ b/.github/workflows/manual.yaml @@ -96,21 +96,21 @@ jobs: - name: 🚀 Run specified benchmark run: cd scripts && ONLY_INSTALL_SIZE=${{ github.event.inputs.onlyInstallSize }} GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} COMMIT_ID=${{ github.event.inputs.commitId }} pnpm start ${{ matrix.product }} ${{ matrix.case }} - - name: Setup git user - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + # - name: Setup git user + # run: | + # git config --global user.name "github-actions[bot]" + # git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - - name: Install rsync - run: | - apt-get update && apt-get install -y rsync + # - name: Install rsync + # run: | + # apt-get update && apt-get install -y rsync - - name: Update data - uses: JamesIves/github-pages-deploy-action@v4.4.1 - with: - branch: gh-pages - folder: data - target-folder: data - git-config-name: gh-pages-bot - git-config-email: 41898282+github-actions[bot]@users.noreply.github.com - clean: false + # - name: Update data + # uses: JamesIves/github-pages-deploy-action@v4.4.1 + # with: + # branch: gh-pages + # folder: data + # target-folder: data + # git-config-name: gh-pages-bot + # git-config-email: 41898282+github-actions[bot]@users.noreply.github.com + # clean: false diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 141a1244f..c475386e8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,6 +25,9 @@ importers: consola: specifier: 2.15.3 version: 2.15.3 + detect-libc: + specifier: 2.0.2 + version: 2.0.2 execa: specifier: 5.1.1 version: 5.1.1 @@ -4902,6 +4905,11 @@ packages: resolution: {integrity: sha512-53rsFbGdwMwlF7qvCt0ypLM5V5/Mbl0szB7GPN8y9NCcbknYOeVVXdrXEq+90IwAfrrzt6Hd+u2E2ntakICU8w==} dev: false + /detect-libc@2.0.2: + resolution: {integrity: sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==} + engines: {node: '>=8'} + dev: false + /detect-node-es@1.1.0: resolution: {integrity: sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==} dev: false diff --git a/scripts/package.json b/scripts/package.json index 426c5cfc4..887ce4528 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -38,6 +38,7 @@ "@pnpm/lockfile-file": "8.1.4", "@types/node": "17.0.35", "@types/fs-extra": "9.0.13", + "detect-libc": "2.0.2", "get-folder-size": "2.0.1", "axios": "0.27.2", "execa": "5.1.1", diff --git a/scripts/src/runners/pnpm-install.ts b/scripts/src/runners/pnpm-install.ts index e7742379d..80496896b 100644 --- a/scripts/src/runners/pnpm-install.ts +++ b/scripts/src/runners/pnpm-install.ts @@ -19,6 +19,7 @@ import { import fastGlob from 'fast-glob'; import { performance } from 'perf_hooks'; import getFolderSize from 'get-folder-size'; +import { familySync as getLibcFamilySync } from 'detect-libc'; const getAllDeps = (json: Record>) => ({ ...json.dependencies, @@ -99,7 +100,7 @@ const getPkgVersions = async (repoPath: string, pkgJsonPath: string) => { const setPkgVersion = async (repoPath: string, pkgJsonPath: string) => { const pkgVersions = await getPkgVersions(repoPath, pkgJsonPath); - const pkgJson = await readJson(pkgJsonPath); + let pkgJson = await readJson(pkgJsonPath); // override workspace protocol Object.keys(pkgVersions).forEach(key => { @@ -111,11 +112,23 @@ const setPkgVersion = async (repoPath: string, pkgJsonPath: string) => { } }); + // use supportedArchitectures, see https://github.com/pnpm/pnpm/releases/tag/v8.10.0 + pkgJson = { + ...pkgJson, + packageManager: 'pnpm@8.10.0', + pnpm: { + supportedArchitectures: { + libc: ['musl'], + }, + }, + }; + await outputJson(pkgJsonPath, pkgJson, { spaces: 2 }); }; const runInstall = async (casePath: string) => { const coldStartTime = performance.now(); + await runCommand(casePath, 'corepack enable && pnpm -v'); await runCommand( casePath, 'pnpm install --registry https://registry.npmjs.org/', @@ -165,6 +178,7 @@ const getDepCount = async (casePath: string) => { }; export const pnpmInstall = async (productName: string, caseName: string) => { + console.log('getLibcFamilySync: ', getLibcFamilySync()); const repoPath = getRepoPath(getRepoName(productName)); const tempPath = getTempPath(productName); const casePath = join(tempPath, caseName); @@ -192,6 +206,8 @@ export const pnpmInstall = async (productName: string, caseName: string) => { const installSize = await getInstallSize(casePath); const depCount = await getDepCount(casePath); + await runCommand(join(casePath, 'node_modules/@rspack'), 'ls -l'); + return saveMetrics({ coldInstallTime: coldInstallTime, hotInstallTime: hotInstallTime,