Commit 805d758d authored by Luke Sandberg's avatar Luke Sandberg Committed by Benjamin Woodruff

Turbopack: fix filesystem watcher config not applying follow_symlinks(false) (#92631)

## Summary

- The notify `Config` uses a builder pattern where `with_follow_symlinks()` consumes `self` and returns a new `Config`, but the return value was being discarded — so `follow_symlinks` remained at its default (`true`).
- The `RecommendedWatcher` branch was also passing `Config::default()` instead of the configured `config` object, ignoring the config entirely.

## Test plan

- [x] `cargo check -p turbo-tasks-fs` passes
- Behavioral: symlinks under the watched root will now trigger events for the symlink itself rather than the target, matching the intent of the existing comment.

<!-- NEXT_JS_LLM_PR -->
parent 1056fae3
...@@ -380,13 +380,13 @@ impl DiskWatcher { ...@@ -380,13 +380,13 @@ impl DiskWatcher {
let config = Config::default(); let config = Config::default();
// we should track and invalidate each part of a symlink chain ourselves in // we should track and invalidate each part of a symlink chain ourselves in
// turbo-tasks-fs // turbo-tasks-fs
config.with_follow_symlinks(false); let config = config.with_follow_symlinks(false);
let mut notify_watcher = if let Some(poll_interval) = poll_interval { let mut notify_watcher = if let Some(poll_interval) = poll_interval {
let config = config.with_poll_interval(poll_interval); let config = config.with_poll_interval(poll_interval);
NotifyWatcher::Polling(PollWatcher::new(tx, config)?) NotifyWatcher::Polling(PollWatcher::new(tx, config)?)
} else { } else {
NotifyWatcher::Recommended(RecommendedWatcher::new(tx, Config::default())?) NotifyWatcher::Recommended(RecommendedWatcher::new(tx, config)?)
}; };
// TOCTOU: we must watch `root_path` before calling any invalidators and setting up the // TOCTOU: we must watch `root_path` before calling any invalidators and setting up the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment