@@ -7,6 +7,7 @@ use std::{
7
7
8
8
use anyhow:: { bail, Context , Result } ;
9
9
use rustc_hash:: FxHashSet ;
10
+ use tracing:: Instrument ;
10
11
use turbo_rcstr:: RcStr ;
11
12
use turbo_tasks:: {
12
13
apply_effects, ReadConsistency , ResolvedVc , TransientInstance , TryJoinIterExt , TurboTasks ,
@@ -149,7 +150,9 @@ impl TurbopackBuildBuilder {
149
150
// Await the result to propagate any errors.
150
151
build_result_op. read_strongly_consistent ( ) . await ?;
151
152
152
- apply_effects ( build_result_op) . await ?;
153
+ apply_effects ( build_result_op)
154
+ . instrument ( tracing:: info_span!( "apply effects" ) )
155
+ . await ?;
153
156
154
157
let issue_reporter: Vc < Box < dyn IssueReporter > > =
155
158
Vc :: upcast ( ConsoleUi :: new ( TransientInstance :: new ( LogOptions {
@@ -270,26 +273,30 @@ async fn build_internal(
270
273
271
274
let origin = PlainResolveOrigin :: new ( asset_context, project_fs. root ( ) . join ( "_" . into ( ) ) ) ;
272
275
let project_dir = & project_dir;
273
- let entries = entry_requests
274
- . into_iter ( )
275
- . map ( |request_vc| async move {
276
- let ty = Value :: new ( ReferenceType :: Entry ( EntryReferenceSubType :: Undefined ) ) ;
277
- let request = request_vc. await ?;
278
- origin
279
- . resolve_asset ( request_vc, origin. resolve_options ( ty. clone ( ) ) , ty)
280
- . await ?
281
- . first_module ( )
282
- . await ?
283
- . with_context ( || {
284
- format ! (
285
- "Unable to resolve entry {} from directory {}." ,
286
- request. request( ) . unwrap( ) ,
287
- project_dir
288
- )
289
- } )
290
- } )
291
- . try_join ( )
292
- . await ?;
276
+ let entries = async move {
277
+ entry_requests
278
+ . into_iter ( )
279
+ . map ( |request_vc| async move {
280
+ let ty = Value :: new ( ReferenceType :: Entry ( EntryReferenceSubType :: Undefined ) ) ;
281
+ let request = request_vc. await ?;
282
+ origin
283
+ . resolve_asset ( request_vc, origin. resolve_options ( ty. clone ( ) ) , ty)
284
+ . await ?
285
+ . first_module ( )
286
+ . await ?
287
+ . with_context ( || {
288
+ format ! (
289
+ "Unable to resolve entry {} from directory {}." ,
290
+ request. request( ) . unwrap( ) ,
291
+ project_dir
292
+ )
293
+ } )
294
+ } )
295
+ . try_join ( )
296
+ . await
297
+ }
298
+ . instrument ( tracing:: info_span!( "resolve entries" ) )
299
+ . await ?;
293
300
294
301
let module_graph =
295
302
ModuleGraph :: from_modules ( Vc :: cell ( vec ! [ ChunkGroupEntry :: Entry ( entries. clone( ) ) ] ) ) ;
@@ -445,7 +452,11 @@ async fn build_internal(
445
452
446
453
let mut chunks: FxHashSet < ResolvedVc < Box < dyn OutputAsset > > > = FxHashSet :: default ( ) ;
447
454
for chunk_group in entry_chunk_groups {
448
- chunks. extend ( & * all_assets_from_entries ( * chunk_group) . await ?) ;
455
+ chunks. extend (
456
+ & * async move { all_assets_from_entries ( * chunk_group) . await }
457
+ . instrument ( tracing:: info_span!( "list chunks" ) )
458
+ . await ?,
459
+ ) ;
449
460
}
450
461
451
462
chunks
0 commit comments