This is an automated email from the ASF dual-hosted git repository.
bmahler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git
The following commit(s) were added to refs/heads/master by this push:
new e15da0210 [mesos-tidy] Fix broken Dockerfile due to llvm repo move.
e15da0210 is described below
commit e15da0210d8176851136ca3ac99be7c938ee7059
Author: Benjamin Mahler <[email protected]>
AuthorDate: Wed Mar 13 17:16:19 2024 -0400
[mesos-tidy] Fix broken Dockerfile due to llvm repo move.
This appears to fix the mesos-tidy docker image build, which now works
per the readme instructions:
```
$ docker build -t mesos-tidy .
```
Running the image was hitting gcc internal errors due to OOMs, which I
fixed via the updates shown in the readme.
---
support/mesos-tidy/Dockerfile | 8 ++++----
support/mesos-tidy/README.md | 17 +++++++++++++++--
2 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/support/mesos-tidy/Dockerfile b/support/mesos-tidy/Dockerfile
index 90836cfce..db66a8575 100644
--- a/support/mesos-tidy/Dockerfile
+++ b/support/mesos-tidy/Dockerfile
@@ -39,11 +39,11 @@ RUN curl -sSL
https://cmake.org/files/v3.16/cmake-3.16.0-Linux-x86_64.sh \
sh /tmp/install-cmake.sh --skip-license --prefix=/usr/local
RUN \
- git clone --depth 1 -b release_90 http://llvm.org/git/llvm /tmp/llvm && \
- git clone --depth 1 -b mesos_90 http://github.com/mesos/clang.git
/tmp/llvm/tools/clang && \
- git clone --depth 1 -b mesos_90
http://github.com/mesos/clang-tools-extra.git /tmp/llvm/tools/clang/tools/extra
&& \
+ git clone --depth 1 -b release/9.x http://github.com/llvm/llvm-project.git
/tmp/llvm-project && \
+ git clone --depth 1 -b mesos_90 http://github.com/mesos/clang.git
/tmp/llvm-project/llvm/tools/clang && \
+ git clone --depth 1 -b mesos_90
http://github.com/mesos/clang-tools-extra.git
/tmp/llvm-project/llvm/tools/clang/tools/extra && \
\
- cmake /tmp/llvm -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt && \
+ cmake /tmp/llvm-project/llvm -DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=/opt && \
cmake --build tools/clang/lib/Headers --target install -- -j $(nproc) && \
cmake --build tools/clang/tools/extra/clang-tidy --target install -- -j
$(nproc) && \
\
diff --git a/support/mesos-tidy/README.md b/support/mesos-tidy/README.md
index bfa42733a..043d22044 100644
--- a/support/mesos-tidy/README.md
+++ b/support/mesos-tidy/README.md
@@ -14,12 +14,17 @@ Building the image involves compiling a Mesos-flavored
version of
`clang-tidy`, installing Mesos dependencies, and installation of tools
to drive check invocations.
-The image can be built with
-
+The image can be built with:
```bash
$ docker build -t mesos-tidy .
```
+On an M1 Mac, you may need to pass `--platform` to avoid an error with
+`qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or
directory`:
+```bash
+$ docker build -t mesos-tidy --platform linux/amd64 .
+```
+
A pre-built image is available via Docker Hub as `mesos/mesos-tidy`.
## Running checks
@@ -28,6 +33,7 @@ To run checks over a Mesos checkout invoke
```bash
$ docker run \
+ --platform linux/amd64 \
--rm \
-v <MESOS_CHECKOUT>:/SRC \
[-e CHECKS=<CHECKS>] \
@@ -35,6 +41,13 @@ $ docker run \
mesos-tidy
```
+If running on macOS, it will run out of memory by default and you need
+to constrain the JOB count, for example:
+
+```bash
+docker run --rm -v <MESOS_CHECKOUT>:/SRC --platform linux/amd64 --env JOBS=4
--memory 32GB mesos-tidy
+```
+
Here `MESOS_CHECKOUT` points to a git checkout of the Mesos source tree.
Additional configure parameters can be passed to the `cmake` invocation of
Mesos