rewatch watch on Linux stops watching a source folder when an overlapping recursive source folder is removed from rescript.json
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- ocaml
- Lĩnh vực
- devtools
Hướng nghiên cứu
Start in rewatch/src/watcher.rs, especially compute_watch_paths and update_watches, and trace how overlapping paths are handled when the config changes. Check notify 5.2.0's Linux INotifyWatcher removal behavior described in the issue, then reproduce with the supplied Linux steps. Done means edits under src/retained are picked up after narrowing the source folders without restarting the watcher.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Found by adversarial experiments on semantic analysts.
What is broken
rescript watch registers each source folder as its own watch, and overlapping folders are allowed. Consider sources [{"dir": "src", "subdirs": true}, "src/retained"], which become ["src/retained"] after an edit to rescript.json. On Linux, edits under src/retained are no longer picked up afterwards.
compute_watch_pathsgivessrc(recursive) andsrc/retained(non-recursive) separate entries.- On a config change,
update_watches(called at L599) does three things:- it keeps
src/retainedas unchanged; - it calls
unwatchon the stalesrc; - it registers only the paths that are not kept.
- it keeps
- On Linux,
RecommendedWatcheris notify'sINotifyWatcher. In notify 5.2.0 (the version locked inrewatch/Cargo.lock), unwatching a recursive path removes every watched path that starts with it (src/inotify.rs,remove_watch, lines 518–541 of the crate). That includes the separately registeredsrc/retained. update_watchesstill listssrc/retainedas registered, so it is never re-registered. The package root watch is non-recursive and does not seesrc/retained/*.res.
macOS (FSEvents) keeps the child watch, and there the scenario below works. The Linux result follows from the notify code above; I have not run it on Linux.
Reproduction (Linux)
mkdir -p proj/src/retained && cd proj
echo '{"name":"proj","version":"0.0.0","dependencies":{"rescript":"13.0.0-alpha.7"}}' > package.json
cat > rescript.json <<'EOF'
{"name":"proj","sources":[{"dir":"src","subdirs":true},"src/retained"],
"package-specs":{"module":"esmodule","in-source":true},"suffix":".mjs"}
EOF
echo 'let x = 1' > src/retained/Demo.res
npm install && (npx rescript watch &) && sleep 3
sed -i 's|"sources":.*"src/retained"\],|"sources":["src/retained"],|' rescript.json; sleep 3
echo 'let x = 2' > src/retained/Demo.res; sleep 3
grep 'let x' src/retained/Demo.mjs
Expected: let x = 2;. Per the code above, on Linux Demo.mjs keeps let x = 1; until the watcher restarts.
Introduced by
fb85e7bf8 (#8730). Before it, a full rebuild unregistered every path and registered the complete new list.
Impact
Linux users who narrow an overlapping source configuration while rescript watch runs get silently stale output for the retained folder. One fix is to treat a kept watch as stale when an ancestor recursive watch is removed. Another is to re-register every kept path below a removed recursive path.
- Ngôn ngữ chính
- ReScript
- Star
- 7.5k
- Fork
- 483
- Merge trung bình
- 1 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 120
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rescript-lang/rescript
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
rescript-lang/rescript#8833 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
rescript-lang/rescript#8806 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
rescript-lang/rescript#8798 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 58/100
rescript-lang/rescript#8757 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 40/100
rescript-lang/rescript#8753 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của rescript-lang/rescript
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
FuRongJun-1999/dsh-memory#399 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:install bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
`inverse()` of a controlled `CUGate` drops the phase parameter γCó thể đã có người làm @rupasri118 đã nhận hôm nay. Đang mởbug mod: circuit
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Qiskit/qiskit#17223 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
frostney/known-good-route#129 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 2 ngày