Skip to content

Commit

Permalink
Fixes to crashpad container
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsavage1 committed Aug 29, 2023
1 parent 0f3cabf commit 0faf59b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ services:

crashpad-symbolize:
build:
args:
- GITHUB_TAG=${GITHUB_TAG:-23.lts.5}
- ARCHITECTURE=${ARCHITECTURE:-x64}
- SB_API_VERSION=${SB_API_VERSION:-14}
- CONFIG=${CONFIG:-qa}
context: ./docker/crashpad_symbolize
dockerfile: Dockerfile
image: crashpad-symbolize
Expand Down
25 changes: 11 additions & 14 deletions docker/crashpad_symbolize/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
FROM cobalt-base

RUN apt update -qqy \
&& apt install -qqy --no-install-recommends jq build-essential \
&& apt-get clean autoclean \
&& apt-get autoremove -y --purge \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& rm -rf /var/lib/{apt,dpkg,cache,log}
&& apt install -qqy --no-install-recommends jq build-essential zlib1g-dev libzstd-dev \
&& /opt/clean-after-apt.sh

RUN cd /tmp \
&& git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git'
Expand All @@ -30,28 +27,28 @@ ARG ARCHITECTURE
ARG SB_API_VERSION
ARG CONFIG
ENV CONTAINS_STRING unstripped_${ARCHITECTURE}_sbversion-${SB_API_VERSION}_${CONFIG}
RUN jq -r '.assets[] | select(.name | contains($CONTAINS_STRING)) | .id' /tmp/release.json > /tmp/asset_id.txt \
RUN jq -r --arg str "$CONTAINS_STRING" '.assets[] | select(.name | contains($str)) | .id' /tmp/release.json > /tmp/asset_ids.txt \
&& rm /tmp/release.json

RUN while read asset_id; do \
curl -LJO \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/youtube/cobalt/releases/assets/${asset_id}; \
done < asset_ids.txt \
&& rm /tmp/asset_ids.txt
done < /tmp/asset_ids.txt

RUN id=$(cat asset_ids.txt) && \
RUN id=$(cat /tmp/asset_ids.txt) && \
rm /tmp/asset_ids.txt && \
curl -s -L \
-H "Accept: application/vnd.github.v3+json" \
-H "Accept: application/octet-stream" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$owner/$repo/releases/assets/$id -o /tmp/libcobalt.tgz
https://api.github.com/repos/youtube/cobalt/releases/assets/$id -o /tmp/libcobalt.tgz

RUN tar xzf /tmp/libcobalt.tgz
RUN libcobalt_path=$(find /tmp/tmp/cobalt-evergreen-snapshot/ -name "libcobalt.so") \
&& /tmp/src/tools/linux/dump_syms/dump_syms $libcobalt_path > /tmp/libcobalt.so.sym \
RUN libcobalt_path=$(find /tmp/cobalt-evergreen-snapshot/ -name "libcobalt.so") \
&& breakpad/src/src/tools/linux/dump_syms/dump_syms $libcobalt_path > /tmp/libcobalt.so.sym \
&& debug_id=$(head -n1 /tmp/libcobalt.so.sym | cut -d' ' -f4) \
&& mkdir -p /tmp/symbols/libcobalt.so/$debug_id/ \
&& mv /tmp/libcobalt.so.sym /tmp/symbols/libcobalt.so/$debug_id/

CMD /tmp/src/processor/minidump_stackwalk ${MINIDUMP_PATH} /tmp/symbols
CMD breakpad/src/src/processor/minidump_stackwalk ${MINIDUMP_PATH} /tmp/symbols

0 comments on commit 0faf59b

Please sign in to comment.