trafficserver icon indicating copy to clipboard operation
trafficserver copied to clipboard

Pre-built clang-format for arm64 arch

Open maskit opened this issue 2 years ago • 2 comments

I use a Linux VM as my dev environment on my MacBook that has M1 chip (arm64 arch), and the pre-built clang-format binary which is used by make clang-format doesn't run on the VM.

./tools/clang-format.sh: line 82: /home/mkitajo/src/trafficserver/.git/fmt/20200514/clang-format/clang-format.linux: cannot execute binary file: Exec format error

The pre-built binary for macOS runs without issues on the MacBook.

maskit avatar Jul 20 '22 06:07 maskit

I have an M1 MacBook as well. I often build within an aarch64 docker image running on the Mac. Builds generally work great, but I notice the following when running clang-format:

  1. When I run clang-format, single threaded, natively on my M1 Mac, it takes 28 seconds.
  2. When I run clang-format in an aarch64 rockylinux:8 docker image, running clang-format single threaded takes 2 minutes and 17 seconds, not much under 5 times longer than the native Mac run.

This extra time happens due to translating the x86-64 binary for the arm architecture. It would be nice to have an arm64 Linux version of clang-format for this use case as well (in addition to the situation @maskit is seeing).

bneradt avatar Jul 20 '22 14:07 bneradt

I don't know about the pre-built clang-format exec format error, but there is a newish experimental config option for docker desktop for Mac to improve volume performance that might improve your clang-format runtime inside docker. Check Enable VirtioFS accelerated directory sharing

cmcfarlen avatar Jul 25 '22 23:07 cmcfarlen

It was added by #9355

maskit avatar Mar 21 '23 16:03 maskit