@@ -19,6 +19,7 @@ import {
19
19
import fastGlob from 'fast-glob' ;
20
20
import { performance } from 'perf_hooks' ;
21
21
import getFolderSize from 'get-folder-size' ;
22
+ import { familySync as getLibcFamilySync } from 'detect-libc' ;
22
23
23
24
const getAllDeps = ( json : Record < string , Record < string , string > > ) => ( {
24
25
...json . dependencies ,
@@ -99,7 +100,7 @@ const getPkgVersions = async (repoPath: string, pkgJsonPath: string) => {
99
100
100
101
const setPkgVersion = async ( repoPath : string , pkgJsonPath : string ) => {
101
102
const pkgVersions = await getPkgVersions ( repoPath , pkgJsonPath ) ;
102
- const pkgJson = await readJson ( pkgJsonPath ) ;
103
+ let pkgJson = await readJson ( pkgJsonPath ) ;
103
104
104
105
// override workspace protocol
105
106
Object . keys ( pkgVersions ) . forEach ( key => {
@@ -111,11 +112,25 @@ const setPkgVersion = async (repoPath: string, pkgJsonPath: string) => {
111
112
}
112
113
} ) ;
113
114
115
+ // use supportedArchitectures, see https://github.com/pnpm/pnpm/releases/tag/v8.10.0
116
+ pkgJson = {
117
+ ...pkgJson ,
118
+ packageManager :
'[email protected] ' ,
119
+ pnpm : {
120
+ supportedArchitectures : {
121
+ os : [ 'linux' ] ,
122
+ cpu : [ 'x64' ] ,
123
+ libc : [ 'glibc' ] ,
124
+ } ,
125
+ } ,
126
+ } ;
127
+
114
128
await outputJson ( pkgJsonPath , pkgJson , { spaces : 2 } ) ;
115
129
} ;
116
130
117
131
const runInstall = async ( casePath : string ) => {
118
132
const coldStartTime = performance . now ( ) ;
133
+ await runCommand ( casePath , 'corepack enable && pnpm -v' ) ;
119
134
await runCommand (
120
135
casePath ,
121
136
'pnpm install --registry https://registry.npmjs.org/' ,
@@ -165,6 +180,7 @@ const getDepCount = async (casePath: string) => {
165
180
} ;
166
181
167
182
export const pnpmInstall = async ( productName : string , caseName : string ) => {
183
+ console . log ( 'getLibcFamilySync: ' , getLibcFamilySync ( ) ) ;
168
184
const repoPath = getRepoPath ( getRepoName ( productName ) ) ;
169
185
const tempPath = getTempPath ( productName ) ;
170
186
const casePath = join ( tempPath , caseName ) ;
@@ -192,6 +208,8 @@ export const pnpmInstall = async (productName: string, caseName: string) => {
192
208
const installSize = await getInstallSize ( casePath ) ;
193
209
const depCount = await getDepCount ( casePath ) ;
194
210
211
+ await runCommand ( join ( casePath , 'node_modules/@rspack' ) , 'ls -l' ) ;
212
+
195
213
return saveMetrics ( {
196
214
coldInstallTime : coldInstallTime ,
197
215
hotInstallTime : hotInstallTime ,
0 commit comments