Skip to content

Commit

Permalink
Bug 1654158 - Improve symbols list diffs in diffoscope tasks. r=froydnj
Browse files Browse the repository at this point in the history
This helps a little with the diffs from bug 1654123.

Differential Revision: https://phabricator.services.mozilla.com/D84289
  • Loading branch information
glandium committed Jul 21, 2020
1 parent 3a2a805 commit 3997125
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions taskcluster/docker/diffoscope/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ RUN apt-get install \
locale-gen

COPY get_and_diffoscope /builds/worker/bin/get_and_diffoscope
COPY readelf /builds/worker/bin/readelf

RUN chown -R worker:worker /builds/worker/bin && chmod 755 /builds/worker/bin/*
5 changes: 4 additions & 1 deletion taskcluster/docker/diffoscope/get_and_diffoscope
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ cd /builds/worker

mkdir a b

# /builds/worker/bin contains wrapper binaries to divert what diffoscope
# needs to use, so it needs to appear first.
export PATH=/builds/worker/bin:$PATH

# Until https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=879010 is
# implemented, it's better to first manually extract the data.
# Plus dmg files are not supported yet.
Expand All @@ -26,7 +30,6 @@ case "$ORIG_URL" in
for tool in lipo otool; do
ln -s $MOZ_FETCHES_DIR/cctools/bin/x86_64-apple-darwin*-$tool bin/$tool
done
export PATH=$PATH:/builds/worker/bin
curl -L "$ORIG_URL" > a.dmg
curl -L "$NEW_URL" > b.dmg
for i in a b; do
Expand Down
13 changes: 13 additions & 0 deletions taskcluster/docker/diffoscope/readelf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

case "$1 $2" in
"--wide --symbols")
# When called with --wide --symbols, we remove the first column (which
# is essentially a line number that is not very useful), and then sort,
# which will order symbols by address, making a diff more useful.
/usr/bin/readelf "$@" | awk -F: '{print $2}' | sort
;;
*)
exec /usr/bin/readelf "$@"
;;
esac

0 comments on commit 3997125

Please sign in to comment.