Repository navigation
180 lines (170 loc) · 7.82 KB
/
Copy pathci.yml
File metadata and controls
180 lines (170 loc) · 7.82 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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
# SEVEN ROWS, NOT ONE. "Cortex-M" is not an instruction set: an object built
# for `thumbv7em` uses instructions a Cortex-M0 does not have, and the failures
# this package can have are per-profile — Thumb-2 assembly on a Thumb-1 core,
# VFP assembly on a core with no FPU. A job that built one row would be green
# while six were broken.
jobs:
build:
name: builds for every M-profile row
runs-on: ubuntu-24.04
timeout-minutes: 45
env:
# The release carrying the Cortex-M target rows and the tool tiers.
MCPP_VERSION: 2026.9.4.2
XLINGS_VERSION: v2026.8.17.2
XLINGS_NON_INTERACTIVE: '1'
steps:
- uses: actions/checkout@v4
- name: Install xlings
run: |
curl -fsSL https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh \
| bash -s "$XLINGS_VERSION"
echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH"
- name: Install mcpp
run: |
# A loop, because one `xlings update` can return a stale index without
# saying so: the pointer propagates asynchronously after a bump merges.
for attempt in 1 2 3 4 5 6; do
xlings update > /dev/null 2>&1 || true
if xlings install "mcpp@$MCPP_VERSION" -y -g; then break; fi
if [ "$attempt" = 6 ]; then
echo "::error::mcpp@$MCPP_VERSION never appeared in the index"
exit 1
fi
sleep 60
done
mcpp --version
mcpp self config --mirror GLOBAL
- name: Every M-profile row builds
run: |
set -euo pipefail
n=0
for t in thumbv6m-none-eabi thumbv7m-none-eabi thumbv7em-none-eabi \
thumbv7em-none-eabihf thumbv8m.base-none-eabi \
thumbv8m.main-none-eabi thumbv8m.main-none-eabihf; do
rm -rf target
mcpp build --target "$t" > /dev/null 2>&1 || true
mcpp build --target "$t" || { echo "::error::$t does not build"; exit 1; }
echo " ok $t"
n=$((n+1))
done
# A count, because a loop that ran zero times also reaches this line.
[ "$n" = "7" ] || { echo "::error::built $n rows, expected 7"; exit 1; }
ios:
name: builds for the iOS simulator rows
runs-on: macos-15
timeout-minutes: 40
env:
MCPP_VERSION: 2026.9.13.1
XLINGS_VERSION: v2026.9.12.1
XLINGS_NON_INTERACTIVE: '1'
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Install xlings
run: |
curl -fsSL --retry 3 --retry-all-errors --retry-delay 2 \
https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh \
| bash -s "$XLINGS_VERSION"
echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH"
- name: Install mcpp
run: |
for attempt in 1 2 3 4 5 6; do
xlings update > /dev/null 2>&1 || true
if xlings install "mcpp@$MCPP_VERSION" -y -g; then break; fi
if [ "$attempt" = 6 ]; then
echo "::error::mcpp@$MCPP_VERSION never appeared in the index"
exit 1
fi
sleep 60
done
mcpp --version
mcpp self config --mirror GLOBAL
# THE UNIT THAT DEFINES `__isPlatformVersionAtLeast` IS IN THE OBJECTS.
# A build that succeeds can leave the routine out (it compiles to nothing
# where `__APPLE__` is not defined), so the symbol is read from the
# archive rather than assumed from the exit status.
- name: Both simulator rows build and define the availability routine
run: |
set -euo pipefail
n=0
for t in aarch64-ios-sim x86_64-ios-sim; do
rm -rf target
mcpp build --target "$t" || { echo "::error::$t does not build"; exit 1; }
lib=$(find target/"$t" -name 'libcompiler-rt-builtins.a' | head -1)
[ -n "$lib" ] || { echo "::error::$t produced no archive"; exit 1; }
# Read into a variable first: under `pipefail` a `grep -q` that
# closes its input early turns nm's SIGPIPE into a failed pipeline,
# and the step reports a symbol as missing while printing it.
symbols=$(nm "$lib")
# The availability routine, and the five generic routines the
# M-profile rows supersede with assembly (`comparesf2.c` defines `__ltsf2`
# and its siblings, not a `__comparesf2`), which this package's own
# objects call and which a build (no link) cannot miss on its own.
for sym in ___isPlatformVersionAtLeast ___addsf3 ___ltsf2 ___divsi3 ___mulsf3 ___udivsi3; do
grep -q " T $sym\$" <<<"$symbols" \
|| { echo "::error::$t archive lacks $sym"; grep -iE "platform|sf3|si3|sf2" <<<"$symbols" || true; exit 1; }
done
# AND NO SYMBOL DEFINED TWICE: a unit that replaces a generic one
# must displace it, or a consumer's link reports a duplicate.
dups=$(grep ' T ' <<<"$symbols" | awk '{print $NF}' | sort | uniq -d)
[ -z "$dups" ] || { echo "::error::$t archive defines a symbol twice:"; echo "$dups"; exit 1; }
echo " ok $t"
n=$((n+1))
done
[ "$n" = "2" ] || { echo "::error::built $n rows, expected 2"; exit 1; }
# THE OK-IMAGE ROWS (`<arch>-openkal`, openkal SPEC clause 12), with the
# mcpp that has the target until it is released. The 128-bit routines are
# in the AArch64 archive (a `long double` is 128 bits there) and the 80-bit
# complex multiply in the x86_64 one, each read back from the archive.
openkal:
name: builds for the ok-image rows
runs-on: ubuntu-24.04
timeout-minutes: 60
env:
MCPP_SOURCE_REF: release/2026.10.26.2
XLINGS_VERSION: v2026.10.26.1
XLINGS_NON_INTERACTIVE: '1'
steps:
- uses: actions/checkout@v4
- name: Install xlings
run: |
curl -fsSL --retry 3 --retry-all-errors --retry-delay 2 \
https://raw.githubusercontent.com/openxlings/xlings/main/tools/other/quick_install.sh \
| bash -s "$XLINGS_VERSION"
echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH"
- name: The mcpp that has the target
run: |
xlings update > /dev/null 2>&1 || true
xlings install mcpp -y -g
mcpp self config --mirror GLOBAL
src="$RUNNER_TEMP/mcpp-src"
git clone --quiet --depth 1 --branch "$MCPP_SOURCE_REF" https://github.com/mcpp-community/mcpp.git "$src"
rm -f "$src/.xlings.json"
( cd "$src" && mcpp build --release )
built=$(find "$src/target" -type f -name mcpp | head -1)
[ -n "$built" ] || { echo "::error::mcpp did not build"; exit 1; }
echo "$(cd "$(dirname "$built")" && pwd)" >> "$GITHUB_PATH"
- name: Both rows build and define their wide routines
run: |
set -euo pipefail
for pair in "x86_64-openkal:__mulxc3" "aarch64-openkal:__multf3"; do
t="${pair%%:*}"; sym="${pair#*:}"
rm -rf target
mcpp build --target "$t" || { echo "::error::$t does not build"; exit 1; }
lib=$(find target/"$t" -name 'libcompiler-rt-builtins.a' | head -1)
[ -n "$lib" ] || { echo "::error::$t produced no archive"; exit 1; }
symbols=$(llvm-nm "$lib" 2>/dev/null || nm "$lib")
grep -q " T $sym\$" <<<"$symbols" || { echo "::error::$t archive lacks $sym"; exit 1; }
dups=$(grep ' T ' <<<"$symbols" | awk '{print $NF}' | sort | uniq -d)
[ -z "$dups" ] || { echo "::error::$t archive defines a symbol twice:"; echo "$dups"; exit 1; }
echo " ok $t ($sym)"
done