wasi support part 15: add CI build
Categories
(Core :: JavaScript Engine, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox90 | --- | wontfix |
People
(Reporter: dbezhetskov, Assigned: dbezhetskov)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
To test SM port on wasi we need to build it.
I build SM for wasi locally with following mozconfig:
CC=/opt/wasi-sdk/bin/clang
CXX=/opt/wasi-sdk/bin/clang++
AR=/opt/wasi-sdk/bin/ar
HOST_CC=gcc
HOST_CXX=g++
ac_add_options --enable-application=js
ac_add_options --target=wasm32-unknown-wasi
ac_add_options --disable-jit
ac_add_options --without-system-zlib
ac_add_options --disable-shared-js
ac_add_options --disable-shared-memory
./mach build
The final goal is to integrate this build to the mozilla's CI pipeline.
Assignee | ||
Comment 1•4 years ago
|
||
The first task is to provide wasi-sdk 12.0 (https://github.com/WebAssembly/wasi-sdk/releases/tag/wasi-sdk-12) toolchain, this should be done via tooltool as I know.
Ben, could you consult me with this?
Comment 2•4 years ago
|
||
Researching more, it seems that tooltool is not the approach we want here, and instead should be following what was done in Bug 1582192 (and probably just extending the scripts.
I also wonder if our existing clang is a sufficient version for directly building, since the wasi-sdk readme says it just bundles upstream-LLVM.
Comment 3•4 years ago
|
||
+CC glandium, who is probably the expert on this sort of build/CI integration. I don't know if we have our specific questions yet, but any insights welcome here.
Comment 4•4 years ago
|
||
(In reply to Ted Campbell [:tcampbell] from comment #2)
Researching more, it seems that tooltool is not the approach we want here, and instead should be following what was done in Bug 1582192 (and probably just extending the scripts.
I also wonder if our existing clang is a sufficient version for directly building, since the wasi-sdk readme says it just bundles upstream-LLVM.
This is what I would suggest too. Tooltool is largely only used for things that we cannot publicly redistribute these days.
Assignee | ||
Comment 5•4 years ago
|
||
So, I was able to at least build SM with WASI on CI with clang provided by mozilla's server and with built-in wasi-sysroot - https://treeherder.mozilla.org/jobs?repo=try&revision=4da80ea49c95b8c8ddef267ce858259275f51e12&selectedTaskRun=AEn4N4FET2iwX-5jKvm5kw.0.
Tests has failed but we don't want to run jit tests, at least now.
So, to do this we need:
- upload this patch https://phabricator.services.mozilla.com/D116207 to properly configure clang with wasi sysroot
- update
wasi-sdk
to the 12th version, because there is symbols conflict betweenwasi-libc
andlibjsrust
. They are both required for the SM.
The conflicting symbol isexit
, see the fix inwasi-libc
https://github.com/WebAssembly/wasi-libc/pull/201.
Moreover, I tried to update wasi-sdk and it looks like nothing was crashed - https://treeherder.mozilla.org/jobs?repo=try&revision=95a8196e6709107f85c76a8ce86c9728811588ec. - disable
nspr-build
for WASI target because there is no support innspr
for WASI. In the build above I've just disabled it unconditionally - add
wasm32-wasi
as a rust toolchain to be able to compile rust components to Wasm - fix small warning for WASI in the code
After that steps we can use the following config to build SM with WASI:
ac_add_options --enable-application=js
ac_add_options --target=wasm32-unknown-wasi
ac_add_options --with-sysroot=/builds/worker/fetches/wasi-sysroot/share/wasi-sysroot/
ac_add_options --disable-gold
ac_add_options --disable-stdcxx-compat
ac_add_options --disable-clang-plugin
ac_add_options --without-system-zlib
ac_add_options --without-intl-api
ac_add_options --disable-jit
ac_add_options --disable-shared-js
ac_add_options --disable-shared-memory
ac_add_options --disable-tests
ac_add_options --disable-cranelift
ac_add_options --disable-jemalloc
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 6•4 years ago
|
||
Update wasi-sdk from version 11 to the version 12.
This is primary needed to be able to build SM on wasi platform.
Updated•4 years ago
|
Assignee | ||
Comment 7•4 years ago
|
||
kNsPerUs is unused and fputwc return's type is wint_t.
Comment 9•4 years ago
|
||
bugherder |
Comment 10•4 years ago
|
||
Comment 11•4 years ago
|
||
bugherder |
Assignee | ||
Comment 12•4 years ago
|
||
Comment 13•4 years ago
|
||
Comment 14•4 years ago
|
||
bugherder |
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Comment 15•4 years ago
|
||
Since wasi build has been green for three weeks and since developers don't
want to break this build we give them
tier 2 to make it more visible.
Comment 16•4 years ago
|
||
Comment 17•4 years ago
|
||
Comment 18•4 years ago
|
||
bugherder |
Updated•3 years ago
|
Description
•