mirror of
https://github.com/fluencelabs/examples
synced 2025-05-21 15:11:19 +00:00
update to marine, marine-test, bump versions
This commit is contained in:
parent
3d056435ee
commit
70a32bc46f
@ -1,15 +1,18 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
set -o errexit -o nounset -o pipefail
|
set -o errexit -o nounset -o pipefail
|
||||||
|
|
||||||
# This script builds all subprojects and puts all created Wasm modules in one dir
|
# This script builds all subprojects and puts all created Wasm modules in one dir
|
||||||
cd effector
|
cd effector
|
||||||
cargo update
|
cargo update --aggressive
|
||||||
fce build --release
|
marine build --release
|
||||||
|
|
||||||
cd ../pure
|
cd ../pure
|
||||||
cargo update
|
cargo update --aggressive
|
||||||
fce build --release
|
marine build --release
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
rm artifacts/*
|
|
||||||
cp ../../target/wasm32-wasi/release/records_effector.wasm artifacts/
|
mkdir -p artifacts
|
||||||
cp ../../target/wasm32-wasi/release/records_pure.wasm artifacts/
|
rm -f artifacts/*.wasm
|
||||||
|
cp effector/target/wasm32-wasi/release/records_effector.wasm artifacts/
|
||||||
|
cp pure/target/wasm32-wasi/release/records_pure.wasm artifacts/
|
||||||
|
@ -10,5 +10,5 @@ name = "records_effector"
|
|||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fluence = { version = "=0.5.0", features = ["logger"]}
|
fluence = "0.6.9"
|
||||||
test-record = { path = "../test-record" }
|
test-record = { path = "../test-record" }
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use fluence::fce;
|
use fluence::marine;
|
||||||
use fluence::module_manifest;
|
use fluence::module_manifest;
|
||||||
|
|
||||||
use test_record::TestRecord;
|
use test_record::TestRecord;
|
||||||
@ -23,7 +23,7 @@ module_manifest!();
|
|||||||
|
|
||||||
pub fn main() {}
|
pub fn main() {}
|
||||||
|
|
||||||
#[fce]
|
#[marine]
|
||||||
pub fn mutate_struct(mut test_record: test_record::TestRecord) -> TestRecord {
|
pub fn mutate_struct(mut test_record: test_record::TestRecord) -> TestRecord {
|
||||||
test_record.field_0 = true;
|
test_record.field_0 = true;
|
||||||
test_record.field_1 = 1;
|
test_record.field_1 = 1;
|
||||||
|
@ -10,5 +10,5 @@ name = "records_pure"
|
|||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fluence = { version = "=0.5.0", features = ["logger"]}
|
fluence = "0.6.9"
|
||||||
test-record = { path = "../test-record" }
|
test-record = { path = "../test-record" }
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#![allow(improper_ctypes)]
|
#![allow(improper_ctypes)]
|
||||||
|
|
||||||
use fluence::fce;
|
use fluence::marine;
|
||||||
use fluence::module_manifest;
|
use fluence::module_manifest;
|
||||||
|
|
||||||
use test_record::TestRecord;
|
use test_record::TestRecord;
|
||||||
@ -25,7 +25,7 @@ module_manifest!();
|
|||||||
|
|
||||||
pub fn main() {}
|
pub fn main() {}
|
||||||
|
|
||||||
#[fce]
|
#[marine]
|
||||||
pub fn invoke() -> TestRecord {
|
pub fn invoke() -> TestRecord {
|
||||||
let test_record = TestRecord {
|
let test_record = TestRecord {
|
||||||
field_0: false,
|
field_0: false,
|
||||||
@ -43,10 +43,10 @@ pub fn invoke() -> TestRecord {
|
|||||||
field_12: Vec::new(),
|
field_12: Vec::new(),
|
||||||
};
|
};
|
||||||
|
|
||||||
unsafe { mutate_struct(test_record) }
|
mutate_struct(test_record)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[fce]
|
#[marine]
|
||||||
#[link(wasm_import_module = "records_effector")]
|
#[link(wasm_import_module = "records_effector")]
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn mutate_struct(test_record: TestRecord) -> TestRecord;
|
pub fn mutate_struct(test_record: TestRecord) -> TestRecord;
|
||||||
|
@ -10,4 +10,4 @@ name = "test_record"
|
|||||||
path = "src/test_record.rs"
|
path = "src/test_record.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
fluence = "=0.5.0"
|
fluence = "=0.6.9"
|
||||||
|
@ -14,7 +14,9 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#[fluence::fce]
|
use fluence::marine;
|
||||||
|
|
||||||
|
#[marine]
|
||||||
pub struct TestRecord {
|
pub struct TestRecord {
|
||||||
pub field_0: bool,
|
pub field_0: bool,
|
||||||
pub field_1: i8,
|
pub field_1: i8,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user