diff --git a/Cargo.toml b/Cargo.toml index fa918f7..f203b68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ wee_alloc = { version = "0.4.4", optional = true } qimalloc = { version = "0.1", optional = true } [features] -default = ["std", "wee_alloc"] +default = ["wee_alloc"] std = [] debug = [] experimental = [] diff --git a/circle.yml b/circle.yml index 6e8ab55..c644d3f 100644 --- a/circle.yml +++ b/circle.yml @@ -9,7 +9,8 @@ jobs: - run: name: Update rustc command: | - rustup target add wasm32-unknown-unknown + rustup install nightly-x86_64-unknown-linux-gnu + rustup target add wasm32-unknown-unknown --toolchain nightly rustup component add rustfmt rustup update - run: @@ -20,28 +21,28 @@ jobs: - run: name: Test command: | - cargo test --target=x86_64-unknown-linux-gnu - cargo test --release --target=x86_64-unknown-linux-gnu + cargo +nightly test --target=x86_64-unknown-linux-gnu + cargo +nightly test --release --target=x86_64-unknown-linux-gnu - run: name: Build command: | # debug - cargo build + cargo +nightly build # release - cargo build --release + cargo +nightly build --release # different allocators - cargo build --release --features wee_alloc - cargo build --release --features qimalloc + cargo +nightly build --release --features wee_alloc + cargo +nightly build --release --features qimalloc # different allocators (no_std) - cargo build --release --no-default-features --features wee_alloc - cargo build --release --no-default-features --features qimalloc + cargo +nightly build --release --no-default-features --features wee_alloc + cargo +nightly build --release --no-default-features --features qimalloc # different feature sets - cargo build --release --no-default-features - cargo build --release --features debug - cargo build --release --no-default-features --features debug - cargo build --release --features experimental - cargo build --release --no-default-features --features experimental - cargo build --release --features experimental,debug - cargo build --release --no-default-features --features experimental,debug - cargo build --release --features eth2 - cargo build --release --no-default-features --features eth2 + cargo +nightly build --release --no-default-features + cargo +nightly build --release --features debug + cargo +nightly build --release --no-default-features --features debug + cargo +nightly build --release --features experimental + cargo +nightly build --release --no-default-features --features experimental + cargo +nightly build --release --features experimental,debug + cargo +nightly build --release --no-default-features --features experimental,debug + cargo +nightly build --release --features eth2 + cargo +nightly build --release --no-default-features --features eth2 diff --git a/src/lib.rs b/src/lib.rs index 9e7e48c..aa5ff9d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,6 @@ +#![cfg_attr(not(feature = "std"), no_std)] +#![feature(lang_items)] + //! ewasm_api is a library used to interface with Ethereum's EEI in [Ewasm](https://github.com/ewasm/design), a set of enhancements to //! the Ethereum smart contract platform. //! ewasm_api exposes both a set of unsafe "native" functions representing the actual EEI diff --git a/src/utils.rs b/src/utils.rs index 6b3076c..d640078 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -15,6 +15,7 @@ pub fn unsafe_alloc_buffer(len: usize) -> Vec { mod tests { use super::*; + #[cfg(feature = "std")] #[test] fn smoke() { let ret = unsafe_alloc_buffer(42);