-
Notifications
You must be signed in to change notification settings - Fork 3.2k
/
config.yml
418 lines (408 loc) · 15 KB
/
config.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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
defaults: &defaults
docker:
- image: buildpack-deps:xenial
environment:
LANG: C.UTF-8
EMTEST_DETECT_TEMPFILE_LEAKS: 1
test-defaults: &test-defaults
<<: *defaults
working_directory: ~/
steps:
- checkout:
path: emscripten/
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: ~/
- run:
name: install package dependencies
command: |
apt-get update -q
# openjdk-9 is also available, but hits #7232
apt-get install -q -y python3 cmake build-essential openjdk-8-jre-headless
- run:
name: run tests
command: |
EMCC_CORES=4 python3 emscripten/tests/runner.py $TEST_TARGET
test-firefox: &test-firefox
<<: *defaults
environment:
working_directory: ~/
steps:
- checkout:
path: emscripten/
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: ~/
- run:
name: install package dependencies
command: |
apt-get update -q
apt-get install -q -y python3 cmake build-essential openjdk-8-jre-headless
# preseed packages so that apt-get won't prompt for user input
echo "keyboard-configuration keyboard-configuration/layoutcode string us" | debconf-set-selections
echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections
apt-get install -q -y dbus-x11 firefox menu openbox ttf-mscorefonts-installer xinit xserver-xorg xserver-xorg-video-dummy
- run:
name: download firefox
command: |
FF_VERSION=68.0
wget https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FF_VERSION/linux-x86_64/en-US/firefox-$FF_VERSION.tar.bz2
tar xf firefox-$FF_VERSION.tar.bz2
# wget -O nightly.tar.bz2 "https://download.mozilla.org/?product=firefox-nightly-latest-ssl&os=linux64&lang=en-US"
# tar xf nightly.tar.bz2
- run:
name: configure firefox
command: |
mkdir tmp-firefox-profile/
cat > tmp-firefox-profile/user.js <<EOF
user_pref("gfx.offscreencanvas.enabled", true);
user_pref("javascript.options.shared_memory", true);
EOF
- run:
name: configure openbox
command: |
# Set up X and Openbox config (if we move to a headless browser, this may not be needed).
mkdir -p .config/X11
cat > .config/X11/xorg.conf <<EOF
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
EndSection
Section "Monitor"
Identifier "Monitor0"
HorizSync 72
Modeline "1920x1080@60" 144 1920 1920 1960 2000 1080 1080 1140 1200
EndSection
Section "Device"
Identifier "Card0"
Driver "dummy"
VideoRam 1048576
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1920x1080@60"
EndSubSection
EndSection
EOF
mkdir -p .config/openbox
echo "[ -f \"\$EXTRA_AUTOSTART\" ] && sh \"\$EXTRA_AUTOSTART\"" > .config/openbox/autostart
mkdir -p .config/autostart
cat > .config/autostart/at-spi-dbus-bus.desktop <<EOF
[Desktop Entry]
Type=Application
Name=AT-SPI D-Bus Bus
Hidden=true # do not auto-start AT-SPI to suppress one warning
EOF
- run:
# browser.test_sdl2_mouse and/or SDL2 should be fixed. The case happens
# to be failing here, and the root cause might be related with the
# initial position of the mouse pointer relative to the canvas.
# browser.test_html5_webgl_create_context is skipped because
# anti-aliasing is not well supported.
# browser.test_webgl_offscreen_canvas_in_pthread and
# browser.test_webgl_offscreen_canvas_in_mainthread_after_pthread
# are crashing Firefox (bugzil.la/1281796). The former case is
# further blocked by issue #6897.
# TODO: use Firefox headless mode when https://bugzil.la/1375585 resolves
name: run tests
command: |
export EMTEST_BROWSER="$HOME/firefox/firefox -profile tmp-firefox-profile/"
export GALLIUM_DRIVER=softpipe # TODO: use the default llvmpipe when it supports more extensions
export EMTEST_LACKS_SOUND_HARDWARE=1
export EMTEST_DETECT_TEMPFILE_LEAKS=0
export DISPLAY=:0
# Start an X session. Openbox might be optional for now, but
# an ICCCM/EWMH compliant window manager is potentially needed
# for tests with fullscreen toggling (if we move to a headless
# browser, this may not be needed eventually).
TMPDIR=`mktemp -d`
mkfifo $TMPDIR/fifo
echo "echo -n > $TMPDIR/fifo" > $TMPDIR/autostart
EXTRA_AUTOSTART=$TMPDIR/autostart startx /usr/bin/openbox-session -- $DISPLAY -config ~/.config/X11/xorg.conf -nolisten tcp &
cat $TMPDIR/fifo > /dev/null # wait until $EXTRA_AUTOSTART is spawned, which indicates the end of Openbox initialization
rm -r $TMPDIR
export EMCC_CORES=4
./emscripten/tests/runner.py browser skip:browser.test_sdl2_mouse skip:browser.test_html5_webgl_create_context skip:browser.test_webgl_offscreen_canvas_in_pthread skip:browser.test_webgl_offscreen_canvas_in_mainthread_after_pthread skip:browser.test_glut_glutget
openbox --exit
wait # wait for startx to shutdown cleanly
test-chrome: &test-chrome
<<: *defaults
environment:
- EMTEST_LACKS_SOUND_HARDWARE=1
- EMTEST_DETECT_TEMPFILE_LEAKS=0
working_directory: ~/
steps:
- checkout:
path: emscripten/
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: ~/
- run:
name: install package dependencies
command: |
apt-get update -q
# install chromium-browser temporarily in order to ensure we have most of the
# dependecies for chrome.
EXTRA_CHROME_DEPS="lsb-release fonts-liberation libappindicator3-1"
apt-get install -q -y unzip xvfb chromium-browser openjdk-8-jre-headless $EXTRA_CHROME_DEPS
apt-get remove -q -y chromium-browser
- run:
name: download chrome
command: |
wget https://dl.google.com/linux/direct/google-chrome-unstable_current_amd64.deb
dpkg -i google-chrome-unstable_current_amd64.deb
- run:
name: run tests
command: |
# --no-sandbox becasue we are running as root and chrome requires
# this flag for now: https://crbug.com/638180
CHROME_FLAGS_BASE="--no-first-run -start-maximized --no-sandbox --use-gl=swiftshader --javascript-harmony --enable-experimental-web-platform-features"
CHROME_FLAGS_WASM="--enable-features=WebAssembly --enable-features=SharedArrayBuffer --disable-features=WebAssemblyTrapHandler --js-flags=\"--experimental-wasm-threads --harmony-sharedarraybuffer --no-wasm-disable-structured-cloning\""
export EMTEST_BROWSER="xvfb-run -a -e /dev/stdout /usr/bin/google-chrome-stable $CHROME_FLAGS_BASE $CHROME_FLAGS_WASM"
export EMTEST_LACKS_GRAPHICS_HARDWARE=1
export EMCC_CORES=4
./emscripten/tests/runner.py browser
version: 2
jobs:
build:
<<: *defaults
working_directory: ~/
steps:
- checkout:
path: emscripten/
- run:
name: install package dependencies
command: |
apt-get update -q
apt-get install -q -y python3 cmake
- run:
name: install emsdk
command: |
wget https://github.com/juj/emsdk/archive/master.tar.gz
tar -xf master.tar.gz
cd emsdk-master
./emsdk --notty update-tags
./emsdk --notty install tot-fastcomp
./emsdk --notty activate tot-fastcomp
# Remove the emsdk version of emscripten to save space in the
# persistent workspace and to avoid any confusion with the version
# we are trying to test.
rm -Rf `find -name emscripten`
cd -
echo "final .emscripten:"
cat ~/.emscripten
- run:
name: embuilder build ALL
command: |
EMCC_CORES=4 python3 ~/emscripten/embuilder.py build ALL
python3 ~/emscripten/tests/runner.py test_hello_world
- run:
name: freeze cache
command: |
echo "FROZEN_CACHE=True" >> ~/.emscripten
- persist_to_workspace:
# Must be an absolute path, or relative path from working_directory
root: ~/
# Must be relative path from root
paths:
- emsdk-master/
- .emscripten_cache/
- .emscripten_ports/
- .emscripten
build-docs:
<<: *defaults
steps:
- checkout
- run:
name: install pip
command: |
apt-get update -q
apt-get install -q -y python-pip
- run:
name: install sphinx
command: |
pip install sphinx==1.7.8
- run: make -C site html
flake8:
<<: *defaults
steps:
- checkout
- run:
name: install pip
command: |
apt-get update -q
apt-get install -q -y python-pip
- run: pip install flake8==3.4.1
- run: flake8
test-other:
<<: *test-defaults
environment:
- TEST_TARGET=other skip:other.test_native_link_error_message skip:other.test_emcc_v
# some native-dependent tests fail because of the lack of native headers on emsdk-bundled clang
# CircleCI actively kills memory-over-consuming process
# skip llvm-lit tests which need lit, and pip to get lit, but pip has broken on CI
test-browser-firefox:
<<: *test-firefox
test-browser-chrome:
<<: *test-chrome
test-ab:
<<: *test-defaults
environment:
- TEST_TARGET=asm*.test_a* asm*.test_b*
test-c:
<<: *test-defaults
environment:
- TEST_TARGET=asm*.test_c*
test-d:
<<: *test-defaults
environment:
- TEST_TARGET=default.test_d* asm1.test_d* asm2.test_d* asm2g.test_d* asm3.test_d*
test-e:
<<: *test-defaults
environment:
- TEST_TARGET=asm*.test_e*
test-f:
<<: *test-defaults
environment:
- TEST_TARGET=asm*.test_f*
test-ghi:
<<: *test-defaults
environment:
- TEST_TARGET=asm*.test_g* asm*.test_h* asm*.test_i*
test-jklmno:
<<: *test-defaults
environment:
- TEST_TARGET=asm*.test_j* asm*.test_k* asm*.test_l* asm*.test_m* asm*.test_n* asm*.test_o*
test-p:
<<: *test-defaults
environment:
- TEST_TARGET=default.test_p* asm1.test_p* asm2.test_p* asm2g.test_p* asm3.test_p*
test-qrst:
<<: *test-defaults
environment:
- TEST_TARGET=asm*.test_q* asm*.test_r* asm*.test_s* asm*.test_t*
test-uvwxyz:
<<: *test-defaults
environment:
- TEST_TARGET=asm*.test_u* asm*.test_w* asm*.test_v* asm*.test_x* asm*.test_y* asm*.test_z*
test-wasm0:
<<: *test-defaults
environment:
- TEST_TARGET=wasm0
test-wasm1:
<<: *test-defaults
environment:
- TEST_TARGET=wasm1
test-wasm2:
<<: *test-defaults
environment:
- TEST_TARGET=wasm2
test-wasm3:
<<: *test-defaults
environment:
- TEST_TARGET=wasm3
test-sanity:
<<: *test-defaults
environment:
- TEST_TARGET=sanity
build-upstream:
<<: *defaults
working_directory: ~/
steps:
- checkout:
path: emscripten/
- run:
name: install package dependencies
command: |
apt-get update -q
apt-get install -q -y python3 cmake
- run:
name: install emsdk
command: |
wget https://github.com/juj/emsdk/archive/master.tar.gz
tar -xf master.tar.gz
cd emsdk-master
./emsdk --notty update-tags
./emsdk --notty install tot-upstream
./emsdk --notty activate tot-upstream
# Remove the emsdk version of emscripten to save space in the
# persistent workspace and to avoid any confusion with the version
# we are trying to test.
rm -Rf `find -name "emscripten"`
cd -
echo "final .emscripten:"
cat ~/.emscripten
- run:
name: embuilder build ALL
command: |
EMCC_CORES=4 python3 ~/emscripten/embuilder.py build ALL
python3 ~/emscripten/tests/runner.py test_hello_world
- run:
name: embuilder (LTO)
command: |
EMCC_CORES=4 python3 ~/emscripten/embuilder.py build libcompiler_rt libc libc++abi libc++ libc++-noexcept libal libdlmalloc libpthreads_stub libcompiler_rt_wasm libc_rt_wasm struct_info libc-wasm --lto
python3 ~/emscripten/tests/runner.py test_hello_world
- run:
name: embuilder (PIC)
command: |
EMCC_CORES=4 python3 ~/emscripten/embuilder.py build SYSTEM --pic
python3 ~/emscripten/tests/runner.py test_hello_world
- run:
name: embuilder (PIC+LTO)
command: |
EMCC_CORES=4 python3 ~/emscripten/embuilder.py build libcompiler_rt libc libc++abi libc++ libc++-noexcept libal libdlmalloc libpthreads_stub libcompiler_rt_wasm libc_rt_wasm struct_info libc-wasm --pic --lto
python3 ~/emscripten/tests/runner.py test_hello_world
- run:
name: freeze cache
command: |
echo "FROZEN_CACHE=True" >> ~/.emscripten
- persist_to_workspace:
# Must be an absolute path, or relative path from working_directory
root: ~/
# Must be relative path from root
paths:
- emsdk-master/
- .emscripten_cache/
- .emscripten_ports/
- .emscripten
test-upstream-wasm0:
<<: *test-defaults
environment:
- TEST_TARGET=wasm0
test-upstream-wasm2:
<<: *test-defaults
environment:
- TEST_TARGET=wasm2 wasm3.test_llvm_used
# TODO: test all of wasm3/wasms on LLVM wasm backend
test-upstream-other:
<<: *test-defaults
environment:
- TEST_TARGET=other skip:other.test_native_link_error_message skip:other.test_emcc_v
# see explanations in the fastcomp skips for these, earlier
test-upstream-browser-chrome:
<<: *test-chrome
test-upstream-browser-firefox:
<<: *test-firefox
workflows:
version: 2
build-test:
jobs:
- build
- test-browser-firefox:
requires:
- build
- test-browser-chrome:
requires:
- build
- build-upstream
- test-upstream-browser-chrome:
requires:
- build-upstream
- test-upstream-browser-firefox:
requires:
- build-upstream