Skip to content

buildkite error when making change in clang/lib/Format #62007

@bhamiltoncx

Description

@bhamiltoncx

https://reviews.llvm.org/D147577 made a change to clang/lib/Format/Format.cpp.

The Buildkite build on Linux failed when running git-clang-format on the change:

https://buildkite.com/llvm-project/premerge-checks/builds/145421#01875896-35b6-4268-a611-3583bce57973/6

/var/lib/buildkite-agent/builds/llvm-project/clang/lib/Format/.clang-format:3:1: error: unknown key 'LineEnding'
  | LineEnding: LF
  | ^~~~~~~~~~
  | Error reading /var/lib/buildkite-agent/builds/llvm-project/clang/lib/Format/.clang-format: Invalid argument
  | error: `clang-format -lines=2702:2703 -lines=2765:2765 clang/lib/Format/Format.cpp` failed
  | llvm-lit: /var/lib/buildkite-agent/builds/llvm-project/llvm/utils/lit/lit/llvm/config.py:459: note: using clang: /var/lib/buildkite-agent/builds/llvm-project/build/bin/clang
  | ERROR   git-clang-format returned an non-zero exit code 2

I tried reproducing the error locally using the "Reproduce build locally steps" on the Buildkite link:

git clone https://github.com/llvm-premerge-tests/llvm-project.git llvm-project
cd llvm-project
git checkout 46e6779c3303406686af516b200043dbfb404f6f
rm -rf build
mkdir build
cd build
export CC="clang"
export CXX="clang++"
export LD="LLD"
cmake ../llvm -D LLVM_ENABLE_PROJECTS="clang;clang-tools-extra;mlir;libc;compiler-rt;llvm;flang" -G Ninja -D CMAKE_BUILD_TYPE=Release -D LLVM_ENABLE_ASSERTIONS=ON -D LLVM_BUILD_EXAMPLES=ON -D COMPILER_RT_BUILD_LIBFUZZER=OFF -D LLVM_LIT_ARGS="-v --xunit-xml-output test-results.xml" -D LLVM_ENABLE_LLD=ON -D CMAKE_CXX_FLAGS=-gmlt -DBOLT_CLANG_EXE=/usr/bin/clang
# ^note that compiler cache arguments are omitted
ln -s $PWD/compile_commands.json ../compile_commands.json
ninja check-flang check-libc check-clang check-all check-clang-tools
cd ..
git-clang-format HEAD~1

but this worked fine:

% git-clang-format HEAD~1
clang-format did not modify any files

I suspect there's something wrong with the clang-format installed on the Buildkite hosts. Maybe it's very out of date?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions