From 5524b91dd9af3f50df09ae6d23131998d44f4de5 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 28 May 2019 19:39:20 +0100 Subject: [PATCH 1/2] Build all combination of features on Circle CI --- circle.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index fc01e76..c1c1c1f 100644 --- a/circle.yml +++ b/circle.yml @@ -23,4 +23,10 @@ jobs: command: cargo test --target=x86_64-unknown-linux-gnu - run: name: Build - command: cargo build --release + command: | + cargo build --release + # debug + cargo build + cargo build --release --no-default-features + cargo build --release --features debug + cargo build --release --no-default-features --features debug From e5669bd1984a25cc9b7ab8792c01822652011f97 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 28 May 2019 19:40:45 +0100 Subject: [PATCH 2/2] Fix compilation issues in the debug API --- src/debug.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/debug.rs b/src/debug.rs index 5c20b9f..0678c81 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -1,6 +1,8 @@ //! The native debug interface exposed to the ewasm contract. These functions are for testing //! purposes only. On a live VM, any bytecode trying to import these symbols will be rejected. +use crate::types::*; + mod native { extern "C" { pub fn debug_print32(value: u32); @@ -16,16 +18,16 @@ pub fn print32(value: u32) { unsafe { native::debug_print32(value) } } -pub fn print64(value: u32) { +pub fn print64(value: u64) { unsafe { native::debug_print64(value) } } pub fn printMem(slice: &[u8]) { - unsafe { native::debug_printMem(slice.bytes.as_ptr() as *const u32, slice.len()) } + unsafe { native::debug_printMem(slice.as_ptr() as *const u32, slice.len() as u32) } } pub fn printMemHex(slice: &[u8]) { - unsafe { native::debug_printMem(slice.bytes.as_ptr() as *const u32, slice.len()) } + unsafe { native::debug_printMem(slice.as_ptr() as *const u32, slice.len() as u32) } } pub fn printStorage(key: &StorageKey) {