@@ -60,6 +60,20 @@ export class MacInstaller implements Installer {
6060
6161 await exec . exec ( "xar" , [ "-xf" , archive ] , { cwd : extdir } ) ;
6262
63+ // Log directory tree to diagnose where the .app bundle is located
64+ const walk = async ( dir : string , depth = 0 ) : Promise < void > => {
65+ if ( depth > 3 ) return ;
66+ for ( const e of await fs . promises . readdir ( dir ) ) {
67+ core . info ( `${ " " . repeat ( depth ) } ${ e } ` ) ;
68+ const full = path . join ( dir , e ) ;
69+ if ( ( await fs . promises . stat ( full ) ) . isDirectory ( ) ) {
70+ await walk ( full , depth + 1 ) ;
71+ }
72+ }
73+ } ;
74+ core . info ( `Extracted pkg structure under ${ extdir } :` ) ;
75+ await walk ( extdir ) ;
76+
6377 const pkgdir = ( await fs . promises . readdir ( extdir ) ) . filter (
6478 ( e ) => e . startsWith ( "MicrosoftEdge" ) && e . endsWith ( ".pkg" ) ,
6579 ) [ 0 ] ;
@@ -76,8 +90,26 @@ export class MacInstaller implements Installer {
7690 await exec . exec ( "cpio" , [ "--extract" , "--file" , "App" ] , { cwd : pkgroot } ) ;
7791
7892 const app = path . join ( pkgroot , this . appName ( version ) ) ;
93+
94+ // Diagnose codesign and quarantine attributes before caching
95+ core . info ( `App path: ${ app } ` ) ;
96+ core . info ( `App exists: ${ fs . existsSync ( app ) } ` ) ;
97+ await exec . exec ( "codesign" , [ "--verify" , "--verbose=4" , app ] , {
98+ ignoreReturnCode : true ,
99+ } ) ;
100+ await exec . exec ( "xattr" , [ "-l" , app ] , { ignoreReturnCode : true } ) ;
101+ await exec . exec ( "spctl" , [ "-a" , "-v" , app ] , { ignoreReturnCode : true } ) ;
102+
79103 const root = await tc . cacheDir ( app , "msedge" , version ) ;
80104
105+ // Diagnose cached binary
106+ const cachedBin = path . join ( root , this . binPath ( version ) ) ;
107+ core . info ( `Cached binary: ${ cachedBin } ` ) ;
108+ core . info ( `Cached binary exists: ${ fs . existsSync ( cachedBin ) } ` ) ;
109+ await exec . exec ( "ls" , [ "-la" , path . dirname ( cachedBin ) ] , {
110+ ignoreReturnCode : true ,
111+ } ) ;
112+
81113 return { root, bin : this . binPath ( version ) } ;
82114 }
83115
@@ -110,6 +142,17 @@ export class MacInstaller implements Installer {
110142 async test ( version : versions . Version ) : Promise < void > {
111143 const bin = path . basename ( this . binPath ( version ) ) ;
112144 const msedgeBin = await io . which ( bin , true ) ;
113- await exec . exec ( `"${ msedgeBin } "` , [ "--version" ] ) ;
145+ core . info ( `Testing binary: ${ msedgeBin } ` ) ;
146+ const output = await exec . getExecOutput ( `"${ msedgeBin } "` , [ "--version" ] , {
147+ ignoreReturnCode : true ,
148+ } ) ;
149+ core . info ( `stdout: ${ output . stdout } ` ) ;
150+ core . info ( `stderr: ${ output . stderr } ` ) ;
151+ core . info ( `exit code: ${ output . exitCode } ` ) ;
152+ if ( output . exitCode !== 0 ) {
153+ throw new Error (
154+ `Edge binary test failed with exit code ${ output . exitCode } \nstderr: ${ output . stderr } ` ,
155+ ) ;
156+ }
114157 }
115158}
0 commit comments