-
Notifications
You must be signed in to change notification settings - Fork 246
283 lines (264 loc) · 9.25 KB
/
main.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
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
rust: stable
- os: ubuntu-20.04
rust: beta
- os: ubuntu-20.04
rust: nightly
- os: ubuntu-24.04
rust: stable
- os: ubuntu-24.04
rust: beta
- os: ubuntu-24.04
rust: nightly
- os: macos-latest
rust: stable
- os: macos-latest
rust: nightly
- os: windows-latest
rust: stable-x86_64-msvc
- os: windows-latest
rust: stable-i686-msvc
- os: windows-latest
rust: stable-x86_64-gnu
- os: windows-latest
rust: nightly-x86_64-msvc
- os: windows-latest
rust: nightly-i686-msvc
- os: windows-latest
rust: nightly-x86_64-gnu
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust (rustup)
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
shell: bash
- run: echo RUSTFLAGS=-Dwarnings >> $GITHUB_ENV
shell: bash
# full fidelity of backtraces on 32-bit msvc requires frame pointers, so
# enable that for our tests
- name: Force frame pointers
run: echo RUSTFLAGS="-Cforce-frame-pointers $RUSTFLAGS" >> $GITHUB_ENV
shell: bash
if: contains(matrix.rust, 'i686')
# Starting with Ubuntu 22.04 libc6-dbg is needed.
- name: Install libc debug info
run: sudo apt-get install -y libc6-dbg
shell: bash
if: contains(matrix.os, 'ubuntu-24.04')
- name: Enable collapse_debuginfo based on version
run: echo RUSTFLAGS="--cfg dbginfo=\"collapsible\" $RUSTFLAGS" >> $GITHUB_ENV
shell: bash
if: contains(matrix.rust, 'nightly') || contains(matrix.rust, 'beta')
- run: cargo build
- run: cargo test
- run: cargo test --features "serialize-serde"
- run: cargo test --features "cpp_demangle"
- run: cargo test --no-default-features
- run: cargo test --no-default-features --features "std"
- run: cargo test --manifest-path crates/cpp_smoke_test/Cargo.toml
# This test is specifically about packed debuginfo with `*.dSYM` files
- run: cargo test --manifest-path crates/macos_frames_test/Cargo.toml
env:
CARGO_PROFILE_DEV_SPLIT_DEBUGINFO: packed
CARGO_PROFILE_TEST_SPLIT_DEBUGINFO: packed
- run: cargo test --manifest-path crates/without_debuginfo/Cargo.toml
- run: cargo test --manifest-path crates/line-tables-only/Cargo.toml
# Test debuginfo compression still works
- run: cargo test
if: contains(matrix.os, 'ubuntu')
env:
RUSTFLAGS: "-C link-arg=-Wl,--compress-debug-sections=zlib"
- run: cargo test
if: contains(matrix.os, 'ubuntu-24.04') ||
(contains(matrix.os, 'ubuntu') && contains(matrix.rust, 'nightly'))
env:
RUSTFLAGS: "-C link-arg=-Wl,--compress-debug-sections=zstd"
# Test that, on macOS, packed/unpacked debuginfo both work
- run: cargo clean && cargo test
# Test that, on macOS, packed/unpacked debuginfo both work
if: matrix.os == 'macos-latest'
env:
CARGO_PROFILE_DEV_SPLIT_DEBUGINFO: unpacked
CARGO_PROFILE_TEST_SPLIT_DEBUGINFO: unpacked
- run: cargo clean && cargo test
if: matrix.os == 'macos-latest'
env:
CARGO_PROFILE_DEV_SPLIT_DEBUGINFO: packed
CARGO_PROFILE_TEST_SPLIT_DEBUGINFO: packed
# Test that, on macOS, binaries with no UUID work
- run: cargo clean && cargo test
if: matrix.os == 'macos-latest'
env:
RUSTFLAGS: "-C link-arg=-Wl,-no_uuid"
# Test that, on Linux, packed/unpacked debuginfo both work
- run: cargo clean && cargo test
if: matrix.rust == 'nightly'
env:
RUSTFLAGS: "-C split-debuginfo=unpacked -Zunstable-options"
- run: cargo clean && cargo test
if: matrix.rust == 'nightly'
env:
RUSTFLAGS: "-C split-debuginfo=packed -Zunstable-options"
# Test that separate debug info works
- run: ./ci/debuglink-docker.sh
if: contains(matrix.os, 'ubuntu')
# Test that backtraces are still symbolicated if we don't embed an absolute
# path to the PDB file in the binary.
# Add -Cforce-frame-pointers for stability. The test otherwise fails
# non-deterministically on i686-pc-windows-msvc because the stack cannot be
# unwound reliably. This failure is not related to the feature being tested.
- run: cargo clean && cargo test
if: contains(matrix.rust, 'msvc')
name: "Test that backtraces are symbolicated without absolute PDB path"
env:
RUSTFLAGS: "-Clink-arg=/PDBALTPATH:%_PDB% -Cforce-frame-pointers"
# Test that including as a submodule will still work, both with and without
# the `backtrace` feature enabled.
- run: cargo build --manifest-path crates/as-if-std/Cargo.toml
- run: cargo build --manifest-path crates/as-if-std/Cargo.toml --no-default-features
windows_arm64:
name: Windows AArch64
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust
run: rustup update stable --no-self-update && rustup default stable
shell: bash
- run: echo RUSTFLAGS=-Dwarnings >> $GITHUB_ENV
shell: bash
- run: rustup target add aarch64-pc-windows-msvc
- run: cargo test --no-run --target aarch64-pc-windows-msvc
ios:
name: iOS
runs-on: macos-latest
strategy:
matrix:
include:
- target: aarch64-apple-ios
sdk: iphoneos
- target: x86_64-apple-ios
sdk: iphonesimulator
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: rustup target add ${{ matrix.target }}
- run: |
export RUSTFLAGS=-Dwarnings
export SDK_PATH=`xcrun --show-sdk-path --sdk ${{ matrix.sdk }}`
export RUSTFLAGS="-C link-arg=-isysroot -C link-arg=$SDK_PATH"
cargo test --no-run --target ${{ matrix.target }}
name: Build tests
docker:
name: Docker
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
target:
- aarch64-unknown-linux-gnu
- arm-unknown-linux-gnueabihf
- armv7-unknown-linux-gnueabihf
- i586-unknown-linux-gnu
- i686-unknown-linux-gnu
- powerpc64-unknown-linux-gnu
- s390x-unknown-linux-gnu
- x86_64-pc-windows-gnu
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- arm-linux-androideabi
- armv7-linux-androideabi
- aarch64-linux-android
- i686-linux-android
- x86_64-linux-android
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust
run: rustup update stable --no-self-update && rustup default stable
- run: rustup target add ${{ matrix.target }}
- run: cargo generate-lockfile
- run: echo RUSTFLAGS=-Dwarnings >> $GITHUB_ENV
shell: bash
- run: ./ci/run-docker.sh ${{ matrix.target }}
rustfmt:
name: Rustfmt
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust
run: rustup update stable --no-self-update && rustup default stable && rustup component add rustfmt
- run: cargo fmt --all -- --check
build:
name: Build Targets
runs-on: ubuntu-20.04
strategy:
matrix:
target:
- wasm32-unknown-unknown
- wasm32-wasi
- x86_64-unknown-fuchsia
- x86_64-fortanix-unknown-sgx
- x86_64-unknown-illumos
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust
run: rustup update nightly --no-self-update && rustup default nightly
- run: rustup target add ${{ matrix.target }}
- run: echo RUSTFLAGS=-Dwarnings >> $GITHUB_ENV
shell: bash
- run: cargo build --target ${{ matrix.target }}
- run: cargo build --manifest-path crates/as-if-std/Cargo.toml --target ${{ matrix.target }}
msrv:
name: MSRV
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
- os: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Rust
run: rustup update 1.73.0 --no-self-update && rustup default 1.73.0
- run: cargo build
miri:
name: Miri
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Miri
run: |
rustup toolchain install nightly --component miri
rustup override set nightly
cargo miri setup
- run: MIRIFLAGS="-Zmiri-disable-isolation" cargo miri test