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

flymake integration fails: can't create cache directory #1016

Closed
dankessler opened this issue May 21, 2020 · 3 comments
Closed

flymake integration fails: can't create cache directory #1016

dankessler opened this issue May 21, 2020 · 3 comments

Comments

@dankessler
Copy link

I was using ESS and thought I had flymake support but realized it never flagged any of my errors. After looking at the flymake log buffer, I noticed that lintr was falling down because it was trying to use the cache (as configured by default) but it was unable to create directory ~/.R/lintr_cache, which upon inspection was failing because `~/.R/ didn't exist. Manually creating that directory fixed things for me.

I'm able to reproduce this error in a totally clean install (running in a fresh Ubuntu 20.04 virtual machine with emacs 26 and ESS 18.10.2 downloaded from the website). Here's the *Flymake log* buffer showing the error; again, manually creating the ~/.R directory resolves the problem.

Warning [flymake tmp.R]: Disabling backend flymake-proc-legacy-flymake because (error Can’t f\
ind a suitable init function)                                                                 
Warning [flymake  *ess-r-flymake*]:  Error in cat("@@warning: @@", e) :                       
  argument 2 (type ’list’) cannot be handled by ’cat’                                         
Calls: esslint ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> -> cat              
In addition: Warning messages:                                                                
1: In normalizePath(filename) : path[1]="": No such file or directory                         
2: In file(con, "r") :                                                                        
  file("") only supports open = "w+" and open = "w+b": using the former                       
3: In file(con, "r") :                                                                        
  file("") only supports open = "w+" and open = "w+b": using the former                       
4: In file(con, "r") :                                                                        
  file("") only supports open = "w+" and open = "w+b": using the former                       
5: In dir.create(path) :                                                                      
  cannot create dir ’/home/vagrant/.R/lintr_cache’, reason ’No such file or directory’        
6: In gzfile(file, "wb") :                                                                    
  cannot open compressed file ’/home/vagrant/.R/lintr_cache/0a98ec3dda8b45e229da9bedc338e27d0\
0c42383’, probable reason ’No such file or directory’                                     

Since the default is to use the cache, it seems like a simple fix would be to either create the ~/.R directory if it doesn't exist. Alternatively, I could report this as an issue to the lintr maintainers and suggest that they use the recursive flag when they call dir.create in R when trying to create the cache.

Thanks for an amazing package; I can't imagine working on R code without ESS!

@dankessler
Copy link
Author

I've opened a PR to lintr that I think will correct this problem

@jabranham
Copy link
Contributor

Thanks for reporting back!

@dankessler
Copy link
Author

I'm not sure how often lintr's master branch makes it way onto CRAN, but my PR which fixes this issue was merged and so I'm going to go ahead and close this issue since it can be resolved (for now) by using the development version of lintr and (eventually) when this commit makes its way into the release on CRAN.

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

2 participants