Skip to content

inconsistent versions of clang-format between platforms #9247

Description

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.

Activity

  1. Colengms commented on Apr 29, 2022

    @Colengms
    Contributor

    Hi Devon Rueckner (@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.

  2. indirectlylit commented on Apr 29, 2022

    @indirectlylit
    Author

    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)
  3. locked and limited conversation to collaborators on Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions