project-chip / connectedhomeip

Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://buildwithmatter.com
Apache License 2.0
7.34k stars 1.97k forks source link

[BUG] Chip-Cert-Bins build failing to build in the bloaty section #35364

Open raju-apple opened 1 week ago

raju-apple commented 1 week ago

Reproduction steps

Tried to create a chip-cert-bins image using the following command and its failing in the bloat comparison tools section

docker buildx build --build-arg COMMITHASH=1d7477934bbfaaaba3556d60a617c071830acf42 --platform linux/arm64 --tag connectedhomeip/chip-cert-bins:1d7477934bbfaaaba3556d60a617c071830acf42 --push .

Failure ERROR: failed to solve: process "/bin/sh -c set -x && git clone https://github.com/google/bloaty.git && mkdir -p bloaty/build && cd bloaty/build && cmake -G Ninja ../ && ninja && ninja install && cd ../.. && rm -rf bloaty && : # last line" did not complete successfully: exit code: 1

Bug prevalence

Every time

GitHub hash of the SDK that was being used

1d7477934bbfaaaba3556d60a617c071830acf42

Platform

other

Platform Version(s)

arm64

Anything else?

Attached full failure logs

bloaty_full_fail_logs.rtf.zip

raju-apple commented 1 week ago

@andy31415 do you know if anything changed recently in the bloaty section ? . I know @tehampson added some apps recently and so did @rquidute but don't think that should cause this failure .

------
Dockerfile:145
--------------------
 144 |     # Install bloat comparison tools
 145 | >>> RUN set -x \
 146 | >>>     && git clone https://github.com/google/bloaty.git \
 147 | >>>     && mkdir -p bloaty/build \
 148 | >>>     && cd bloaty/build \
 149 | >>>     && cmake -G Ninja ../ \
 150 | >>>     && ninja \
 151 | >>>     && ninja install \
 152 | >>>     && cd ../.. \
 153 | >>>     && rm -rf bloaty \
 154 | >>>     && : # last line
 155 |     
--------------------
joyoungjun commented 1 week ago

I had the same problem and I solved it with below.

  1. Copy the codes below (referenced here)

RUN git clone https://github.com/abseil/abseil-cpp.git /tmp/abseil-cpp \ && cd /tmp/abseil-cpp \ && cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local \ && cmake --build build --target install \ && rm -rf /tmp/abseil-cpp

  1. Past to the Dockerfile at 'connectedhomeip/integerations/docker/images/chip-cert-bins/Dockerfile' (referenced here )

This commit should also be reflected in chip-cert-bins

tehampson commented 1 week ago

Please look at this thread for more information, but pretty much what Amine. I am just summarizing discovered was:

This is my understanding of the issue:

The work around suggested by @joyoungjun is what we need right now, but I think bloaty is working on a fix, maybe https://github.com/google/bloaty/pull/384 is an alternative

raju-apple commented 1 week ago

Let me try the workaround , maybe we should put the PR up also on the docker file in cert-bins if it works.

Alami-Amine commented 1 week ago

FYI an issue has been opened at Bloaty: https://github.com/google/bloaty/issues/386 and as @tehampson said, their PR: https://github.com/google/bloaty/pull/384 should fix the issue for us, and then we can remove the workaround

raju-apple commented 1 week ago

Confirmed the workaround is good , put up a PR , Please review when you get a chance @andy31415 @Alami-Amine @tehampson . Thanks ! FYI @naveenkommareddi , we need to make sure this makes it before the SDK cutoff tomorrow.

Alami-Amine commented 1 week ago

by the way @raju-apple, this fix is not needed anymore. issue fixed Bloaty integrated their PR https://github.com/google/bloaty/pull/384 that bumps absiel to latest version. I have tested it in a PR and its working. The PR