Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emacs working files are being crawled and causing rebuild failures #3908

Closed
tim-evans opened this issue Apr 15, 2015 · 6 comments
Closed

emacs working files are being crawled and causing rebuild failures #3908

tim-evans opened this issue Apr 15, 2015 · 6 comments

Comments

@tim-evans
Copy link
Contributor

An example filename is: templates/artwork/.#index.hbs

This is a pain point that I've been living with so long that I've forgotten to actually complain about it enough.

@rwjblue
Copy link
Member

rwjblue commented Apr 15, 2015

Emacs makes broken symlinks on purpose (which is kinda crazy) to prevent two instances of Emacs from editing the same file, but a similar issue occurs in Vim (swp files trigger a rebuild in the default configuration).

The solution for now, is to configure Emacs to disable interlocking and save its backup/swap files outside of the project root. The following should do that for you:

;; disable lockfiles
;; see http://www.gnu.org/software/emacs/manual/html_node/emacs/Interlocking.html
(setq create-lockfiles nil)

;; store all backup files in the tmp dir
;; http://www.gnu.org/software/emacs/manual/html_node/emacs/Backup-Names.html
(setq backup-directory-alist
      `((".*" . ,temporary-file-directory)))

;; store all autosave files in the tmp dir
;; http://www.gnu.org/software/emacs/manual/html_node/emacs/Auto-Save-Files.html
(setq auto-save-file-name-transforms
      `((".*" ,temporary-file-directory t)))

;; autosave the undo-tree history
(setq undo-tree-history-directory-alist
      `((".*" . ,temporary-file-directory)))
(setq undo-tree-auto-save-history t)

@stefanpenner
Copy link
Contributor

I though broccoli-sane-watcher filtered these out. If not I suspect it could?

@tim-evans
Copy link
Contributor Author

@rwjblue good to know. The ember-cli website seems to have that info now, which is great. It'd definitely be more awesome for broccoli to handle this case with aplomb, but alas.

@stefanpenner
Copy link
Contributor

we do filter some of these files already https://github.com/krisselden/broccoli-sane-watcher/blob/master/index.js#L9-L11

do the broken symlinks not match that, if not can we make it? I am not an emacs users, so I really have no idea :P

@rwjblue
Copy link
Member

rwjblue commented Apr 15, 2015

That prevents an annoying rebuild (which is nice but not the issue here), eventually when the "real" file changes and triggers a rebuild these Emacs symlinks are still present and cause the issue that is reported. Basically, any broken symlink in our trees will potentially throw errors.

IMHO, writing intentionally broken symlinks (which is what Emacs is doing) is completely crazy. I suggest disabling the interlock files as described in my initial comment (and apparently on the website).

@stefanpenner
Copy link
Contributor

IMHO, writing intentionally broken symlinks (which is what Emacs is doing) is completely crazy. I suggest disabling the interlock files as described in my initial comment (and apparently on the website).

ah understood.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants