Clang format not working

964 views
Skip to first unread message

sidha...@chromium.org

unread,
Aug 7, 2013, 6:08:19 PM8/7/13
to chromi...@chromium.org
git cl format fails for me with this error message:
Could not find clang-format-diff at /usr/lib/clang-format/clang-format-diff.py

I tried installing clang-format-3.4 but it didn't seem to help. Any suggestions?

Thiago Farina

unread,
Aug 7, 2013, 6:14:21 PM8/7/13
to sidha...@chromium.org, Chromium-dev
what $(which clang-format) says?

--
Thiago

Vivek Galatage

unread,
Nov 28, 2013, 1:58:38 AM11/28/13
to chromi...@chromium.org, sidha...@chromium.org
I am facing the same issue.

I installed clang-format-3.4 as stated. 

which clang-format outputs nil. I went ahead and created a soft link for clang-format-3.4 but still no help. 

David Turner

unread,
Nov 28, 2013, 5:06:07 AM11/28/13
to sidha...@chromium.org, chromium-dev
We currently rely on having the clang-format package to install /usr/lib/clang-format/clang-format-diff.py, apparently this file is missing from your system after installing the package.

Can you tell us which system you're on exactly, and how you did install clang-format-3.4? Which files were installed exactly and where?

Longer term, it would be nicer to have clang-format and clang-format-diff.py be part of depot_tools/, or at least have update_depot_tools download a well-known fixed binary/script from stable repository.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
 
 

Vivek Galatage

unread,
Nov 28, 2013, 7:30:00 AM11/28/13
to David Turner, sidha...@chromium.org, Chromium-dev

Hi

I am on Ubuntu 12.04 64-bit. I used http://llvm.org/apt/ to install 3.4 version as described in the link. It did install clang-format-3.4 in /usr/bin/clang-format3.4.

I verified what files got installed along with this package by dpkg -L clang-format3.4 and the result is as follows

$ dpkg -L clang-format-3.4
/.
/usr
/usr/lib
/usr/lib/llvm-3.4
/usr/lib/llvm-3.4/bin
/usr/lib/llvm-3.4/bin/clang-format
/usr/bin
/usr/bin/clang-format-diff-3.4
/usr/share
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/clang-format-diff-3.4.1.gz
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/clang-format-3.4
/usr/share/doc
/usr/share/doc/clang-format-3.4
/usr/share/doc/clang-format-3.4/changelog.Debian.gz
/usr/share/doc/clang-format-3.4/copyright
/usr/share/vim
/usr/share/vim/addons
/usr/share/vim/addons/syntax
/usr/share/vim/addons/syntax/clang-format-3.4.py
/usr/share/emacs
/usr/share/emacs/site-lisp
/usr/share/emacs/site-lisp/clang-format-3.4
/usr/share/emacs/site-lisp/clang-format-3.4/clang-format.el
/usr/bin/clang-format-3.4


$ git cl format

Could not find clang-format-diff at /usr/lib/clang-format/clang-format-diff.py.


To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.

David Turner

unread,
Nov 28, 2013, 8:17:51 AM11/28/13
to Vivek Galatage, sidha...@chromium.org, Chromium-dev
It looks like the script has moved to /usr/bin/ and everything is suffixed with -3.4, damn. Yet another reason to have our own copy... I'll try to prepare a fix to depot_tools/git_cl.py, in the meantime I recommend to uninstall this package and try to find a version of clang-format-3.3 for your system instead. Or patch git_cl.py directly.


David Turner

unread,
Nov 28, 2013, 8:51:59 AM11/28/13
to Vivek Galatage, sidha...@chromium.org, Chromium-dev
Actually a simpler possibility is to add symlinks to /usr/bin/clang-format and /usr/lib/clang-format/clang-format-diff.py instead.

I don't think adding more auto-magic in git cl is going to be a good idea, I'll see what it takes to rebuild these from sources instead.

Nico Weber

unread,
Nov 28, 2013, 5:06:55 PM11/28/13
to David Turner, sidha...@chromium.org, chromium-dev
On Thu, Nov 28, 2013 at 7:06 PM, David Turner <di...@chromium.org> wrote:



On Thu, Aug 8, 2013 at 12:08 AM, <sidha...@chromium.org> wrote:
git cl format fails for me with this error message:
Could not find clang-format-diff at /usr/lib/clang-format/clang-format-diff.py

I tried installing clang-format-3.4 but it didn't seem to help. Any suggestions?

We currently rely on having the clang-format package to install /usr/lib/clang-format/clang-format-diff.py, apparently this file is missing from your system after installing the package.

Can you tell us which system you're on exactly, and how you did install clang-format-3.4? Which files were installed exactly and where?

Longer term, it would be nicer to have clang-format and clang-format-diff.py be part of depot_tools/, or at least have update_depot_tools download a well-known fixed binary/script from stable repository.

It's too large for depot_tools. http://crbug.com/240309 is about pulling it from google storage.
Reply all
Reply to author
Forward
0 new messages