The initial invocation of clang-format causes make to rebuild many files, despite clang-format not reformatting any files. Future invocations do not cause this, however.
To reproduce:
docker pull ci.trafficserver.apache.org/ats/rockylinux:8
docker run -it ci.trafficserver.apache.org/ats/rockylinux:8 /bin/bash
# From inside the docker container.
cd /var/tmp
git clone https://github.com/apache/trafficserver.git
cd trafficserver
autoreconf -fi
./configure
make -j8
# Wait for the build to complete.
# Run make again. Nothing should need to be rebuilt:
make -j8
make clang-format
# Verify no files got modified by clang-format.
git status
make -j8
# Many files are rebuilt. This is not expected.
# Re-run clang-format again, even removing the local repo installation.
rm -rf .git/fmt
make clang-format
make -j8
# No files are rebuilt.
It would be good to figure out why the initial invocation of clang-format causes many files to be rebuilt and to investigate whether this can be avoided. Across the many developers who build Traffic Server this wastes a lot of time.
The initial invocation of
clang-formatcausesmaketo rebuild many files, despite clang-format not reformatting any files. Future invocations do not cause this, however.To reproduce:
It would be good to figure out why the initial invocation of clang-format causes many files to be rebuilt and to investigate whether this can be avoided. Across the many developers who build Traffic Server this wastes a lot of time.