AgilionApps / remix

Automatic recompilation of mix code on file change.
Other
148 stars 28 forks source link

Exceptions with editing in Spacemacs #8

Open insiderq opened 8 years ago

insiderq commented 8 years ago

When i work in spacemacs it creates an .#name.ex files for all unsaved changes and i've got this error constantly in my console

14:32:32.189 [error] GenServer Remix.Worker terminating ** (File.Error) could not read file stats lib/.#controller_user.ex: no such file or directory (elixir) lib/file.ex:288: File.stat!/2 (remix) lib/remix.ex:62: Remix.Worker.get_current_mtime/3 (remix) lib/remix.ex:31: Remix.Worker.handle_info/2 (stdlib) gen_server.erl:615: :gen_server.try_dispatch/4 (stdlib) gen_server.erl:681: :gen_server.handle_msg/5 (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3 Last message: :poll_and_reload State: %Remix.Worker.State{last_mtime: nil}

Any ideas how i can fix this on my side?

alanpeabody commented 8 years ago

I don't unfortunately (not an emacs user), @totallymike do you have any ideas?

insiderq commented 8 years ago

Do not compile .#filename.ex ? Can it affect regular remix usage cases?

totallymike commented 8 years ago

This is a fairly common issue with auto-rebuild-type tools, as it turns out. We may wish to eventually tie remix to the .gitignore, or allow for some patterns to exclude certain files.

totallymike commented 8 years ago

@insiderq for a temporary workaround, I typically just disable lockfiles, as I usually only have one instance of Emacs open at a time. You can either add (setq create-lockfiles nil) to your init file, or disable it through the customization interface.

If disabling lockfiles bums you out, you could also do it through a .dir-locals.el file, which would allow you to just disable the lockfiles for a given project.

insiderq commented 8 years ago

Looks good, thx

formido commented 8 years ago

This can be fixed by only scanning for "regular" files. For example :filelib:fold_files/5 folds only over regular files in a directory or File.regular?/1 tests whether a file is regular. .#filename.ex is a link, so non-regular.