GithubHelp home page GithubHelp logo

ENOENT on emacs interlock files. about sane HOT 7 CLOSED

SohumB avatar SohumB commented on May 28, 2024
ENOENT on emacs interlock files.

from sane.

Comments (7)

amasad avatar amasad commented on May 28, 2024

Do you have concrete steps to repro on a OSX? (almost never used emacs)

from sane.

SohumB avatar SohumB commented on May 28, 2024

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.

amasad avatar amasad commented on May 28, 2024

Doesn't repro in OSX. Don't have a debian handy at the moment.
cc @wez is this a watcman KP?

from sane.

SohumB avatar SohumB commented on May 28, 2024

That's weird. stating 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.

amasad avatar amasad commented on May 28, 2024

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.

SohumB avatar SohumB commented on May 28, 2024

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.

wez avatar wez commented on May 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.