-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Code formatting does not work in the latest version of libtinfo #3174
Comments
We redistribute clang-format (we do not compile it). Are you able to run it directly in your terminal window? |
Does LLVM distribute a version of clang-format that works for you without installing libtinfo5? |
@joeljosephreji ...as in, do newer versions (or the Ubuntu 18 one) at http://releases.llvm.org/download.html that work for you? I believe we ship the Ubuntu 14 version (or maybe the 16 one?), so we might need to ship additional ones. |
I have the same issue running similar specs to OP except regular Ubuntu 18.10 Here is my output when I try to format the code using VSCode. Formatting failed:
/home/jorge/.vscode/extensions/ms-vscode.cpptools-0.21.0/bin/../LLVM/bin/clang-format -style={BasedOnStyle: Google, ColumnLimit: 70} -fallback-style=LLVM -assume-filename=/home/jorge/Programming/testing/fishy/main.cpp
/home/jorge/.vscode/extensions/ms-vscode.cpptools-0.21.0/bin/../LLVM/bin/clang-format: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory When running from the command line:
As a work around I instsalled sudo apt install clang-format and then figured out where it lived in my system which clang-format
# outputs: /usr/bin/clang-format and used that output for the value in my {
"C_Cpp.clang_format_path": "/usr/bin/clang-format"
} and everything seemed dandy! |
That is strange because we have tested on Ubuntu 18 and formatting works for us. I ran ldd on the latest Ubuntu 18 clang 7 and it still has the libtinfo.so.5 dependency. Can you run "/usr/bin/clang-format --version" and "ldd /usr/bin/clang-format" to see what version it is and what libtinfo.so dependency it has? |
$ /usr/bin/clang-format --version
clang-format version 7.0.0-3 (tags/RELEASE_700/final)
$ ldd /usr/bin/clang-format
linux-vdso.so.1 (0x00007ffda8bf9000)
libLLVM-7.so.1 => /usr/lib/x86_64-linux-gnu/libLLVM-7.so.1 (0x00007fc3d192a000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fc3d17a0000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc3d15b6000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007fc3d13ae000)
libedit.so.2 => /usr/lib/x86_64-linux-gnu/libedit.so.2 (0x00007fc3d1176000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fc3d0f59000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fc3d0f4d000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc3d0f47000)
libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007fc3d0d1c000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc3d0cfb000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fc3d0b6e000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fc3d0b54000)
/lib64/ld-linux-x86-64.so.2 (0x00007fc3d59ad000)
|
@penguingovernor Okay -- we tested with Ubuntu 18.04 and not 18.10 -- the binary we ship appears to be incompatible with that OS, so the workaround you did is the recommended course until we can get an alternative binary. |
I haven't tried terminal editing and the formatting worked without the clang-format package installed |
I don't have clang-format package installed |
I haven't tried out clang-format in my terminal at all. I have to check it out. When I did an |
Cool, so I guess from the looks of things |
@joeljosephreji Yes, this is a breaking incompatibility change with Ubuntu 18.10 -- I don't know if that is "by design" or a bug with the OS. Ubuntu 18.10 itself distributes a specially compiled clang-format 7 with the libtinfo6 dependency, which is not available from the pre-built binaries on the LLVM download site. Ubuntu 18.04 doesn't have this issue. Until we can ship a special version for Ubuntu 18.10, users will have to manually install clang-format and set our C_Cpp.clang_format_path to reference that. |
Or the issue can be resolved by just installing |
As i said in another similar issue, if you have libtinfo.so.6 you can create a simple system link instead of downloading new packages. Here's how! |
I see that folks are talking about clang/LLVM with regard to libtinfo, but out of curiosity I did a "pacman -Qo /usr/lib/libtinfo.so.6" (not .5 since it didn't exist) and I see it is owned by ncurses. I found it really odd that only now have I just encountered this issue. Maybe I should just move over to clang and be done with gcc. But yeah, after ln so.5 to so.6, formatting worked right away. I see on my old OS partition, I already had that link and found the owner for that linkage is ncurses5-compat-libs which looks to only be available in the AUR. |
Here is another workaround: I have also tried 'sudo link /lib/libtinfo.so.6 /lib/libtinfo.so.5' (same as #GiuseppeCesarano suggested above). I have installed clang-format and friends, as described in the clang site Then, following the path in the error report:
This works (Ubuntu 19.10). It calls the installed clang-format and relies on the integrity of its installation. |
Could we make this default, and the shipped version as a fallback? |
In Manjaro Linux the solution I found is similar. Installing clang-format:
And then editing |
Our Insiders release fixes the clang-format dependency problems: https://github.com/microsoft/vscode-cpptools/releases/tag/0.27.0-insiders |
0.27.0-insiders (accidentally) didn't have the new clang-format, but 0.27.0-insiders3 does. |
Type: LanguageService
Describe the bug
The code formatting does not work unless libtinfo5 package is installed. It shows a notification "Formatting failed" with the prompt to check the output window. The current package is libtinfo6 which comes installed in Kubuntu 18.10 as default and the package manager identifies libtinfo5 as the legacy version.
To Reproduce
Expected behavior
The code will be formatted with proper indentation, spacing, etc.
Screenshots
Additional context
From the output window:-->I believe that giving the Microsoft C/C++ extension support for libtinfo6 will solve the problem.
The text was updated successfully, but these errors were encountered: