Skip to content

RUST-1130 Check that the bson crate compiles to wasm #405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .evergreen/check-wasm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -o errexit

. ~/.cargo/env

rustup target add wasm32-unknown-unknown
cd $(dirname $0)/../wasm-test
cargo build --target wasm32-unknown-unknown
23 changes: 23 additions & 0 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@ functions:
${PREPARE_SHELL}
.evergreen/check-rustdoc.sh

"check wasm compilation":
- command: shell.exec
type: test
params:
shell: bash
working_dir: "src"
script: |
${PREPARE_SHELL}
.evergreen/check-wasm.sh

"init test-results":
- command: shell.exec
params:
Expand Down Expand Up @@ -177,6 +187,10 @@ tasks:
commands:
- func: "run fuzzer"

- name: "wasm-compilation"
commands:
- func: "check wasm compilation"

axes:
- id: "extra-rust-versions"
values:
Expand Down Expand Up @@ -207,6 +221,7 @@ buildvariants:
- ubuntu1804-test
tasks:
- name: "compile-only"

-
name: "lint"
display_name: "Lint"
Expand All @@ -224,3 +239,11 @@ buildvariants:
- ubuntu1804-test
tasks:
- name: "run-fuzzer"

-
name: "wasm"
display_name: "WASM"
run_on:
- ubuntu1804-test
tasks:
- name: "wasm-compilation"
14 changes: 14 additions & 0 deletions wasm-test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "bson-wasm-test"
version = "0.1.0"
authors = ["Abraham Egnor <[email protected]>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
bson = { path = ".." }
getrandom = { version = "0.2", features = ["js"] }
1 change: 1 addition & 0 deletions wasm-test/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub use bson;