-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (70 loc) · 3.47 KB
/
Copy pathci.yml
File metadata and controls
79 lines (70 loc) · 3.47 KB
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
# Build all three members and prove the generated code is really generated.
#
# The interesting failure mode here is not "does it compile" — it is that a
# HOST wayland-scanner would silently produce different code. 1.22 does not
# know 1.23's `deprecated-since` attribute and rejects protocol/wayland.xml
# outright, so the job asserts the generator that ran was the one this build
# produced.
name: ci
on:
push:
branches: [main]
tags: ['v*']
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install xlings + mcpp
run: |
curl -fsSL https://d2learn.org/xlings-install.sh | bash
echo "$HOME/.xlings/subos/default/bin" >> "$GITHUB_PATH"
"$HOME/.xlings/bin/xlings" install mcpp -y
- name: Build the workspace
run: mcpp build --workspace
- name: wayland-scanner runs and is 1.23.1
run: |
scanner=$(find mcpp/scanner/target -name wayland-scanner -type f | head -1)
test -n "$scanner" || { echo "no wayland-scanner was built"; exit 1; }
"$scanner" --version
"$scanner" --version | grep -qx 'wayland-scanner 1.23.1'
- name: the generated protocol code came from THIS scanner
run: |
scanner=$(find mcpp/scanner/target -name wayland-scanner -type f | head -1)
"$scanner" -s public-code protocol/wayland.xml /tmp/wayland-protocol.c
head -1 /tmp/wayland-protocol.c
grep -q 'Generated by wayland-scanner 1.23.1' /tmp/wayland-protocol.c
- name: both libraries carry the canonical SONAMEs
run: |
for pair in "client:libwayland-client.so.0" "server:libwayland-server.so.0"; do
member=${pair%%:*}; want=${pair#*:}
so=$(find "mcpp/$member/target" -name "${want%.0}" -type f | head -1)
test -n "$so" || { echo "$member: no library built"; exit 1; }
got=$(readelf -d "$so" | sed -n 's/.*SONAME.*\[\(.*\)\]/\1/p')
echo "$member -> $got"
test "$got" = "$want" || { echo "expected $want"; exit 1; }
done
- name: the two libraries do not overlap
run: |
# Mesa's libEGL_mesa has DT_NEEDED on both; if one carried the
# other's API the process would resolve it to whichever loaded
# first. wl_display_create is server-only, wl_display_connect
# client-only.
c=$(find mcpp/client/target -name libwayland-client.so -type f | head -1)
s=$(find mcpp/server/target -name libwayland-server.so -type f | head -1)
readelf --dyn-syms -W "$c" | grep -q ' wl_display_connect' || exit 1
readelf --dyn-syms -W "$c" | grep -q ' wl_display_create' && { echo "client leaked the server API"; exit 1; }
readelf --dyn-syms -W "$s" | grep -q ' wl_display_create' || exit 1
readelf --dyn-syms -W "$s" | grep -q ' wl_display_connect' && { echo "server leaked the client API"; exit 1; }
echo "client and server APIs are disjoint"
- name: upstream's own build still works
run: |
# The fork patches no upstream file, so meson must still be able to
# build this tree. If this breaks, something was modified that should
# not have been.
sudo apt-get update -qq
sudo apt-get install -y -qq meson ninja-build libffi-dev libexpat1-dev
meson setup build-meson -Ddocumentation=false -Ddtd_validation=false
ninja -C build-meson