Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
bhamiltoncx opened this issue Apr 7, 2023 · 5 comments
Closed

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

bhamiltoncx opened this issue Apr 7, 2023 · 5 comments
Assignees

Comments

@bhamiltoncx
Copy link
Contributor

bhamiltoncx commented Apr 7, 2023

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?

@bhamiltoncx bhamiltoncx changed the title buildkite error buildkite error when making change in clang/lib/Format Apr 7, 2023
@bhamiltoncx
Copy link
Contributor Author

@metaflow, I see you touched the buildkite docs. Do you know who might be able to take a look at the clang-format tool installed on those hosts?

@metaflow
Copy link
Contributor

metaflow commented Apr 7, 2023 via email

@bhamiltoncx
Copy link
Contributor Author

No rush at all, this isn't critical. Thanks for taking the time to reply.

@rymiel
Copy link
Member

rymiel commented Apr 7, 2023

Maybe it's very out of date?

It's likely not that out of date, it's just that clang-format itself uses bleeding edge (maybe even unreleased) clang-format features, simply because someone contributing to clang-format would be building a bleeding edge version for testing anyway.

(Although yes, I've learned to ignore precommit status which is a little sad)

@metaflow
Copy link
Contributor

metaflow commented Sep 7, 2023

We have removed clang-format check for pre-merge (both for phab and PR)

@metaflow metaflow closed this as completed Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants