@@ -474,6 +474,34 @@ async function run() {
474474 // someone else's binary.
475475 check ( platformBinaryName ( "linux" , "riscv64" ) === null , "an unbuilt arch resolves to nothing" ) ;
476476 check ( requiredAssets ( "linux" , "riscv64" ) . length === 0 , "an unpublished pair needs no assets" ) ;
477+
478+ // --- unsupported installs report the requested platform and arch -----
479+ {
480+ const dir = scratch ( ) ;
481+ const targetDir = path . join ( dir , "engine" ) ;
482+ const { server, baseUrl } = await startRelease ( { } ) ;
483+ try {
484+ for ( const [ options , target ] of [
485+ [ { platform : "freebsd" , arch : "x64" } , "freebsd-x64" ] ,
486+ [ { platform : "linux" , arch : "riscv64" } , "linux-riscv64" ] ,
487+ [ { platform : "win32" , arch : "arm" } , "win32-arm" ] ,
488+ [ { platform : "freebsd" } , `freebsd-${ os . arch ( ) } ` ] ,
489+ [ { arch : "riscv64" } , `${ os . platform ( ) } -riscv64` ] ,
490+ ] ) {
491+ let threw = null ;
492+ await ensureEngine ( VERSION , targetDir , { ...options , baseUrl } ) . catch ( ( e ) => ( threw = e ) ) ;
493+ check (
494+ threw !== null && threw . message === `no CodeGraph engine is published for ${ target } ` ,
495+ `an unsupported install reports ${ target } `
496+ ) ;
497+ check ( ! fs . existsSync ( targetDir ) , `${ target } is rejected before creating the install directory` ) ;
498+ }
499+ } finally {
500+ server . close ( ) ;
501+ fs . rmSync ( dir , { recursive : true , force : true } ) ;
502+ }
503+ }
504+
477505 // Every name the mapping can return has to be a name the release publishes,
478506 // or an install fetches a 404.
479507 for ( const [ p , a ] of [
0 commit comments