File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,26 @@ async function runSonameFixer() {
9898 } ) ;
9999
100100 // Run the WASI module
101- process . exit ( wasi . start ( instance ) )
101+ const exitCode = wasi . start ( instance )
102+ if ( exitCode !== 0 ) {
103+ console . error ( `Error: soname fixer exited with code ${ exitCode } ` )
104+ process . exit ( exitCode )
105+ }
106+
107+ // On macOS, re-sign the binary after patching
108+ if ( platform === 'darwin' ) {
109+ console . log ( 'Re-signing binary after patching...' )
110+ const { execSync } = require ( 'child_process' )
111+ try {
112+ execSync ( `codesign --force --sign - "${ nodeFilePath } "` , { stdio : 'inherit' } )
113+ console . log ( 'Binary re-signed successfully' )
114+ } catch ( error ) {
115+ console . error ( 'Warning: Failed to re-sign binary:' , error . message )
116+ // Don't fail the install if codesign fails - the binary might still work
117+ }
118+ }
119+
120+ process . exit ( 0 )
102121 } catch ( error ) {
103122 console . error ( 'Error: Failed to run soname fixer:' , error . message )
104123 process . exit ( 1 ) // Fail hard when installed as dependency
You can’t perform that action at this time.
0 commit comments