Skip to content

Error when formatting code on macOS #1542

@hferreiro

Description

@hferreiro

How to reproduce

  1. Follow instructions at https://github.com/ccache/ccache/blob/master/doc/INSTALL.md#installation to build
  2. Run make format, as mentioned at https://github.com/ccache/ccache/blob/master/CONTRIBUTING.md#code-style

Actual behavior

I've got this error:

$ make format
[100%] Formatting code
usage: sha256sum [-bctwz] [files ...]
Error: Bad checksum of downloaded clang-format
make[3]: *** [CMakeFiles/format] Error 1
make[2]: *** [CMakeFiles/format.dir/all] Error 2
make[1]: *** [CMakeFiles/format.dir/rule] Error 2
make: *** [format] Error 2

Expected behavior

clang-format being called.

I have clang-format installed, but from https://github.com/ccache/ccache/blob/master/misc/clang-format, it seems this would be my case:

# 3. Otherwise, download a statically linked clang-format executable, verify its
#    integrity, place it in <ccache-top-dir>/misc/.clang-format-exe and execute
#    it.

After running make format, there's no .clang-format-exe file, only .clang-format-exe.tmp. I had to make it executable and rename it, and then it worked.

Environment

master branch

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: dev toolsAffects tools for developing ccacheissue: improvementEnhancements that improve performance, usability or code quality, not a new featureos: macosRelated to building or running on macOS

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions