@@ -577,56 +577,61 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst
577577 } ) ,
578578 ) ;
579579
580- it . effect ( "re-signs the Intel Mac runtime ad hoc and records the signed sizes" , ( ) =>
581- Effect . gen ( function * ( ) {
582- const fs = yield * FileSystem . FileSystem ;
583- const signed : Array < ReadonlyArray < string > > = [ ] ;
584- const spawner = ChildProcessSpawner . make ( ( command ) =>
585- Effect . gen ( function * ( ) {
586- if ( ! ChildProcess . isStandardCommand ( command ) )
587- return yield * Effect . die ( "Unexpected spawn." ) ;
588- const args = command . args . map ( String ) ;
589- signed . push ( [ String ( command . command ) , ...args ] ) ;
590- // codesign rewrites the signature, which changes each file's size.
591- for ( const file of args . slice ( 3 ) ) {
592- yield * fs . writeFileString ( file , "signature" , { flag : "a" } ) ;
593- }
594- return ChildProcessSpawner . makeHandle ( {
595- pid : ChildProcessSpawner . ProcessId ( 900_000_301 ) ,
596- exitCode : Effect . succeed ( ChildProcessSpawner . ExitCode ( 0 ) ) ,
597- isRunning : Effect . succeed ( false ) ,
598- kill : ( ) => Effect . void ,
599- unref : Effect . succeed ( Effect . void ) ,
600- stdin : Sink . drain ,
601- stdout : Stream . empty ,
602- stderr : Stream . empty ,
603- all : Stream . empty ,
604- getInputFd : ( ) => Sink . drain ,
605- getOutputFd : ( ) => Stream . empty ,
606- } ) ;
607- } ) . pipe ( Effect . orDie ) ,
608- ) ;
609- const { installation, validations } = yield * makeHarness ( {
610- platform : "darwin" ,
611- arch : "x64" ,
612- spawner,
613- } ) ;
614- yield * installation . start ;
615- expect ( ( yield * terminalState ( installation ) ) . phase ) . toBe ( "succeeded" ) ;
616- const validated = validations [ 0 ] ?. executable ;
617- expect ( signed ) . toEqual ( [
618- [
619- "/usr/bin/codesign" ,
620- "--force" ,
621- "--sign" ,
622- "-" ,
623- validated ?. executablePath ,
624- validated ?. harnessPath ,
625- ] ,
626- ] ) ;
627- const selected = yield * installation . resolve ( ) ;
628- expect ( yield * fs . readFileString ( selected . executablePath ) ) . toBe ( `${ serverContents } signature` ) ;
629- } ) ,
580+ // A simulated Mac install needs POSIX execute bits, which Windows files lack.
581+ it . effect . skipIf ( HostProcess . Platform . defaultValue ( ) === "win32" ) (
582+ "re-signs the Intel Mac runtime ad hoc and records the signed sizes" ,
583+ ( ) =>
584+ Effect . gen ( function * ( ) {
585+ const fs = yield * FileSystem . FileSystem ;
586+ const signed : Array < ReadonlyArray < string > > = [ ] ;
587+ const spawner = ChildProcessSpawner . make ( ( command ) =>
588+ Effect . gen ( function * ( ) {
589+ if ( ! ChildProcess . isStandardCommand ( command ) )
590+ return yield * Effect . die ( "Unexpected spawn." ) ;
591+ const args = command . args . map ( String ) ;
592+ signed . push ( [ String ( command . command ) , ...args ] ) ;
593+ // codesign rewrites the signature, which changes each file's size.
594+ for ( const file of args . slice ( 3 ) ) {
595+ yield * fs . writeFileString ( file , "signature" , { flag : "a" } ) ;
596+ }
597+ return ChildProcessSpawner . makeHandle ( {
598+ pid : ChildProcessSpawner . ProcessId ( 900_000_301 ) ,
599+ exitCode : Effect . succeed ( ChildProcessSpawner . ExitCode ( 0 ) ) ,
600+ isRunning : Effect . succeed ( false ) ,
601+ kill : ( ) => Effect . void ,
602+ unref : Effect . succeed ( Effect . void ) ,
603+ stdin : Sink . drain ,
604+ stdout : Stream . empty ,
605+ stderr : Stream . empty ,
606+ all : Stream . empty ,
607+ getInputFd : ( ) => Sink . drain ,
608+ getOutputFd : ( ) => Stream . empty ,
609+ } ) ;
610+ } ) . pipe ( Effect . orDie ) ,
611+ ) ;
612+ const { installation, validations } = yield * makeHarness ( {
613+ platform : "darwin" ,
614+ arch : "x64" ,
615+ spawner,
616+ } ) ;
617+ yield * installation . start ;
618+ expect ( ( yield * terminalState ( installation ) ) . phase ) . toBe ( "succeeded" ) ;
619+ const validated = validations [ 0 ] ?. executable ;
620+ expect ( signed ) . toEqual ( [
621+ [
622+ "/usr/bin/codesign" ,
623+ "--force" ,
624+ "--sign" ,
625+ "-" ,
626+ validated ?. executablePath ,
627+ validated ?. harnessPath ,
628+ ] ,
629+ ] ) ;
630+ const selected = yield * installation . resolve ( ) ;
631+ expect ( yield * fs . readFileString ( selected . executablePath ) ) . toBe (
632+ `${ serverContents } signature` ,
633+ ) ;
634+ } ) ,
630635 ) ;
631636
632637 // The mocked Linux PATH walk needs POSIX paths; Windows temp paths contain colons.
0 commit comments