Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
33e06793
Commit
33e06793
authored
Oct 22, 2025
by
Benjamin Woodruff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update turbopack-cli for benchmarking
parent
d6d16414
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
16 deletions
+41
-16
mod.rs
turbopack/crates/turbopack-cli/src/build/mod.rs
+21
-6
mod.rs
turbopack/crates/turbopack-cli/src/dev/mod.rs
+17
-7
lib.rs
turbopack/crates/turbopack-dev-server/src/lib.rs
+3
-3
No files found.
turbopack/crates/turbopack-cli/src/build/mod.rs
View file @
33e06793
...
...
@@ -2,14 +2,16 @@ use std::{
env
::
current_dir
,
mem
::
forget
,
path
::{
MAIN_SEPARATOR
,
PathBuf
},
sync
::
Arc
,
sync
::
LazyLock
,
};
use
anyhow
::{
Context
,
Result
,
bail
};
use
rustc_hash
::
FxHashSet
;
use
tracing
::
Instrument
;
use
turbo_rcstr
::
RcStr
;
use
turbo_tasks
::{
ResolvedVc
,
TransientInstance
,
TryJoinIterExt
,
TurboTasks
,
Vc
,
apply_effects
};
use
turbo_tasks
::{
ResolvedVc
,
StaticOrArc
,
TransientInstance
,
TryJoinIterExt
,
TurboTasks
,
Vc
,
apply_effects
,
};
use
turbo_tasks_backend
::{
BackendOptions
,
NoopBackingStorage
,
TurboTasksBackend
,
noop_backing_storage
,
};
...
...
@@ -60,7 +62,7 @@ use crate::{
type
Backend
=
TurboTasksBackend
<
NoopBackingStorage
>
;
pub
struct
TurbopackBuildBuilder
{
turbo_tasks
:
Arc
<
TurboTasks
<
Backend
>>
,
turbo_tasks
:
StaticOr
Arc
<
TurboTasks
<
Backend
>>
,
project_dir
:
RcStr
,
root_dir
:
RcStr
,
entry_requests
:
Vec
<
EntryRequest
>
,
...
...
@@ -75,7 +77,11 @@ pub struct TurbopackBuildBuilder {
}
impl
TurbopackBuildBuilder
{
pub
fn
new
(
turbo_tasks
:
Arc
<
TurboTasks
<
Backend
>>
,
project_dir
:
RcStr
,
root_dir
:
RcStr
)
->
Self
{
pub
fn
new
(
turbo_tasks
:
StaticOrArc
<
TurboTasks
<
Backend
>>
,
project_dir
:
RcStr
,
root_dir
:
RcStr
,
)
->
Self
{
TurbopackBuildBuilder
{
turbo_tasks
,
project_dir
,
...
...
@@ -529,14 +535,23 @@ pub async fn build(args: &BuildArguments) -> Result<()> {
root_dir
,
}
=
normalize_dirs
(
&
args
.common.dir
,
&
args
.common.root
)
?
;
let
tt
=
TurboTasks
::
new
(
TurboTasksBackend
::
new
(
static
TURBO_TASKS_STATIC
:
LazyLock
<
bool
>
=
LazyLock
::
new
(||
std
::
env
::
var
(
"NEXT_TURBO_TASKS_STATIC"
)
.unwrap
()
==
"1"
);
let
backend
=
TurboTasksBackend
::
new
(
BackendOptions
{
dependency_tracking
:
false
,
storage_mode
:
None
,
..
Default
::
default
()
},
noop_backing_storage
(),
));
);
let
tt
=
if
*
TURBO_TASKS_STATIC
{
println!
(
"Using static turbo tasks"
);
StaticOrArc
::
Static
(
TurboTasks
::
new_static
(
backend
))
}
else
{
println!
(
"Using refcounted turbo tasks"
);
StaticOrArc
::
Shared
(
TurboTasks
::
new
(
backend
))
};
let
mut
builder
=
TurbopackBuildBuilder
::
new
(
tt
.clone
(),
project_dir
,
root_dir
)
.log_detail
(
args
.common.log_detail
)
...
...
turbopack/crates/turbopack-cli/src/dev/mod.rs
View file @
33e06793
...
...
@@ -4,7 +4,7 @@ use std::{
io
::{
Write
,
stdout
},
net
::{
IpAddr
,
SocketAddr
},
path
::{
MAIN_SEPARATOR
,
PathBuf
},
sync
::
Arc
,
sync
::
{
Arc
,
LazyLock
}
,
time
::{
Duration
,
Instant
},
};
...
...
@@ -13,7 +13,8 @@ use owo_colors::OwoColorize;
use
rustc_hash
::
FxHashSet
;
use
turbo_rcstr
::{
RcStr
,
rcstr
};
use
turbo_tasks
::{
NonLocalValue
,
OperationVc
,
ResolvedVc
,
TransientInstance
,
TurboTasks
,
UpdateInfo
,
Vc
,
NonLocalValue
,
OperationVc
,
ResolvedVc
,
StaticOrArc
,
TransientInstance
,
TurboTasks
,
UpdateInfo
,
Vc
,
trace
::
TraceRawVcs
,
util
::{
FormatBytes
,
FormatDuration
},
};
...
...
@@ -57,7 +58,7 @@ pub(crate) mod web_entry_source;
type
Backend
=
TurboTasksBackend
<
NoopBackingStorage
>
;
pub
struct
TurbopackDevServerBuilder
{
turbo_tasks
:
Arc
<
TurboTasks
<
Backend
>>
,
turbo_tasks
:
StaticOr
Arc
<
TurboTasks
<
Backend
>>
,
project_dir
:
RcStr
,
root_dir
:
RcStr
,
entry_requests
:
Vec
<
EntryRequest
>
,
...
...
@@ -74,7 +75,7 @@ pub struct TurbopackDevServerBuilder {
impl
TurbopackDevServerBuilder
{
pub
fn
new
(
turbo_tasks
:
Arc
<
TurboTasks
<
Backend
>>
,
turbo_tasks
:
StaticOr
Arc
<
TurboTasks
<
Backend
>>
,
project_dir
:
RcStr
,
root_dir
:
RcStr
,
)
->
TurbopackDevServerBuilder
{
...
...
@@ -246,7 +247,7 @@ impl TurbopackDevServerBuilder {
};
let
issue_reporter_arc
=
Arc
::
new
(
move
||
issue_provider
.get_issue_reporter
());
Ok
(
server
.serve
(
tasks
,
source
,
issue_reporter_arc
))
Ok
(
server
.serve
(
tasks
.as_api
()
,
source
,
issue_reporter_arc
))
}
}
...
...
@@ -369,13 +370,22 @@ pub async fn start_server(args: &DevArguments) -> Result<()> {
root_dir
,
}
=
normalize_dirs
(
&
args
.common.dir
,
&
args
.common.root
)
?
;
let
tt
=
TurboTasks
::
new
(
TurboTasksBackend
::
new
(
static
TURBO_TASKS_STATIC
:
LazyLock
<
bool
>
=
LazyLock
::
new
(||
std
::
env
::
var
(
"NEXT_TURBO_TASKS_STATIC"
)
.unwrap
()
==
"1"
);
let
backend
=
TurboTasksBackend
::
new
(
BackendOptions
{
storage_mode
:
None
,
..
Default
::
default
()
},
noop_backing_storage
(),
));
);
let
tt
=
if
*
TURBO_TASKS_STATIC
{
println!
(
"Using static turbo tasks"
);
StaticOrArc
::
Static
(
TurboTasks
::
new_static
(
backend
))
}
else
{
println!
(
"Using refcounted turbo tasks"
);
StaticOrArc
::
Shared
(
TurboTasks
::
new
(
backend
))
};
let
tt_clone
=
tt
.clone
();
...
...
turbopack/crates/turbopack-dev-server/src/lib.rs
View file @
33e06793
...
...
@@ -115,7 +115,7 @@ impl DevServer {
impl
DevServerBuilder
{
pub
fn
serve
(
self
,
turbo_tasks
:
Arc
<
dyn
TurboTasksApi
>
,
turbo_tasks
:
StaticOr
Arc
<
dyn
TurboTasksApi
>
,
source_provider
:
impl
SourceProvider
+
NonLocalValue
+
TraceRawVcs
+
Sync
,
get_issue_reporter
:
Arc
<
dyn
Fn
()
->
Vc
<
Box
<
dyn
IssueReporter
>>
+
Send
+
Sync
>
,
)
->
DevServer
{
...
...
@@ -172,7 +172,7 @@ impl DevServerBuilder {
method
:
request
.method
()
.clone
(),
uri
:
request
.uri
()
.clone
(),
};
run_once_with_reason
(
StaticOrArc
::
Shared
(
tt
.clone
()
),
reason
,
async
move
{
run_once_with_reason
(
tt
.clone
(
),
reason
,
async
move
{
// TODO: `get_issue_reporter` should be an `OperationVc`, as there's a
// risk it could be a task-local Vc, which is not safe for us to await.
let
issue_reporter
=
get_issue_reporter
();
...
...
@@ -253,7 +253,7 @@ impl DevServerBuilder {
}
if
!
side_effects
.is_empty
()
{
let
join_handle
=
tokio
::
spawn
(
run_once_with_reason
(
StaticOrArc
::
Shared
(
tt
.clone
()
),
tt
.clone
(
),
side_effects_reason
,
async
move
{
for
side_effect
in
side_effects
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment