-
-
Notifications
You must be signed in to change notification settings - Fork 134
132 lines (119 loc) · 4.21 KB
/
abidiff.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Check for ABI breaks
on:
push:
branches-ignore:
- abi-break
pull_request:
branches-ignore:
- abi-break
jobs:
run-abidiff:
name: Compare ABIs
runs-on: ubuntu-latest
steps:
- name: Install prerequisites
run: |
sudo apt-get install ninja-build g++-10 abigail-tools
sudo pip3 install setuptools
sudo pip3 install meson xbstrap
- name: Checkout base branch
if: ${{ github.base_ref }}
uses: actions/checkout@v2
with:
path: mlibc-base
ref: ${{ github.base_ref }}
submodules: true
fetch-depth: 4
- name: Checkout managarm/mlibc#master
if: ${{ github.base_ref == '' }}
uses: actions/checkout@v2
with:
path: mlibc-base
repository: managarm/mlibc
submodules: true
ref: master
fetch-depth: 4
- name: Checkout branch
uses: actions/checkout@v2
with:
path: mlibc-branch
submodules: true
- name: Determine base ref
run: |
master_hash="$(git -C mlibc-base rev-parse HEAD)"
branch_hash="$(git -C mlibc-branch rev-parse HEAD)"
printf '%s\n' "$master_hash" "$branch_hash"
if [ "$master_hash" = "$branch_hash" ]; then
git -C mlibc-base reset --hard HEAD^
fi
- name: Set up linux kernel headers
run: |
mkdir -p linux-headers-base/{src,build}
cp mlibc-base/ci/bootstrap.yml linux-headers-base/src/
(
cd linux-headers-base/build
xbstrap init ../src
xbstrap install linux-headers
)
mkdir -p linux-headers-branch/{src,build}
cp mlibc-branch/ci/bootstrap.yml linux-headers-branch/src/
(
cd linux-headers-branch/build
xbstrap init ../src
xbstrap install linux-headers
)
cat > linux-headers-base/build/bootstrap-site.yml << EOF
define_options:
arch: ${{matrix.arch}}
EOF
cp linux-headers-base/build/bootstrap-site.yml linux-headers-branch/build/bootstrap-site.yml
- name: Build and install both copies
run: |
set -xe
export C=gcc-10 CXX=g++-10
mkdir root-base root-branch
(
cd mlibc-branch
meson --buildtype=debugoptimized -Dlinux_kernel_headers=$GITHUB_WORKSPACE/linux-headers-branch/build/packages/linux-headers/usr/include build
ninja -C build
DESTDIR="$GITHUB_WORKSPACE/root-branch" ninja -C build install
)
(
cd mlibc-base
# defaults to all features, linux build
meson --buildtype=debugoptimized -Dlinux_kernel_headers=$GITHUB_WORKSPACE/linux-headers-base/build/packages/linux-headers/usr/include build
ninja -C build
DESTDIR="$GITHUB_WORKSPACE/root-base" ninja -C build install
)
- name: Compare
run: |
# TODO(arsen): does this require handling for version suffixes?
set -e +x
exitcode=0
git -C mlibc-branch show -s --format=%s | grep -q abi-break || \
exitcode=1
echo ==== RUNNING ABIDIFF... ====
( cd root-base; find . -type f -name '*.so'; ) | while read -r file
do
if ! file -- root-{base,branch}/"$file"; then
touch files-differ
continue
fi
abidiff \
--no-added-syms \
--suppr mlibc-branch/ci/abidiff_suppress.ini \
--hd1 root-base/usr/local/include/ \
--hd2 root-branch/usr/local/include/ \
root-{base,branch}/"$file" \
|| touch files-differ
done
echo ==== CHECKING FOR EXTRA FILES... ====
( cd root-branch; find . -type f -name '*.so'; ) | while read -r file
do
[ -e "root-base/$file" ] || file root-{base,branch}/"$file" \
|| touch files-differ
done
if [ -e files-differ ]; then
echo SOME FILES/ABI DIFFER, SEE OUTPUT ABOVE
exit "$exitcode"
fi