| 121 | const sha = (algorithm, data) => createHash(algorithm).update(data).digest('hex'); |
| 122 | |
| 123 | function generatedProjects() { |
| 124 | const kernel = join(work, 'kernel'); |
| 125 | const other = join(work, 'other'); |
| 126 | const large = join(repo, 'scripts', 'benchmarks', 'large-files'); |
| 127 | for (const [script, out, extra] of [['kernel-languages.mjs', kernel, ['', KERNEL_SHAPES]], ['other-languages.mjs', other, []]]) { |
| 128 | const made = run(node, [join(large, script), dist, SMALL_MB, ...extra], { env: { BENCH_WRITE: out } }); |
| 129 | if (made.status !== 0) throw new Error(`${script} could not write its projects:\n${made.stderr}`); |
| 130 | } |
| 131 | return [ |
| 132 | ...folders(kernel).flatMap((language) => folders(join(kernel, language)).map((shape) => ({ id: `${language}/${shape}`, dir: join(kernel, language, shape) }))), |
| 133 | ...folders(other).map((name) => ({ id: name, dir: join(other, name) })), |
| 134 | ]; |
| 135 | } |
| 136 | |
| 137 | /** The engine's source as released, from the clone's own history. Null when the tag is not there. */ |
| 138 | function engineProject() { |