Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/ci-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ arm64-v8a gives the same three lines for `arm64-v8a.json` instead. All 21 typeli

`scripts/compare-sysroot <built> <reference>` is that check; it exits non-zero on any
differing content, and the workflow step runs under `bash` with `pipefail`, so a differing
file turns the job red (after the artifact is uploaded).
file turns the job red (after the artifact is uploaded). The manifest is the exception: it
carries the tag, so a new release always differs from the one it rebuilds. It is reported
by the keys that changed and does not fail the job, which keeps red meaning a real
difference in a library, header or typelib.

## What is left

Expand Down
15 changes: 13 additions & 2 deletions scripts/compare-sysroot
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#
# Exits non-zero when a path present in BOTH archives differs. A path only one
# archive has is reported but not fatal: the release may predate a fix, and
# `find -type f` skips the dangling symlinks older releases carry.
# `find -type f` skips the dangling symlinks older releases carry. The manifest
# (share/android-sysroot/<abi>.json) is reported by key and not fatal either: it
# carries the tag, so every new release differs from the one it rebuilds.
set -euo pipefail
export LC_ALL=C # comm and sort have to agree on byte order

Expand Down Expand Up @@ -39,7 +41,8 @@ comm -13 "$work/reference.names" "$work/built.names" > "$work/only-built"
comm -23 "$work/reference.names" "$work/built.names" > "$work/only-reference"
comm -12 "$work/reference.list" "$work/built.list" | cut -f1 > "$work/same"
comm -12 "$work/reference.names" "$work/built.names" > "$work/common"
comm -13 "$work/same" "$work/common" > "$work/differing"
comm -13 "$work/same" "$work/common" | grep -v '^share/android-sysroot/[^/]*\.json$' > "$work/differing" || true
comm -13 "$work/same" "$work/common" | grep '^share/android-sysroot/[^/]*\.json$' > "$work/manifest" || true

report() {
local label=$1 file=$2 count
Expand All @@ -54,6 +57,14 @@ report "only in the build" "$work/only-built"
report "only in the reference" "$work/only-reference"
report "differing content" "$work/differing"

while read -r path; do
echo "manifest $path differs in: $(node -e '
const [a, b] = process.argv.slice(1).map((f) => JSON.parse(require("fs").readFileSync(f, "utf8")));
const keys = [...new Set([...Object.keys(a), ...Object.keys(b)])].sort();
console.log(keys.filter((k) => JSON.stringify(a[k]) !== JSON.stringify(b[k])).join(" "));
' "$work/reference/$path" "$work/built/$path")"
done < "$work/manifest"

while read -r path; do
case $path in
*.typelib) ;;
Expand Down
Loading