| … | … | @@ -49,6 +49,22 @@ function archLabel (platform, arch) { |
| 49 | 49 | return (osMap[platform] || platform) + '-' + (archMap[arch] || arch) |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | const KNOWN_FLAGS = new Set(['root', 'os', 'arch', 'out', 'stage-out', 'extra-arch']) |
| 53 | for (let i = 2; i < process.argv.length; i++) { |
| 54 | const a = process.argv[i] |
| 55 | if (!a.startsWith('--')) continue |
| 56 | const name = a.slice(2).split('=')[0] |
| 57 | if (!KNOWN_FLAGS.has(name)) { |
| 58 | // Loud on purpose. These builders are COPIED per bootstrap app, so a stale |
| 59 | // copy silently ignoring a new flag yields a confidently wrong artifact — |
| 60 | // exactly how a --extra-arch build produced a single-arch tree that still |
| 61 | // reported success. |
| 62 | console.error('error: unknown flag ' + a + ' — this build-bootstrap-bare.js is probably stale.') |
| 63 | console.error(' Known flags: --' + [...KNOWN_FLAGS].join(' --')) |
| 64 | process.exit(1) |
| 65 | } |
| 66 | } |
| 67 | |
| 52 | 68 | const OS = getFlag('os', os.platform()) |
| 53 | 69 | const ARCH = getFlag('arch', os.arch()) |
| 54 | 70 | const LABEL = archLabel(OS, ARCH) |