git clang-format fails #4859

issue kostaz opened this issue on September 6, 2014
  1. kostaz commented at 6:47 AM on September 6, 2014: contributor

    git clang-format fails

    Failure

    $ git clang-format
    YAML:6:35: error: invalid boolean
    AllowShortFunctionsOnASingleLine: All
                                      ^~~
    Error reading /home/kostaz/TheStuff/Dev/bitcoin/core/bitcoin/src/.clang-format: Invalid argument
    Can't find usable .clang-format, using LLVM style
    The following files would be modified but have unstaged changes:
    M   src/main.cpp
    Please commit, stage, or stash them first.
    

    Setup

    • Ubuntu 14.04 64-bit
    • clang-format-3.5
    • Git master branch, commit b8d92236f61699846f67d8ce6cb55458a46f9de1

    Note

    I had to create soft link to /usr/bin/clang-format-3.5:

    $ ls -l /usr/bin/clang-format*
    lrwxrwxrwx 1 root root ... /usr/bin/clang-format -> /usr/bin/clang-format-3.5
    lrwxrwxrwx 1 root root ... /usr/bin/clang-format-3.5 -> ../lib/llvm-3.5/bin/clang-format
    -rwxr-xr-x 1 root root ... /usr/bin/clang-format-diff-3.5
    
  2. sipa commented at 8:05 AM on September 6, 2014: member

    The version of clang-format-3.5 shipped with Ubuntu 14.04 is too old for some of the features we need. If they're changes the features mid-release, I'm not sure why a version is added to the binary name, though...

  3. kostaz commented at 6:58 AM on September 14, 2014: contributor

    Indeed the latest clang-format (version 3.6) worked ok with the recent (6a8d15c) commit.

    The procedure I used to install git clang-format is below:

    deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty main
    deb-src http://llvm.org/apt/trusty/ llvm-toolchain-trusty main
    # 3.4
    deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.4 main
    deb-src http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.4 main
    # 3.5
    deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.5 main
    deb-src http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.5 main
    
    • Install clang-format-3.6 using apt-get install clang-format-3.6 (this also installs libllvm3.6).
    • Create soft link to clang-format-3.6 using sudo ln -s /usr/bin/clang-format-3.6 /usr/bin/clang-format.

    Thanks, sipa!

  4. kostaz closed this on Sep 14, 2014

  5. MarcoFalke locked this on Sep 8, 2021
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-15 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me