@@ -275,10 +275,13 @@ pub fn notarize(
275
275
. output_ok ( )
276
276
. context ( "failed to upload app to Apple's notarization servers." ) ?;
277
277
278
- let mut stdout = std:: str:: from_utf8 ( & output. stdout ) ?. to_string ( ) ;
279
- stdout. push ( '\n' ) ;
278
+ // combine both stdout and stderr to support macOS below 10.15
279
+ let mut notarize_response = std:: str:: from_utf8 ( & output. stdout ) ?. to_string ( ) ;
280
+ notarize_response. push ( '\n' ) ;
281
+ notarize_response. push_str ( std:: str:: from_utf8 ( & output. stderr ) ?) ;
282
+ notarize_response. push ( '\n' ) ;
280
283
if let Some ( uuid) = Regex :: new ( r"\nRequestUUID = (.+?)\n" ) ?
281
- . captures_iter ( & stdout )
284
+ . captures_iter ( & notarize_response )
282
285
. next ( )
283
286
{
284
287
info ! ( "notarization started; waiting for Apple response..." ) ;
@@ -288,7 +291,11 @@ pub fn notarize(
288
291
staple_app ( app_bundle_path. clone ( ) ) ?;
289
292
} else {
290
293
return Err (
291
- anyhow:: anyhow!( "failed to parse RequestUUID from upload output. {}" , stdout) . into ( ) ,
294
+ anyhow:: anyhow!(
295
+ "failed to parse RequestUUID from upload output. {}" ,
296
+ notarize_response
297
+ )
298
+ . into ( ) ,
292
299
) ;
293
300
}
294
301
@@ -326,10 +333,13 @@ fn get_notarization_status(
326
333
. output_ok ( ) ;
327
334
328
335
if let Ok ( output) = result {
329
- let mut stdout = std:: str:: from_utf8 ( & output. stdout ) ?. to_string ( ) ;
330
- stdout. push ( '\n' ) ;
336
+ // combine both stdout and stderr to support macOS below 10.15
337
+ let mut notarize_status = std:: str:: from_utf8 ( & output. stdout ) ?. to_string ( ) ;
338
+ notarize_status. push ( '\n' ) ;
339
+ notarize_status. push_str ( std:: str:: from_utf8 ( & output. stderr ) ?) ;
340
+ notarize_status. push ( '\n' ) ;
331
341
if let Some ( status) = Regex :: new ( r"\n *Status: (.+?)\n" ) ?
332
- . captures_iter ( & stdout )
342
+ . captures_iter ( & notarize_status )
333
343
. next ( )
334
344
{
335
345
let status = status[ 1 ] . to_string ( ) ;
@@ -339,16 +349,15 @@ fn get_notarization_status(
339
349
Err (
340
350
anyhow:: anyhow!( format!(
341
351
"Apple failed to notarize your app. {}" ,
342
- std :: str :: from_utf8 ( & output . stdout ) ?
352
+ notarize_status
343
353
) )
344
354
. into ( ) ,
345
355
)
346
356
} else if status != "success" {
347
357
Err (
348
358
anyhow:: anyhow!( format!(
349
359
"Unknown notarize status {}. {}" ,
350
- status,
351
- std:: str :: from_utf8( & output. stdout) ?
360
+ status, notarize_status
352
361
) )
353
362
. into ( ) ,
354
363
)
0 commit comments