Skip to content

Commit 3f1e8b9

Browse files
committed
Enable the wasi target on CI
Now that wasi is in nightlies, we can run it on PRs!
1 parent 173c5be commit 3f1e8b9

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ matrix:
204204
stage: tier2
205205
- env: TARGET=x86_64-unknown-linux-musl
206206
stage: tier2
207+
- env: TARGET=wasm32-unknown-wasi
208+
rust: nightly
209+
stage: tier2
207210

208211
allow_failures:
209212
# FIXME: android build bots time out irregularly

ci/docker/wasm32-unknown-wasi/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ RUN mv /clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04 /wasmcc
2828
# those breaking changes on `libc`'s own CI
2929
RUN git clone https://github.com/CraneStation/wasi-sysroot && \
3030
cd wasi-sysroot && \
31-
git reset --hard 320054e84f8f2440def3b1c8700cedb8fd697bf8
31+
git reset --hard 3ca44511c298cbbc99e690b761310070b3527fe8
3232
RUN make -C wasi-sysroot install -j $(nproc) WASM_CC=/wasmcc/bin/clang INSTALL_DIR=/wasi-sysroot
3333

3434
# This is a small wrapper script which executes the actual clang binary in
@@ -58,9 +58,9 @@ RUN curl -sSf https://sh.rustup.rs | sh -s -- -y
5858
ENV PATH=/root/.cargo/bin:$PATH
5959

6060
RUN apt-get install -y --no-install-recommends python
61-
RUN git clone https://github.com/CraneStation/wasmtime-wasi wasmtime && \
61+
RUN git clone https://github.com/CraneStation/wasmtime wasmtime && \
6262
cd wasmtime && \
63-
git reset --hard 4fe2d6084e5b5cc74e69a26860f12750df51d339
63+
git reset --hard a1c123c3dd8f9766990efe0f1734a646f61ba8a0
6464
RUN cargo build --release --manifest-path wasmtime/Cargo.toml
6565

6666
# And finally in the last image we're going to assemble everything together.
@@ -75,9 +75,9 @@ RUN apt-get update && \
7575
libxml2
7676

7777
# Copy over clang we downloaded to link executables ...
78-
COPY --from=reference-sysroot /wasmcc /wasmcc/
78+
COPY --from=wasi-sysroot /wasmcc /wasmcc/
7979
# ... and the sysroot we built to link executables against ...
80-
COPY --from=reference-sysroot /wasi-sysroot/ /wasi-sysroot/
80+
COPY --from=wasi-sysroot /wasi-sysroot/ /wasi-sysroot/
8181
# ... and finally wasmtime to actually execute binaries
8282
COPY --from=wasmtime /wasmtime/target/release/wasmtime /usr/bin/
8383

src/wasi.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -388,12 +388,15 @@ pub const __WASI_WHENCE_CUR: u8 = 0;
388388
pub const __WASI_WHENCE_END: u8 = 1;
389389
pub const __WASI_WHENCE_SET: u8 = 2;
390390

391-
#[cfg_attr(feature = "rustc-dep-of-std",
392-
link(name = "c", kind = "static",
393-
cfg(target_feature = "crt-static")))]
394-
#[cfg_attr(feature = "rustc-dep-of-std",
395-
link(name = "c", cfg(not(target_feature = "crt-static"))))]
396-
extern {
391+
#[cfg_attr(
392+
feature = "rustc-dep-of-std",
393+
link(name = "c", kind = "static", cfg(target_feature = "crt-static"))
394+
)]
395+
#[cfg_attr(
396+
feature = "rustc-dep-of-std",
397+
link(name = "c", cfg(not(target_feature = "crt-static")))
398+
)]
399+
extern "C" {
397400
pub fn _Exit(code: c_int) -> !;
398401
pub fn _exit(code: c_int) -> !;
399402
pub fn abort() -> !;
@@ -452,8 +455,8 @@ extern {
452455
pub fn puts(a: *const c_char) -> c_int;
453456
pub fn perror(a: *const c_char);
454457
pub fn srand(a: c_uint);
455-
pub fn atexit(a: extern fn()) -> c_int;
456-
pub fn at_quick_exit(a: extern fn()) -> c_int;
458+
pub fn atexit(a: extern "C" fn()) -> c_int;
459+
pub fn at_quick_exit(a: extern "C" fn()) -> c_int;
457460
pub fn quick_exit(a: c_int) -> !;
458461
pub fn posix_memalign(a: *mut *mut c_void, b: size_t, c: size_t) -> c_int;
459462
pub fn rand_r(a: *mut c_uint) -> c_int;
@@ -501,7 +504,7 @@ extern {
501504
}
502505

503506
#[link(wasm_import_module = "wasi_unstable")]
504-
extern {
507+
extern "C" {
505508
#[link_name = "clock_res_get"]
506509
pub fn __wasi_clock_res_get(
507510
clock_id: __wasi_clockid_t,

0 commit comments

Comments
 (0)