Skip to content

inconsistent versions of clang-format between platforms #9247

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

Closed
indirectlylit opened this issue Apr 29, 2022 · 2 comments
Closed

inconsistent versions of clang-format between platforms #9247

indirectlylit opened this issue Apr 29, 2022 · 2 comments
Assignees
Labels
bug Feature: Code Formatting fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Milestone

Comments

@indirectlylit
Copy link

indirectlylit commented Apr 29, 2022

Bug type: Language Service

Describe the bug

Context:

  • Host OS: Latest mac os on x86
  • Remote OS: SSH into remote device with ubuntu 18 on 64-bit ARM
  • VS Code Version: 1.66.2 (Universal)
  • C/C++ Extension Version: 1.9.8

The version of clang-format installed into the remote device is v10.0.0:

~/.vscode-server/extensions/ms-vscode.cpptools-1.9.8-linux-arm64/LLVM/bin/clang-format --version
clang-format version 10.0.0 (https://github.com/llvm/llvm-project d32170dbd5b0d54436537b6b75beaf44324e0c28)

The version on the host is v13.0.0:

~/.vscode/extensions/ms-vscode.cpptools-1.9.8-darwin-x64/LLVM/bin/clang-format --version 
clang-format version 13.0.0 (https://github.com/llvm/llvm-project d7b669b3a30345cfcdb2fde2af6f48aa4b94845d)

My .clang-format file was created using v13. When run on the remote device it doesn't work and gives errors along the lines of Error reading ... Invalid argument.

Steps to reproduce

  1. On mac, generate a new config with clang-format -style=Chromium -dump-config > .clang-format
  2. Add to repo
  3. Check out repo on remote ARM device
  4. Connect to remote ARM device in VS Code
  5. Try to save and format a cpp file

Expected behavior

The version of clang-format should preferably always be 13+

Work-around

Regenerating the config using clang-format v10 and comparing with my existing .clang-format file allowed me to find all instances of newer arguments and options. I re-saved my config to be v10-compatible.

@Colengms Colengms self-assigned this Apr 29, 2022
@Colengms
Copy link
Contributor

Hi @indirectlylit . Thanks for reporting this.

It looks like this has already been addressed in 1.10.0. You could potentially update to 1.10.0 using the Switch to Pre-Release option for the C/C++ extension in the extension marketplace UI.

@Colengms Colengms added bug Language Service fixed Check the Milestone for the release in which the fix is or will be available. Feature: Code Formatting labels Apr 29, 2022
@Colengms Colengms added this to the 1.10.0 milestone Apr 29, 2022
@indirectlylit
Copy link
Author

indirectlylit commented Apr 29, 2022

this has already been addressed in 1.10.0

confirmed thank you

~/.vscode-server/extensions/ms-vscode.cpptools-1.10.0-linux-arm64/LLVM/bin/clang-format --version
clang-format version 14.0.0 (https://github.com/llvm/llvm-project 3f43d803382d57e3fc010ca19833077d1023e9c9)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Feature: Code Formatting fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
None yet
Development

No branches or pull requests

2 participants