forked from emscripten-core/emscripten
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.yml
More file actions
638 lines (629 loc) · 22 KB
/
config.yml
File metadata and controls
638 lines (629 loc) · 22 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
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
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
version: 2.1
orbs:
win: circleci/windows@1.0.0
executors:
bionic:
docker:
- image: emscripten/emscripten-ci
environment:
LANG: "C.UTF-8"
EMTEST_DETECT_TEMPFILE_LEAKS: "1"
EMCC_CORES: "4"
EMSDK_NOTTY: "1"
PYTHON_BIN: "python3"
mac:
environment:
EMSDK_NOTTY: "1"
PYTHON_BIN: "python3"
macos:
xcode: "9.0"
commands:
npm-install:
description: "npm ci"
steps:
- run:
name: npm ci
command: |
# Will add emsdk version of node to PATH
source ~/emsdk-master/emsdk_env.sh
npm ci
build-upstream:
description: "Install emsdk build all libraries using embuilder"
steps:
- run:
name: install emsdk
command: |
curl -# -L -o ~/emsdk-master.tar.gz https://github.com/emscripten-core/emsdk/archive/master.tar.gz
tar -C ~ -xf ~/emsdk-master.tar.gz
cd ~/emsdk-master
./emsdk update-tags
./emsdk install tot-upstream
./emsdk 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 emscripten
echo "import os" >> ~/.emscripten
# test v8 with --wasm-staging which enables new features. we use v8
# as a "bleeding edge" shell here, basically, with node being the
# primary shell (which we run without any special flags)
echo "V8_ENGINE = [os.path.expanduser('~/.jsvu/v8'), '--wasm-staging']" >> ~/.emscripten
echo "JS_ENGINES = [NODE_JS]" >> ~/.emscripten
echo "if os.path.exists(V8_ENGINE[0]): JS_ENGINES.append(V8_ENGINE)" >> ~/.emscripten
echo "WASM_ENGINES = []" >> ~/.emscripten
test -f ~/vms/wasmtime && echo "WASMTIME = os.path.expanduser(os.path.join('~', 'vms', 'wasmtime')) ; WASM_ENGINES.append(WASMTIME)" >> ~/.emscripten || true
test -f ~/vms/wasmer && echo "WASMER = os.path.expanduser(os.path.join('~', 'vms', 'wasmer')) ; WASM_ENGINES.append(WASMER)" >> ~/.emscripten || true
cd -
echo "final .emscripten:"
cat ~/.emscripten
# Remove any system libs the emsdk installed: we want to rebuild
# them all from source here, to check whether new changes work.
rm -Rf ~/.emscripten_cache
- run:
name: embuilder build ALL
command: |
$PYTHON_BIN ./embuilder.py build ALL
$PYTHON_BIN tests/runner.py test_hello_world
- run:
name: embuilder (LTO)
command: |
$PYTHON_BIN ./embuilder.py build MINIMAL --lto
$PYTHON_BIN tests/runner.py test_hello_world
- run:
name: embuilder (PIC)
command: |
$PYTHON_BIN ./embuilder.py build SYSTEM --pic
$PYTHON_BIN tests/runner.py test_hello_world
- run:
name: embuilder (PIC+LTO)
command: |
$PYTHON_BIN ./embuilder.py build MINIMAL --pic --lto
$PYTHON_BIN tests/runner.py test_hello_world
- run:
name: freeze cache
command: |
echo "FROZEN_CACHE=True" >> ~/.emscripten
- npm-install
- 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
- vms
- .jsvu
run-tests:
description: "Runs emscripten tests"
parameters:
test_targets:
description: "Test suites to run"
type: string
steps:
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: ~/
- checkout
- npm-install
- run:
name: run tests
command: |
$PYTHON_BIN tests/runner.py << parameters.test_targets >>
$PYTHON_BIN tools/check_clean.py
run-tests-mac:
description: "Runs emscripten tests"
parameters:
test_targets:
description: "Test suites to run"
type: string
steps:
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: ~/
- checkout
- npm-install
- run:
name: Install brew package dependencies
environment:
HOMEBREW_NO_AUTO_UPDATE: "1"
command: brew install python3 cmake
- run:
name: run tests
command: |
python3 tests/runner.py << parameters.test_targets >>
tools/check_clean.py
test-firefox:
description: "Runs emscripten tests under firefox"
steps:
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: ~/
- checkout
- npm-install
- run:
name: download firefox
command: |
wget -O ~/ff.tar.bz2 "https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=linux64&lang=en-US"
tar -C ~ -xf ~/ff.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);
user_pref("dom.postMessage.sharedArrayBuffer.bypassCOOP_COEP.insecure.enabled", 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
environment:
GALLIUM_DRIVER: softpipe # TODO: use the default llvmpipe when it supports more extensions
EMTEST_LACKS_SOUND_HARDWARE: "1"
# OffscreenCanvas support is not yet done in Firefox.
EMTEST_LACKS_OFFSCREEN_CANVAS: "1"
EMTEST_DETECT_TEMPFILE_LEAKS: "0"
DISPLAY: ":0"
command: |
export EMTEST_BROWSER="$HOME/firefox/firefox -profile $HOME/tmp-firefox-profile/"
# 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
python3 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 || true # wait for startx to shutdown cleanly, or not
test-chrome:
description: "Runs emscripten browser tests under chrome"
steps:
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: ~/
- checkout
- npm-install
- run:
name: download chrome
command: |
wget -O ~/chrome.deb https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb
dpkg -i ~/chrome.deb
- run:
name: run tests
environment:
EMTEST_LACKS_SOUND_HARDWARE: "1"
EMTEST_DETECT_TEMPFILE_LEAKS: "0"
# --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 --user-data-dir=/tmp/chrome-emscripten-profile"
CHROME_FLAGS_HEADLESS: "--headless --remote-debugging-port=1234"
CHROME_FLAGS_WASM: "--enable-features=WebAssembly --enable-features=SharedArrayBuffer --disable-features=WebAssemblyTrapHandler --js-flags=\"--experimental-wasm-threads --harmony-sharedarraybuffer --no-wasm-disable-structured-cloning\""
CHROME_FLAGS_NOCACHE: "--disk-cache-dir=/dev/null --disk-cache-size=1 --media-cache-size=1 --disable-application-cache --incognito"
command: |
export EMTEST_BROWSER="/usr/bin/google-chrome $CHROME_FLAGS_BASE $CHROME_FLAGS_HEADLESS $CHROME_FLAGS_WASM $CHROME_FLAGS_NOCACHE"
python3 tests/runner.py browser
test-upstream-sockets-chrome:
description: "Runs emscripten sockets tests under chrome"
steps:
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: ~/
- run:
name: download chrome
command: |
wget -O ~/chrome.deb https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb
dpkg -i ~/chrome.deb
- checkout
- npm-install
- run:
name: run sockets tests
environment:
EMTEST_LACKS_SOUND_HARDWARE: "1"
EMTEST_DETECT_TEMPFILE_LEAKS: "0"
# --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 --user-data-dir=/tmp/chrome-emscripten-profile"
CHROME_FLAGS_HEADLESS: "--headless --remote-debugging-port=1234"
CHROME_FLAGS_WASM: "--enable-features=WebAssembly --enable-features=SharedArrayBuffer --disable-features=WebAssemblyTrapHandler --js-flags=\"--experimental-wasm-threads --harmony-sharedarraybuffer --no-wasm-disable-structured-cloning\""
CHROME_FLAGS_NOCACHE: "--disk-cache-dir=/dev/null --disk-cache-size=1 --media-cache-size=1 --disable-application-cache --incognito"
command: |
export EMTEST_BROWSER="/usr/bin/google-chrome $CHROME_FLAGS_BASE $CHROME_FLAGS_HEADLESS $CHROME_FLAGS_WASM $CHROME_FLAGS_NOCACHE"
python3 tests/runner.py sockets
jobs:
build-fastcomp:
executor: bionic
steps:
- checkout
- run:
name: install emsdk
command: |
curl -# -L -o ~/emsdk-master.tar.gz https://github.com/emscripten-core/emsdk/archive/master.tar.gz
tar -C ~ -xf ~/emsdk-master.tar.gz
cd ~/emsdk-master
./emsdk update-tags
./emsdk install tot-fastcomp
./emsdk 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 emscripten
cd -
echo "final .emscripten:"
cat ~/.emscripten
# Remove any system libs the emsdk installed: we want to rebuild
# them all from source here, to check whether new changes work.
rm -Rf ~/.emscripten_cache
- run:
name: embuilder build ALL
command: |
python3 ./embuilder.py build ALL
python3 tests/runner.py test_hello_world
- run:
name: freeze cache
command: |
echo "FROZEN_CACHE=True" >> ~/.emscripten
- npm-install
- 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:
executor: bionic
steps:
- checkout
- run: make -C site html
flake8:
executor: bionic
steps:
- checkout
- run: python2 -m flake8 --show-source --statistics
- run: python3 -m flake8 --show-source --statistics
test-other:
executor: bionic
steps:
- run-tests:
# 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_targets: "other skip:other.test_native_link_error_message skip:other.test_emcc_v"
test-browser-firefox:
executor: bionic
steps:
- test-firefox
test-browser-chrome:
executor: bionic
steps:
- test-chrome
test-ab:
executor: bionic
steps:
- run-tests:
test_targets: "asm*.test_a* asm*.test_b*"
test-c:
executor: bionic
steps:
- run-tests:
test_targets: "asm*.test_c*"
test-d:
executor: bionic
steps:
- run-tests:
test_targets: "default.test_d* asm1.test_d* asm2.test_d* asm2g.test_d* asm3.test_d*"
test-e:
executor: bionic
steps:
- run-tests:
test_targets: "asm*.test_e*"
test-f:
executor: bionic
steps:
- run-tests:
test_targets: "asm*.test_f*"
test-ghi:
executor: bionic
steps:
- run-tests:
test_targets: "asm*.test_g* asm*.test_h* asm*.test_i*"
test-jklmno:
executor: bionic
steps:
- run-tests:
test_targets: "asm*.test_j* asm*.test_k* asm*.test_l* asm*.test_m* asm*.test_n* asm*.test_o*"
test-p:
executor: bionic
steps:
- run-tests:
test_targets: "default.test_p* asm1.test_p* asm2.test_p* asm2g.test_p* asm3.test_p*"
test-qrst:
executor: bionic
steps:
- run-tests:
test_targets: "asm*.test_q* asm*.test_r* asm*.test_s* asm*.test_t*"
test-uvwxyz:
executor: bionic
steps:
- run-tests:
test_targets: "asm*.test_u* asm*.test_w* asm*.test_v* asm*.test_x* asm*.test_y* asm*.test_z*"
test-wasm0:
executor: bionic
steps:
- run-tests:
test_targets: "wasm0"
test-wasm2:
executor: bionic
steps:
- run-tests:
test_targets: "wasm2"
test-wasm3:
executor: bionic
steps:
- run-tests:
test_targets: "wasm3"
test-sanity:
executor: bionic
steps:
- run-tests:
test_targets: "sanity"
build-upstream-linux:
executor: bionic
steps:
- checkout
- run:
name: get wasmer
command: |
wget https://github.com/wasmerio/wasmer/releases/download/0.11.0/wasmer-linux-amd64.tar.gz
tar -xf wasmer-linux-amd64.tar.gz
mkdir ~/vms
cp bin/wasmer ~/vms
- run:
name: get wasmtime
command: |
# use a pinned version due to https://github.com/bytecodealliance/wasmtime/issues/714
export VERSION=v0.8.0
wget https://github.com/bytecodealliance/wasmtime/releases/download/v0.8.0/wasmtime-$VERSION-x86_64-linux.tar.xz
tar -xf wasmtime-$VERSION-x86_64-linux.tar.xz
cp wasmtime-$VERSION-x86_64-linux/wasmtime ~/vms
- run:
name: get v8
command: |
wget https://nodejs.org/dist/v12.13.0/node-v12.13.0-linux-x64.tar.xz
tar -xf node-v12.13.0-linux-x64.tar.xz
export PATH="`pwd`/node-v12.13.0-linux-x64/bin:${PATH}"
npm install jsvu -g
export PATH="${HOME}/.jsvu:${PATH}"
jsvu --os=default --engines=v8
- build-upstream
test-upstream-wasm0:
executor: bionic
steps:
- run-tests:
test_targets: "wasm0"
test-upstream-wasm2:
executor: bionic
steps:
- run-tests:
test_targets: "wasm2"
test-upstream-wasm3:
executor: bionic
steps:
- run-tests:
# TODO: test wasms
test_targets: "wasm3"
test-upstream-wasm2js1:
executor: bionic
steps:
- run-tests:
test_targets: "wasm2js1"
test-upstream-other:
executor: bionic
steps:
- run-tests:
# see explanations in the fastcomp skips for these, earlier
test_targets: "other skip:other.test_native_link_error_message skip:other.test_emcc_v"
test-upstream-browser-chrome:
executor: bionic
steps:
- test-chrome
test-upstream-browser-firefox:
executor: bionic
steps:
- test-firefox
test-upstream-sockets-chrome:
executor: bionic
steps:
- test-upstream-sockets-chrome
build-upstream-windows:
executor:
name: win/vs2019
shell: bash.exe
environment:
# We need python installed before we can test anytyhing.
# There seems to be undocument copy of python installed here. Hopefully
# if this disappears there will be another way of getting a re-installed
# version.
PYTHON_BIN: "/c/python27amd64/python.exe"
PYTHONUNBUFFERED: "1"
EMSDK_NOTTY: "1"
steps:
- checkout
- run:
name: Add python to bash path
command: echo "export PATH=\"$PATH:/c/python27amd64/\"" >> $BASH_ENV
- build-upstream
test-upstream-minimal-windows:
environment:
PYTHON_BIN: "/c/python27amd64/python.exe"
PYTHONUNBUFFERED: "1"
EMSDK_NOTTY: "1"
executor:
name: win/vs2019
shell: bash.exe
steps:
- run-tests:
test_targets: "wasm2.test_ccall other.test_closure_externs other.test_binaryen_debug"
build-upstream-mac:
executor: mac
steps:
- run:
name: Install brew package dependencies
environment:
HOMEBREW_NO_AUTO_UPDATE: "1"
command: brew install python3 cmake
- checkout
- build-upstream
test-upstream-other-mac:
executor: mac
steps:
- run-tests-mac:
test_targets: "other skip:other.test_native_link_error_message skip:other.test_emcc_v"
workflows:
build-test:
jobs:
- flake8
- build-docs
- build-fastcomp
- test-other:
requires:
- build-fastcomp
- test-browser-firefox:
requires:
- build-fastcomp
- test-browser-chrome:
requires:
- build-fastcomp
- test-ab:
requires:
- build-fastcomp
- test-c:
requires:
- build-fastcomp
- test-d:
requires:
- build-fastcomp
- test-e:
requires:
- build-fastcomp
- test-f:
requires:
- build-fastcomp
- test-ghi:
requires:
- build-fastcomp
- test-jklmno:
requires:
- build-fastcomp
- test-p:
requires:
- build-fastcomp
- test-qrst:
requires:
- build-fastcomp
- test-uvwxyz:
requires:
- build-fastcomp
- test-wasm0:
requires:
- build-fastcomp
- test-wasm2:
requires:
- build-fastcomp
- test-wasm3:
requires:
- build-fastcomp
- test-sanity:
requires:
- build-fastcomp
- build-upstream-linux
- test-upstream-wasm0:
requires:
- build-upstream-linux
- test-upstream-wasm2:
requires:
- build-upstream-linux
- test-upstream-wasm3:
requires:
- build-upstream-linux
- test-upstream-wasm2js1:
requires:
- build-upstream-linux
- test-upstream-other:
requires:
- build-upstream-linux
- test-upstream-browser-chrome:
requires:
- build-upstream-linux
- test-upstream-browser-firefox:
requires:
- build-upstream-linux
- test-upstream-sockets-chrome:
requires:
- build-upstream-linux
- build-upstream-windows
- test-upstream-minimal-windows:
requires:
- build-upstream-windows
- build-upstream-mac
- test-upstream-other-mac:
requires:
- build-upstream-mac