LaurentTreguier / vscode-uncrustify

Code format using uncrustify
66 stars 10 forks source link

write EPIPE error on all releases AFTER 2.18.2 #61

Closed thomastech closed 4 years ago

thomastech commented 4 years ago

I'm getting write EPIPE error on releases AFTER 2.18.2. Debug mode reports an error, but the message is incomplete:

Debug: config file: d:\Lang\Arduino\Projects\Bubble_Machine\src\Bubbles\uncrustify.cfg
Debug: launched: C:/Users/Tom/AppData/Local/MetaPkg/uncrustify -l CPP -c d:\Lang\Arduino\Projects\Bubble_Machine\src\Bubbles\uncrustify.cfg
Debug: uncrustify exited with error: 

Please note that the error message is missing.

OS: Windows 10 Pro 64 Uncrustify Extension Version: Any version after 2.18.2 VS Code version 1.44.2

This problem appears to be similar to issue #59. But that ticket involved version 2.18.2, which is a version that is working for me.

I'm lost on how to make debug report the error(s). Long story short, I need assistance with solving the EPIPE error.

LaurentTreguier commented 4 years ago

I touched the handling of the uncrustify executable in the last version, that could be the reason this is happening. Where do you see that it's a write EPIPE error though ?

Edit: nevermind, I just tested and see the write EPIPE error

thomastech commented 4 years ago

@LaurentTreguier, Thanks for starting the investigation. Just to make sure we're dealing with the same situation, I see the write EPIPE error anytime I use uncrustify to format my VSCode .cpp source code. Uncrustify is assigned to Shift+Alt+F.

All uncrustify releases after 2.18.2 have the problem. Specifically these: 2.19.0 2.19.1 2.19.2 2.20.0

LaurentTreguier commented 4 years ago

I just realized what's hapening. I tried on Windows, on Linux, and got the same result. I found it very weird, since there have been multiple versions out, and I do check if things work every time, obviously. But I recently re-installed both my Windows and my Linux, and thus I didn't have uncrustify installed, so the extension tries to launch an uncrustify executable but the system can't find one, resulting in the NodeJS EPIPE error. Since version 2.19.0, I removed the automatic installation and handling of uncrustify, because the module I had made for this was a mess and very buggy. The solution to this issue should be to download the uncrustify binary for Windows and use the uncrustify.executablePath.windows configuration point to tell the extension where he binary is.

thomastech commented 4 years ago

Up until now I've let VSCode handle the extension installations. For this manual install I think I need a bit more instructions.

I found the my user directory for VSCode extensions and located the laurenttreguier.uncrustify-2.20.0 folder. But this folder does not have an uncrustify.exe binary in it. Regardless, I set the uncrustify.executablePath.windows to this folder, but no joy.

The link you provided is to old source code (last date Nov-27-2019). Searching further I found source code on the master branch, but not compiled code.

So I need some help finding the file(s) I need to manually copy.

LaurentTreguier commented 4 years ago

Ah, yes, there are no binaries in the Github releases, I should have checked that. They are on Sourceforge: https://sourceforge.net/projects/uncrustify/files/ The 64 bit build (https://sourceforge.net/projects/uncrustify/files/uncrustify-0.70.1/uncrustify-0.70.1_f-win64.zip/download) is probably the one you'll want, once you've extracted the executable, just set uncrustify.executablePath.windows to it and you should be good to go

thomastech commented 4 years ago

Thank You. The 0.70.1 version is now manually installed and working.

VSCode's Extensions tool says that the latest version is 2.20.0 that was released one month ago. But the latest sourceforge version is 0.70.1 released in Dec 2019. Is it really the latest version?

BTW, do you plan on restoring the "automatic" installation of uncrustify into VSCode Extensions? The manual installation workaround is functional, but I definitely miss the one-button click method.

LaurentTreguier commented 4 years ago

The version you see in VSCode is the version of the extension, which only makes a bridge between VSCode and uncrustify. Uncrustify, the actual tool, is at version 0.70.1; the 2.20.0 version is only for this VSCode extension. Regarding the automatic installation, I'm not planning on restoring it for now.

thomastech commented 4 years ago

Thanks for the help, this issue ticket is resolved. I'll close it.