stevearc/vim-arduino

:ArduinoVerify fails

descrip opened this issue · 2 comments

Hi! Just installed the plugin. My IDE is 1.8.13, Vim is at 8.1.1401, and my OS is Debian Buster. I coudn't get :ArduinoVerify to run --- it gives this error:

Picked up JAVA_TOOL_OPTIONS: 
Loading configuration...
Initializing packages...
Preparing boards...
Verifying...
java.io.IOException: No valid code files found
        at processing.app.Sketch.listSketchFiles(Sketch.java:117)
        at processing.app.Sketch.<init>(Sketch.java:54)
        at processing.app.Base.<init>(Base.java:423)
        at processing.app.Base.main(Base.java:150)

The command it's attempting to run is:

arduino --verify --board arduino:avr:mega:cpu=atmega2560 --port /dev/ttyACM0 --pref programmer=arduino:avrisp --pref build.path='/home/jeff/Arduino/RGB_LED/build' --verbose-upload '/home/jeff/Arduino/RGB_LED/RGB_LED.ino'

Looking at the :ArduinoVerify command, it seems that we can run with TERM being either :! or :terminal!. I should be using :terminal!. Running the command using :! $VERIFY_COMMAND works perfectly fine (and so does running it in a separate terminal). However, if I run :terminal! $VERIFY_COMMAND, it gives the same error.

Could something be wrong with how :terminal! is being used? Thanks!

I was able to reproduce this by using vim 8. Turns out that the quoting rules for a command passed to :terminal are not the same as for :!. See vim/vim#4288
This was causing us to send command arguments with a literal ' to the arduino command. Arduino couldn't find a file with a literal ', so it barfed.

Should be fixed in 1a4fd15

FWIW, I switched to Neovim over a year ago and it's fantastic. Would highly recommend 🙃

Wow, thanks for the quick fix! The command works after updating the plugin.

I decided to stay on Vim since it seemed more stable than shiny new Neovim. After seeing that bug, I'm having second thoughts...

Thanks again!