-
-
Notifications
You must be signed in to change notification settings - Fork 180
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
NoSuchFileException related to Intellij __jb_tmp__ safe write files #471
Comments
|
Example project with error below.
|
It appears that the exception is thrown in every boot process (e.g. I have |
This is still occuring for me. The exception is slightly different though. Related problem?
|
@kennyjwilli thanks for reporting!
|
I'm struggling to get it to reproduce outside of our large CLJS project. We have a project with 50+ CLJS namespaces and occasionally while recompiling, that error is thrown. That project takes 2s or more to compile compared to the 0.2s the boot-files-issue repo takes. I'll take a look at Boot's code to see if this is an easy fix. |
It seems to happen if there are rapid file changes while it is compiling the CLJS. |
It seems like these files are created from IntelliJ's "safe write" feature: https://stackoverflow.com/questions/23271895/temporary-jb-old-file-in-phpstorm-and-webstorm-causing-errors. |
Disabling "safe write" fixes the issue. It's tough to debug when I can't get the Cursive debugger to break on the It's also interesting that I can only reliably reproduce the error when a CLJS REPL is running. |
Best guess at what is happening:
This is a race condition which would explain why it only happens occasionally. |
I have added the regex |
There’s an outstanding PR (which will be part of the next release) that makes bootignore behavior more consistent: #663 You could try merging those changes and rebuilding boot locally to see if that makes bootignore work as expected. I’m also wondering if there are ways to make IntelliJ write those files elsewhere? I roughly remember similar issues related to emacs storing temporary files in watched directories. (I think there’s some stuff in the wiki about this, will update with a link later.) |
It seems there are other people also having issues with IntelliJ's safe write feature: cgrand/enlive#143 — the universal solution seems to be disabling safe write 😏 |
@kennyjwilli I updated the name if this ticket, feel free to change if you feel this does not accurately reflect the nature of this problem. |
Rereading #663 it seems that this won't affect the issue at hand since |
Ideas for changes that could help future users avoid this kind of trouble:
|
I have the same problem using Spacemacs:
|
Whilst waiting for this problem to go away I did this hack: (require 'boot.filesystem)
(in-ns 'boot.filesystem)
(let [mkvisitor-0 mkvisitor]
(defn mkvisitor [^Path root tree & {:keys [ignore]}]
(let [^SimpleFileVisitor v0 (mkvisitor-0 root tree :ignore ignore)]
(proxy [SimpleFileVisitor] []
(postVisitDirectory [t e] (.postVisitDirectory v0 t e))
(preVisitDirectory [path attr] (.preVisitDirectory v0 path attr))
(visitFile [path attr] (.visitFile v0 path attr))
(visitFileFailed [path exc] FileVisitResult/CONTINUE)))))
(in-ns 'boot.user) This appears to make this class of issue go away for me. |
I seem to be inconsistently getting this error when writing the target dirs after a reload. It goes away if I restart my boot process.
From the discussion on #boot on Slack it seems the
__jb_tmp__
is an IntelliJ file that is semi-atomically created (usingSafeFileOutputStream
according to cfleming).The text was updated successfully, but these errors were encountered: