Skip to content

Commit 43e777a

Browse files
committed
feat: Remove daemon from turbo run, deprecate daemon flags and config
The daemon provided no measurable performance benefit for turbo run and added IPC overhead. Benchmarks across multiple repos showed --no-daemon consistently matching or beating daemon mode. The daemon is still used by turbo watch and the Turborepo LSP. The --daemon, --no-daemon flags and the daemon turbo.json option are deprecated and will be removed in version 3.0.
1 parent 9f36363 commit 43e777a

File tree

34 files changed

+116
-407
lines changed

34 files changed

+116
-407
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ devturbo run build --skip-infer
127127
A non-exhaustive list of things to check on:
128128

129129
- Features related to your changes
130-
- Test with and without daemon
130+
- Test with and without daemon (daemon is deprecated for `turbo run` but still used by `turbo watch`)
131131
- Installation scenarios
132132
- Global only. `turbo` is installed as global binary without a local `turbo` in repository.
133133
- Local only. `turbo` is installed as local binary without global `turbo` in PATH. `turbo` is invoked via a root package

Cargo.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/docs/content/docs/reference/configuration.mdx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -168,20 +168,9 @@ Specify the filesystem cache directory.
168168

169169
### `daemon`
170170

171-
Default: `true`
172-
173-
Turborepo runs a background process to pre-calculate some expensive operations. This standalone process (daemon) is a performance optimization, and not required for proper functioning of `turbo`.
171+
**Deprecated**: The daemon is no longer used for `turbo run` and this option will be removed in version 3.0. The `--daemon` and `--no-daemon` flags are also deprecated.
174172

175-
```jsonc title="./turbo.json"
176-
{
177-
"daemon": true,
178-
}
179-
```
180-
181-
<Callout type="info">
182-
When running in a CI environment the daemon is always disabled regardless of
183-
this setting.
184-
</Callout>
173+
The daemon is still used by `turbo watch` and the Turborepo LSP.
185174

186175
### `envMode`
187176

apps/docs/content/docs/reference/options-overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,6 @@ The three strategies listed above are in order of precedence. Where a flag value
121121
| ---------------------- | -------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
122122
| Binary path | - | [`TURBO_BINARY_PATH`](/docs/reference/system-environment-variables#turbo_binary_path) | - |
123123
| Download local `turbo` | - | [`TURBO_DOWNLOAD_LOCAL_ENABLED`](/docs/reference/system-environment-variables#turbo_download_local_enabled) | - |
124-
| Daemon | [`--daemon` / `--no-daemon`](/docs/reference/run#--daemon-and---no-daemon) | - | [`daemon`](/docs/reference/configuration#daemon) |
124+
| Daemon (deprecated) | [`--daemon` / `--no-daemon`](/docs/reference/run#--daemon-and---no-daemon) | - | [`daemon`](/docs/reference/configuration#daemon) |
125125

126126
</div>

apps/docs/content/docs/reference/run.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,11 +415,9 @@ turbo run dev --no-cache
415415
416416
### `--daemon` and `--no-daemon`
417417
418-
`turbo` can run a background process to pre-calculate values used for determining work that needs to be done. This standalone process (daemon) is an optimization, and not required for proper functioning of `turbo`.
418+
**Deprecated**: The daemon is no longer used for `turbo run`. These flags are ignored and will be removed in version 3.0.
419419
420-
The default daemon usage is set for your repository using [the `daemon` field in `turbo.json`](/docs/reference/configuration#daemon). Passing `--daemon` requires `turbo` to use the standalone process, while `--no-daemon` instructs `turbo` to avoid using or creating the standalone process.
421-
422-
The same behavior can also be set via the `TURBO_DAEMON=true` system variable.
420+
The daemon is still used by `turbo watch` and the Turborepo LSP.
423421
424422
### `--output-logs <option>`
425423

apps/docs/content/docs/reference/scan.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ turbo scan
1515
You'll be taken through a short series of steps to enable the fastest settings for your Turborepo. These optimizations include:
1616

1717
- **Git FS Monitor**: `turbo` leans on Git to do file change discovery. Since we have to wait for `git` to tell us about changes, we can use [Git's built-in filesystem monitor](https://git-scm.com/docs/git-fsmonitor--daemon) to get those notifications sooner.
18-
- **Turborepo Daemon**: Turborepo's daemon optimistically understands your repository in the background. By doing shared, common work that `turbo` will need to do when running tasks beforehand, `turbo` will run your tasks faster.
18+
- **Turborepo Daemon** (deprecated for `turbo run`): Turborepo's daemon is no longer used for `turbo run`. It is still used by `turbo watch` and the Turborepo LSP.
1919
- **Remote Caching**: While Turborepo can cache your work locally, it can also share a cache across all of your machines. Enabling [Remote Caching](/docs/core-concepts/remote-caching) makes your caching **multiplayer**, ensuring that you, your teammates, and your CI machines, never do the same work twice.
2020
- **Check `turbo` version**: We're always working towards making `turbo` better. To ensure you are using the latest version of Turborepo, we'll check your version and remind you to install `latest` if you aren't using it yet.
2121
- **Check for Turborepo LSP**:

crates/turborepo-config/src/lib.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -342,16 +342,15 @@ impl ConfigurationOptions {
342342
}
343343

344344
pub fn daemon(&self) -> Option<bool> {
345-
// hardcode to off in CI
346-
if turborepo_ci::is_ci() {
347-
if Some(true) == self.daemon {
348-
debug!("Ignoring daemon setting and disabling the daemon because we're in CI");
349-
}
350-
351-
return Some(false);
345+
// The daemon is no longer used for `turbo run`. Always return None
346+
// (no daemon preference) regardless of configuration.
347+
if self.daemon.is_some() {
348+
tracing::warn!(
349+
"the `daemon` configuration option is deprecated and will be removed in version \
350+
3.0. The daemon is no longer used for `turbo run`."
351+
);
352352
}
353-
354-
self.daemon
353+
None
355354
}
356355

357356
pub fn env_mode(&self) -> EnvMode {

crates/turborepo-config/src/turbo_json.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,10 @@ mod test {
135135

136136
let reader = TurboJsonReader::new(repo_root);
137137
let config = reader.get_configuration_options(&existing_config).unwrap();
138-
// Make sure we read the default turbo.json
139-
assert_eq!(config.daemon(), Some(false));
138+
// The raw field is populated from turbo.json
139+
assert_eq!(config.daemon, Some(false));
140+
// But the getter always returns None since daemon is deprecated for turbo run
141+
assert_eq!(config.daemon(), None);
140142
}
141143

142144
#[test]
@@ -165,8 +167,10 @@ mod test {
165167

166168
let reader = TurboJsonReader::new(repo_root);
167169
let config = reader.get_configuration_options(&existing_config).unwrap();
168-
// Make sure we read the correct turbo.json
169-
assert_eq!(config.daemon(), Some(false));
170+
// The raw field is populated from the custom turbo.json path
171+
assert_eq!(config.daemon, Some(false));
172+
// But the getter always returns None since daemon is deprecated for turbo run
173+
assert_eq!(config.daemon(), None);
170174
}
171175

172176
#[test]

crates/turborepo-lib/Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@ license = "MIT"
77
[features]
88
# Allows configuring a specific tls backend for reqwest.
99
# See top level Cargo.toml for more details.
10-
default = ["rustls-tls", "daemon-package-discovery"]
10+
default = ["rustls-tls"]
1111
native-tls = ["turborepo-api-client/native-tls", "turbo-updater/native-tls"]
1212
rustls-tls = ["turborepo-api-client/rustls-tls", "turbo-updater/rustls-tls"]
1313

14-
daemon-package-discovery = []
15-
daemon-file-hashing = []
16-
1714
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1815
[dev-dependencies]
1916
anyhow = { workspace = true, features = ["backtrace"] }

crates/turborepo-lib/src/cli/mod.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,18 @@ impl Args {
356356
version. Use --cache=local:rw,remote:r"
357357
);
358358
}
359+
if run_args.daemon {
360+
warn!(
361+
"--daemon is deprecated and will be removed in version 3.0. The daemon is no \
362+
longer used for `turbo run`."
363+
);
364+
}
365+
if run_args.no_daemon {
366+
warn!(
367+
"--no-daemon is deprecated and will be removed in version 3.0. The daemon is \
368+
no longer used for `turbo run`."
369+
);
370+
}
359371
}
360372

361373
clap_args
@@ -991,13 +1003,13 @@ pub struct RunArgs {
9911003
// clap does not have negation flags such as --daemon and --no-daemon
9921004
// so we need to use a group to enforce that only one of them is set.
9931005
// -----------------------
994-
/// Force turbo to use the local daemon. If unset
995-
/// turbo will use the default detection logic.
1006+
/// [DEPRECATED] The daemon is no longer used for `turbo run`.
1007+
/// This flag will be removed in version 3.0.
9961008
#[clap(long, group = "daemon-group")]
9971009
pub daemon: bool,
9981010

999-
/// Force turbo to not use the local daemon. If unset
1000-
/// turbo will use the default detection logic.
1011+
/// [DEPRECATED] The daemon is no longer used for `turbo run`.
1012+
/// This flag will be removed in version 3.0.
10011013
#[clap(long, group = "daemon-group")]
10021014
pub no_daemon: bool,
10031015

0 commit comments

Comments
 (0)