Skip to content
New issue

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

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

Already on GitHub? # to your account

CI failing with cmake --build build --target check-format, complains about CPM.cmake even though it is excluded #28

Open
Phytolizer opened this issue Aug 15, 2021 · 3 comments

Comments

@Phytolizer
Copy link

Phytolizer commented Aug 15, 2021

This doesn't fail when running it locally, only on CI.

Local run:

[TerraGen]$ cmake --build build --target check-format
[0/2] Re-checking globbed directories...
[2/2] cd /home/kyle/Documents/TerraGen && /usr/bin/python3.9 /home/kyle/Documents/TerraGen/build/_deps/...ke-src/git-clang-format.py --binary=/usr/bin/clang-format --ci 4b825dc642cb6eb9a060e54bf8d69288fbee4904
clang-format did not modify any files

CI run:

  cmake --build /home/runner/work/TerraGen/TerraGen/build --target check-format --config Debug
  shell: /usr/bin/bash -e {0}
  env:
    BUILD_TYPE: Debug
CMake Error at build/_deps/format.cmake-src/cmake-format.cmake:53 (message):
  cmake/CPM.cmake needs to be reformatted

Any idea what I'm doing wrong here?

@giacomo-b
Copy link

I'm getting a similar error when using ModernCppStarter. This is my log:

Run cmake --build build --target check-format
clang-format did not modify any files
Built target check-clang-format
CMake Error at /Users/runner/work/MyProject/MyProject/cpm_modules/format.cmake/e25a26778e5810b3fa49523bf8cadf5f71bacc26/cmake-format.cmake:53 (message):
  ../CMakeLists.txt needs to be reformatted


make[3]: *** [_deps/format.cmake-build/CMakeFiles/check-cmake-format] Error 1
make[2]: *** [_deps/format.cmake-build/CMakeFiles/check-cmake-format.dir/all] Error 2
make[1]: *** [_deps/format.cmake-build/CMakeFiles/check-format.dir/rule] Error 2
make: *** [check-format] Error 2
Error: Process completed with exit code 2.

The only difference w.r.t. the original repo is the project name (MyProject instead of Greeter).

@TheLartians
Copy link
Owner

Hm, one way this can happen is when different versions of formatters are installed on CI and local systems. Can you check that cmake-format --version returns the same value on both systems?

@giacomo-b
Copy link

Since then I have completely reinstalled a few utilities (including clang-format) and now everything works as expected. At this point I am not sure what the problem was exactly, but I would suggest trying to reinstall/update the tools involved.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants