@@ -305,9 +305,17 @@ impl Manifest {
305
305
. as_ref ( )
306
306
. ok_or_else ( || tg:: error!( "expected a wrap binary" ) ) ?;
307
307
308
- tg:: cache:: cache ( tg, tg:: cache:: Arg {
309
- artifacts : vec ! [ file. id( ) . into( ) , stub_bin. id( ) . into( ) , stub_elf. id( ) . into( ) , wrap. id( ) . into( ) ]
310
- } )
308
+ tg:: cache:: cache (
309
+ tg,
310
+ tg:: cache:: Arg {
311
+ artifacts : vec ! [
312
+ file. id( ) . into( ) ,
313
+ stub_bin. id( ) . into( ) ,
314
+ stub_elf. id( ) . into( ) ,
315
+ wrap. id( ) . into( ) ,
316
+ ] ,
317
+ } ,
318
+ )
311
319
. await
312
320
. map_err ( |source| tg:: error!( !source, "failed to cache artifacts" ) ) ?;
313
321
@@ -317,9 +325,10 @@ impl Manifest {
317
325
let stub_bin = path. join ( stub_bin. id ( ) . to_string ( ) ) ;
318
326
let stub_elf = path. join ( stub_elf. id ( ) . to_string ( ) ) ;
319
327
let wrap = path. join ( wrap. id ( ) . to_string ( ) ) ;
320
-
328
+
321
329
// Create a temp file for the manifest.
322
- let mut manifest = tempfile:: NamedTempFile :: new ( ) . map_err ( |source| tg:: error!( !source, "failed to get temp file" ) ) ?;
330
+ let mut manifest = tempfile:: NamedTempFile :: new ( )
331
+ . map_err ( |source| tg:: error!( !source, "failed to get temp file" ) ) ?;
323
332
324
333
// Create a random output name.
325
334
let tempfile = tempfile:: NamedTempFile :: new ( )
@@ -329,7 +338,10 @@ impl Manifest {
329
338
// Create the manifest file. TODO: asyncify.
330
339
let contents = serde_json:: to_vec ( self )
331
340
. map_err ( |source| tg:: error!( !source, "failed to serialize manifest" ) ) ?;
332
- manifest. as_file_mut ( ) . write_all ( & contents) . map_err ( |source| tg:: error!( !source, "failed to write manifest" ) ) ?;
341
+ manifest
342
+ . as_file_mut ( )
343
+ . write_all ( & contents)
344
+ . map_err ( |source| tg:: error!( !source, "failed to write manifest" ) ) ?;
333
345
334
346
// Run the command.
335
347
let success = std:: process:: Command :: new ( wrap)
@@ -348,10 +360,14 @@ impl Manifest {
348
360
return Err ( tg:: error!( "failed to run the command" ) ) ;
349
361
}
350
362
351
- let bytes = std:: fs:: read ( output) . map_err ( |source| tg:: error!( !source, "failed to read the output" ) ) ?;
352
- std:: fs:: remove_file ( output) . map_err ( |source| tg:: error!( !source, "failed to remove output file" ) ) ?;
363
+ let bytes = std:: fs:: read ( output)
364
+ . map_err ( |source| tg:: error!( !source, "failed to read the output" ) ) ?;
365
+ std:: fs:: remove_file ( output)
366
+ . map_err ( |source| tg:: error!( !source, "failed to remove output file" ) ) ?;
353
367
let cursor = std:: io:: Cursor :: new ( bytes) ;
354
- let blob = tg:: Blob :: with_reader ( tg, cursor) . await . map_err ( |source| tg:: error!( !source, "failed to create blob" ) ) ?;
368
+ let blob = tg:: Blob :: with_reader ( tg, cursor)
369
+ . await
370
+ . map_err ( |source| tg:: error!( !source, "failed to create blob" ) ) ?;
355
371
356
372
// Obtain the dependencies from the manifest to add to the file.
357
373
// NOTE: We know the wrapper file has no dependencies, so there is no need to merge.
@@ -637,7 +653,6 @@ static TANGRAM_WRAPPER: LazyLock<tg::File> = LazyLock::new(|| {
637
653
tg:: File :: with_id ( id)
638
654
} ) ;
639
655
640
-
641
656
static TANGRAM_STUB_BIN : LazyLock < Option < tg:: File > > = LazyLock :: new ( || {
642
657
std:: env:: var ( "TANGRAM_STUB_BIN_ID" ) . ok ( ) . map ( |id| {
643
658
let id = id. parse ( ) . expect ( "TANGRAM_STUB_BIN_ID is not a valid ID" ) ;
0 commit comments