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
|
restore_registry: &RESTORE_REGISTRY
restore_cache:
key: registry-4
save_registry: &SAVE_REGISTRY
save_cache:
key: registry-4-{{ .BuildNum }}
paths:
- /usr/local/cargo/registry/index
openssl_key: &OPENSSL_KEY
key: lib-{{ checksum "~/lib_key" }}-{{ checksum "test/build_openssl.sh" }}
restore_openssl: &RESTORE_OPENSSL
restore_cache:
<<: *OPENSSL_KEY
save_openssl: &SAVE_OPENSSL
save_cache:
<<: *OPENSSL_KEY
paths:
- /openssl
deps_key: &DEPS_KEY
key: deps-1.20.0-{{ checksum "Cargo.lock" }}-{{ checksum "~/lib_key" }}-2
restore_deps: &RESTORE_DEPS
restore_cache:
<<: *DEPS_KEY
save_deps: &SAVE_DEPS
save_cache:
<<: *DEPS_KEY
paths:
- target
- /usr/local/cargo/registry/cache
job: &JOB
working_directory: ~/build
docker:
- image: rust:1.20.0
steps:
- checkout
- run: apt-get update
- run: apt-get remove -y libssl-dev
- run: ./test/add_target.sh
- *RESTORE_REGISTRY
- run: cargo generate-lockfile --verbose
- *SAVE_REGISTRY
- run: echo "${LIBRARY}-${VERSION}-${TARGET}" > ~/lib_key
- *RESTORE_OPENSSL
- run: ./test/build_openssl.sh
- *SAVE_OPENSSL
- *RESTORE_DEPS
- run: cargo run --manifest-path=systest/Cargo.toml --target $TARGET --features "$FEATURES"
- run: |
ulimit -c unlimited
export PATH=$OPENSSL_DIR/bin:$PATH
if [ "${NO_RUN}" = "1" ]; then
TEST_ARGS=--no-run
fi
cargo test \
--manifest-path=openssl/Cargo.toml \
--target $TARGET \
--features "$FEATURES" \
$TEST_ARGS
- run:
command: |
mkdir -p /tmp/core_dumps
find . -name "core.*" -exec cp \{\} /tmp/core_dumps \;
cp target/$TARGET/debug/openssl-* /tmp/core_dumps
when: on_fail
- store_artifacts:
path: /tmp/core_dumps
- *SAVE_DEPS
macos_job: &MACOS_JOB
macos:
xcode: "9.0"
steps:
- checkout
- run: sudo mkdir /opt
- run: sudo chown -R $USER /usr/local /opt
- run: curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.20.0
- run: sudo ln -s $CARGO_HOME/bin/* /usr/local/bin
- *RESTORE_REGISTRY
- run: cargo generate-lockfile --verbose
- *SAVE_REGISTRY
- run: echo "homebrew-x86_64-apple-darwin" > ~/lib_key
- *RESTORE_DEPS
- run: cargo run --manifest-path=systest/Cargo.toml --features "$FEATURES"
- run: |
PATH=/usr/local/opt/openssl/bin:$PATH
cargo test --manifest-path=openssl/Cargo.toml --features "$FEATURES"
- *SAVE_DEPS
macos_env: &MACOS_ENV
RUSTUP_HOME: /usr/local/rustup
CARGO_HOME: /usr/local/cargo
vendored: &VENDORED
FEATURES: vendored
LIBRARY: ""
openssl_111: &OPENSSL_111
LIBRARY: openssl
VERSION: 1.1.1-pre8
openssl_110: &OPENSSL_110
LIBRARY: openssl
VERSION: 1.1.0h
openssl_102: &OPENSSL_102
LIBRARY: openssl
VERSION: 1.0.2o
openssl_101: &OPENSSL_101
LIBRARY: openssl
VERSION: 1.0.1u
libressl_250: &LIBRESSL_250
LIBRARY: libressl
VERSION: 2.5.0
libressl_270: &LIBRESSL_272
LIBRARY: libressl
VERSION: 2.7.2
x86_64: &X86_64
TARGET: x86_64-unknown-linux-gnu
musl: &MUSL
TARGET: x86_64-unknown-linux-musl
i686: &I686
TARGET: i686-unknown-linux-gnu
armhf: &ARMHF
TARGET: arm-unknown-linux-gnueabihf
NO_RUN: 1
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_AR: arm-linux-gnueabihf-ar
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUNNER: qemu-arm-static
darwin: &DARWIN
TARGET: x86_64-apple-darwin
base: &BASE
RUST_BACKTRACE: 1
OPENSSL_DIR: /openssl
version: 2
jobs:
musl-vendored:
<<: *JOB
docker:
- image: rust:1.21.0
environment:
<<: [*VENDORED, *MUSL, *BASE]
x86_64-vendored:
<<: *JOB
environment:
<<: [*VENDORED, *X86_64, *BASE]
x86_64-openssl-1.1.1:
<<: *JOB
environment:
<<: [*OPENSSL_111, *X86_64, *BASE]
x86_64-openssl-1.1.0:
<<: *JOB
environment:
<<: [*OPENSSL_110, *X86_64, *BASE]
x86_64-openssl-1.0.2:
<<: *JOB
environment:
<<: [*OPENSSL_102, *X86_64, *BASE]
x86_64-openssl-1.0.1:
<<: *JOB
environment:
<<: [*OPENSSL_101, *X86_64, *BASE]
i686-vendored:
<<: *JOB
environment:
<<: [*VENDORED, *I686, *BASE]
i686-openssl-1.1.1:
<<: *JOB
environment:
<<: [*OPENSSL_111, *I686, *BASE]
i686-openssl-1.1.0:
<<: *JOB
environment:
<<: [*OPENSSL_110, *I686, *BASE]
i686-openssl-1.0.2:
<<: *JOB
environment:
<<: [*OPENSSL_102, *I686, *BASE]
armhf-vendored:
<<: *JOB
environment:
<<: [*VENDORED, *ARMHF, *BASE]
armhf-openssl-1.1.1:
<<: *JOB
environment:
<<: [*OPENSSL_111, *ARMHF, *BASE]
armhf-openssl-1.1.0:
<<: *JOB
environment:
<<: [*OPENSSL_110, *ARMHF, *BASE]
armhf-openssl-1.0.2:
<<: *JOB
environment:
<<: [*OPENSSL_102, *ARMHF, *BASE]
x86_64-libressl-2.5.0:
<<: *JOB
environment:
<<: [*LIBRESSL_250, *X86_64, *BASE]
x86_64-libressl-2.7.2:
<<: *JOB
environment:
<<: [*LIBRESSL_272, *X86_64, *BASE]
macos:
<<: *MACOS_JOB
environment:
<<: [*MACOS_ENV]
macos-vendored:
<<: *MACOS_JOB
environment:
<<: [*VENDORED, *MACOS_ENV]
workflows:
version: 2
tests:
jobs:
- musl-vendored
- x86_64-vendored
- x86_64-openssl-1.1.1
- x86_64-openssl-1.1.0
- x86_64-openssl-1.0.2
- x86_64-openssl-1.0.1
- i686-vendored
- i686-openssl-1.1.1
- i686-openssl-1.1.0
- i686-openssl-1.0.2
- armhf-vendored
- armhf-openssl-1.1.1
- armhf-openssl-1.1.0
- armhf-openssl-1.0.2
- x86_64-libressl-2.5.0
- x86_64-libressl-2.7.2
- macos
- macos-vendored
|