This repository has been archived by the owner on Feb 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rename build scripts for clarity. * set -e instead of && * Use bash shebang * fixup! set -e instead of && * fixup! set -e instead of && * Install wasm toolchain in .travis.yml * Add recursive test. * Update rust-toolchain * Decrease alloc size. * Update gen libs. * Supply stack-size to rustc * Recompile tests. * Clean imports of recursive. * Update nightly and rebuild
- Loading branch information
Showing
30 changed files
with
125 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
./build-rust-test.sh alloc | ||
./build-rust-test.sh call | ||
./build-rust-test.sh call_code | ||
./build-rust-test.sh call_static | ||
./build-rust-test.sh creator | ||
./build-rust-test.sh dispersion | ||
./build-rust-test.sh empty | ||
./build-rust-test.sh externs | ||
./build-rust-test.sh events | ||
./build-rust-test.sh identity | ||
./build-rust-test.sh logger | ||
./build-rust-test.sh realloc | ||
./build-rust-test.sh rterr | ||
./build-rust-test.sh keccak | ||
./build-rust-test.sh suicidal | ||
./build-rust-test.sh storage_read | ||
./build-rust-test.sh math | ||
./build-rust-test.sh setter | ||
./build-wat.sh recursive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
TEST_NAME=$1 | ||
|
||
cargo run --manifest-path ./gen/Cargo.toml -- $TEST_NAME | ||
RUSTFLAGS="-C link-arg=-z -C link-arg=stack-size=65536" CARGO_TARGET_DIR=./target cargo build --manifest-path=./target/tests/$TEST_NAME/Cargo.toml --release --target=wasm32-unknown-unknown | ||
wasm-build ./target $TEST_NAME --target wasm32-unknown-unknown | ||
cp ./target/$TEST_NAME.wasm ./compiled |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
TEST_NAME=$1 | ||
|
||
mkdir -p ./target/wasm32-unknown-unknown/release/ | ||
wat2wasm src/$TEST_NAME.wat -o ./target/wasm32-unknown-unknown/release/$TEST_NAME.wasm | ||
|
||
wasm-build ./target $TEST_NAME --target wasm32-unknown-unknown | ||
cp ./target/$TEST_NAME.wasm ./compiled |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,14 +17,19 @@ version = "0.1.0" | |
authors = ["NikVolf <[email protected]>"] | ||
[dependencies] | ||
pwasm-std = "0.5.0" | ||
pwasm-ethereum = "0.1.0" | ||
pwasm-std = "0.9.0" | ||
pwasm-ethereum = "0.5.0" | ||
bigint = { version = "4", default-features = false } | ||
[lib] | ||
name = "$file_name" | ||
path = "main.rs" | ||
crate-type = ["cdylib"] | ||
[profile.release] | ||
panic = "abort" | ||
lto = true | ||
opt-level = "z" | ||
"#; | ||
|
||
let target_toml = toml.replace("$file_name", file_name); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
nightly-2018-02-05 | ||
nightly-2018-06-28 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
(module | ||
(import "env" "fetch_input" (func $fetch_input (param i32))) | ||
(import "env" "input_length" (func $input_length (result i32))) | ||
|
||
|
||
(func (export "call") | ||
;; Assert that input_length is exactly 4 bytes long. | ||
(if | ||
(i32.ne | ||
(call $input_length) | ||
(i32.const 4) | ||
) | ||
(unreachable) | ||
) | ||
|
||
;; Load input data at the address 0. | ||
;; | ||
;; It contains only 1 word that represents an iteration count. | ||
(call $fetch_input | ||
(i32.const 0) | ||
) | ||
|
||
;; Load the iteration count from the address 0 and then | ||
;; call $recursive with this number. | ||
;; Drop the result (since it's always zero). | ||
(drop | ||
(call $recursive | ||
(i32.load | ||
(i32.const 0) | ||
) | ||
) | ||
) | ||
) | ||
|
||
(func $recursive (param i32) (result i32) | ||
block $out (result i32) | ||
get_local 0 | ||
get_local 0 | ||
i32.eqz | ||
br_if $out | ||
|
||
i32.const 1 | ||
i32.sub | ||
call $recursive | ||
end | ||
) | ||
|
||
(table 0 anyfunc) | ||
(memory 1) | ||
(export "memory" (memory 0)) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
# this script is intended to be used from .travis.yml. | ||
# Takes an environment variable WATERFALL_BUILD to download a | ||
# specific version of a waterfall build. | ||
|
||
set -e | ||
|
||
if [ -z ${WATERFALL_BUILD+x} ]; then | ||
echo "the WATERFALL_BUILD environment variable is unset"; | ||
exit 1; | ||
fi | ||
|
||
curl -sL https://storage.googleapis.com/wasm-llvm/builds/linux/$WATERFALL_BUILD/wasm-binaries.tbz2 | tar xvkj |