Comments (7)
Do you have concrete steps to repro on a OSX? (almost never used emacs)
from sane.
On my debian system on ext4, simply running ln -s nonexistent file
in a directory sane
is watching triggers the bug, given that there is no file called nonexistent
in that directory, of course.
from sane.
Doesn't repro in OSX. Don't have a debian handy at the moment.
cc @wez is this a watcman KP?
from sane.
That's weird. stat
ing a symlink to a nonexistent file doesn't error on osx? I wasn't expecting there to be an OS difference here; that seems like the only sensible answer for the filesystem to provide....
I can tell you this patch fixes the bug, but I don't know what any further consequences are of doing it:
diff --git a/src/watchman_watcher.js b/src/watchman_watcher.js
index 14e3d61..e8d61a1 100644
--- a/src/watchman_watcher.js
+++ b/src/watchman_watcher.js
@@ -124,7 +124,8 @@ WatchmanWatcher.prototype.handleFileChange = function(changeDescriptor) {
self.emitEvent(DELETE_EVENT, changeDescriptor.name, self.root);
} else {
fs.stat(absPath, function(error, stat) {
- if (handleError(self, error)) {
+ if (error) {
+ self.emitEvent(DELETE_EVENT, changeDescriptor.name, self.root);
return;
}
from sane.
This diff makes me think it's a watchman bug. It means that watchman is not setting the exists
flag to false for this file.
Can you please try reproducing with watchman? I'm happy to work around it but we need to report it.
from sane.
I guess technically the symlink does exist, is why? At least in the manual ln -s nonexistent file
case; now I'm wondering if this is somehow a different case from emacs deleting its interlock files...
I'll try repro-ing once I figure out how to use watchman directly :p
from sane.
Watchman doesn't care what the symlink points to. It will report .#menus-test.js
as existing because it exists in the filesystem even if the target of the symlink doesn't exist. I think you should switch to fs.lstat
instead of fs.stat
so that you don't try to follow symlinks.
from sane.
Related Issues (20)
- add utilize to "autodetect" best watcher.
- bump engine support to node version that are supported.
- bump engine support to node version that are supported.
- Update exec-sh dependency HOT 5
- Invalid tag name "[email protected]": Tags may not have any characters that encodeURIComponent encodes. HOT 1
- Why the [email protected] don't support node 9.*.* HOT 2
- Watching file recursively HOT 6
- Bundle size
- Renaming directories with childs on windows locked HOT 1
- Watchman does not understand micromatch globs HOT 9
- Multiple package locks HOT 1
- Support for more Node.js versions HOT 1
- Is there support for killing the currently running process? HOT 1
- Consider dropping `node@6`. HOT 2
- upgrade to v ^4.x.x of micromatch to avoid npm vulnerability 1490 in kind-of
- OS Command Injection in execa (execa@^1.0.0) HOT 4
- High severity vulnerability detected in sane dependencies HOT 1
- High Vulnerability is found in the dependency. HOT 1
- EMFILE: too many open files, watch HOT 1
- minimist <= 1.2.5 have an vulnerability
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sane.