You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by GitBox <gi...@apache.org> on 2022/06/30 18:41:23 UTC

[GitHub] [trafficserver] bneradt opened a new issue, #8934: Initial `clang-format` target invocation causes many files to be rebuilt

bneradt opened a new issue, #8934:
URL: https://github.com/apache/trafficserver/issues/8934

   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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] bneradt commented on issue #8934: Initial `clang-format` target invocation causes many files to be rebuilt

Posted by GitBox <gi...@apache.org>.
bneradt commented on issue #8934:
URL: https://github.com/apache/trafficserver/issues/8934#issuecomment-1171612189

   These are autoconf generated files, thus they don't show up in my `git diff` command. We should simply skip running clang-format on these files. I'll create a PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] bneradt commented on issue #8934: Initial `clang-format` target invocation causes many files to be rebuilt

Posted by GitBox <gi...@apache.org>.
bneradt commented on issue #8934:
URL: https://github.com/apache/trafficserver/issues/8934#issuecomment-1171571612

   @bryancall thought of using `-mmin` from find to detect what files are changing:
   
   ```
   # Clone, autoreconf, make.
   # Wait more than 5 minutes.
   
   # Now, find all the files modified in the last 5 minutes in the repo:
   find . -mmin -5
   # Should show nothing.
   
   # Now run the clang-format target, followed by the above find command:
   make -j5 clang-format && echo -------------------- && find . -mmin -5
   # ...
   ./plugins/certifier/certifier.cc
   make[1]: Leaving directory '/home/bneradt/src/ts_asf_master_fix_clang_format_make_target'
   --------------------
   ./.git
   ./.git/fmt
   ./.git/fmt/20200514
   ./.git/fmt/20200514/clang-format-20200514.tar.bz2
   ./.git/fmt/20200514/sha1
   ./include
   ./include/ink_autoconf.h.in
   ./include/ink_autoconf.h
   ```
   
   The `.git/fmt` directory changes are simply the changes to install clang-format. That's not interesting. But the fact that clang-format is modifying `ink_autoconf.h.in` and `ink_autoconf.h` is interesting. I'm not sure why that file is being modified despite making no changes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [trafficserver] bneradt closed issue #8934: Initial `clang-format` target invocation causes many files to be rebuilt

Posted by GitBox <gi...@apache.org>.
bneradt closed issue #8934: Initial `clang-format` target invocation causes many files to be rebuilt
URL: https://github.com/apache/trafficserver/issues/8934


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org