| 426 | } |
| 427 | |
| 428 | ensureDistinct(compilers: CompilerInfo[]) { |
| 429 | const ids: Record<string, CompilerInfo[]> = {}; |
| 430 | let foundClash = false; |
| 431 | for (const compiler of compilers) { |
| 432 | if (!ids[compiler.id]) ids[compiler.id] = []; |
| 433 | ids[compiler.id].push(compiler); |
| 434 | } |
| 435 | for (const [id, list] of Object.entries(ids)) { |
| 436 | if (list.length !== 1) { |
| 437 | foundClash = true; |
| 438 | logger.error( |
| 439 | `Compiler ID clash for '${id}' - used by ${list |
| 440 | .map(o => `lang:${o.lang} name:${o.name}`) |
| 441 | .join(', ')}`, |
| 442 | ); |
| 443 | } |
| 444 | } |
| 445 | return {compilers, foundClash}; |
| 446 | } |
| 447 | |
| 448 | async retryPromise<T>(promiseFunc: () => Promise<T>, name: string, maxFails: number, retryMs: number) { |
| 449 | for (let fails = 0; fails < maxFails; ++fails) { |