Bug 1849988 - Scrape symbols Windows graphics drivers r=afranchuk

Differential Revision: https://phabricator.services.mozilla.com/D186940
This commit is contained in:
Gabriele Svelto 2023-08-29 08:49:00 +00:00
parent e1c31937df
commit 695b1134b2
5 changed files with 112 additions and 1 deletions

View file

@ -251,6 +251,9 @@ jobs:
system-symbols-win:
symbol: I(system-symbols-win)
parent: debian12-base
system-symbols-win-gfx:
symbol: I(system-symbols-win-gfx)
parent: debian12-base
system-symbols-linux-scraper:
symbol: I(system-symbols-linux)
parent: debian12-base

View file

@ -620,7 +620,7 @@ symbol-scrapers:
fetch:
type: git
repo: http://github.com/mozilla/symbol-scrapers
revision: 1f82450ec821ce4466501b771cc93004968a4f66
revision: 0916a49a5ee9bb4557e843df91d8ec07389816cd
cpython-3.8.10:
description: cpython 3.8.10 source code

View file

@ -270,3 +270,27 @@ jobs:
fetches:
fetch:
- symbol-scrapers
win-gfx:
description: Extract symbols from closed-source Windows graphics drivers
attributes:
build_platform: windows-graphics
index:
product: system-symbols
job-name: win-gfx
type: generic
worker:
artifacts:
- name: public/build
type: directory
path: /builds/worker/artifacts/
docker-image: {in-tree: system-symbols-win-gfx}
max-run-time: 14400
run:
using: run-task
command: >-
./run.sh
treeherder:
symbol: sys-symbols-win-gfx
fetches:
fetch:
- symbol-scrapers

View file

@ -0,0 +1,25 @@
FROM $DOCKER_IMAGE_PARENT
MAINTAINER Gabriele Svelto <gsvelto@mozilla.com>
RUN mkdir -p /builds
RUN id worker || useradd -d /builds/worker -s /bin/bash -m worker
WORKDIR /builds/worker
# We need to declare all potentially cache volumes as caches. Also,
# making high I/O paths volumes increase I/O throughput because of
# AUFS slowness.
VOLUME /builds/worker/checkouts
RUN apt-get update && \
apt-get install --no-install-recommends -y \
7zip build-essential curl jq python3-pip unzip wget zip && \
apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
COPY run.sh /builds/worker/run.sh
RUN chown -R worker:worker /builds/worker
RUN pip3 install --break-system-packages crashstats-tools==1.4.0
# Set a default command useful for debugging
CMD ["/bin/bash", "--login"]

View file

@ -0,0 +1,59 @@
#!/bin/bash
set -ex
SHA256SUMS="SHA256SUMS.zip"
function get_route()
{
local task_url="${TASKCLUSTER_ROOT_URL}/api/queue/v1/task/${TASK_ID}"
local payload
payload=$(curl -sSL "${task_url}")
local route
route=$(echo "${payload}" | jq -r '.routes[] | select(contains("latest")) | select(contains("pushdate") | not) ' | sed -e 's/^index\.//')
echo "${route}"
}
function get_sha256sum_url()
{
local route
route=$(get_route)
local sha256sums_url="${TASKCLUSTER_ROOT_URL}/api/index/v1/task/${route}/artifacts/public/build/${SHA256SUMS}"
echo "${sha256sums_url}"
}
function has_sha256sums_on_index()
{
local url
url=$(get_sha256sum_url)
curl -sSL --head --fail -o /dev/null "${url}"
}
function download_extract_sha256sums()
{
local url=$1
curl -sSL "${url}" -o "${SHA256SUMS}"
unzip "${SHA256SUMS}" && rm "${SHA256SUMS}"
}
if has_sha256sums_on_index; then
sha256=$(get_sha256sum_url)
fi
mkdir -p /builds/worker/artifacts/
pushd "${MOZ_FETCHES_DIR}/symbol-scrapers/windows-graphics-drivers"
if [ -z "${sha256}" ]; then
touch SHA256SUMS # First run, create the file
else
download_extract_sha256sums "${sha256}"
fi
DUMP_SYMS="${MOZ_FETCHES_DIR}/dump_syms/dump_syms" /bin/bash -x script.sh
zip -r9 "/builds/worker/artifacts/${SHA256SUMS}" SHA256SUMS
popd
if [ ! -f "/builds/worker/artifacts/target.crashreporter-symbols.zip" ]; then
echo "No symbols zip produced, upload task will fail"
fi