mirror of
https://github.com/fluencelabs/marine.git
synced 2024-12-12 14:55:32 +00:00
i64 -> i32 for 'target' in log_utf8_string (#49)
This commit is contained in:
parent
163036e409
commit
11674ee856
@ -22,25 +22,7 @@ jobs:
|
||||
cargo fmt --all -- --check --color always
|
||||
cargo +nightly check -v --all-features
|
||||
|
||||
|
||||
cd ./examples/call_parameters/
|
||||
./build.sh
|
||||
|
||||
cd ../greeting/
|
||||
./build.sh
|
||||
|
||||
cd ../ipfs-node/
|
||||
./build.sh
|
||||
|
||||
cd ../records/
|
||||
./build.sh
|
||||
|
||||
cd ../url-downloader/
|
||||
./build.sh
|
||||
|
||||
cd ../../fluence-faas/tests/wasm_tests/
|
||||
|
||||
cd ../../
|
||||
(cd ./examples; ./build.sh)
|
||||
|
||||
cargo +nightly test --release -v --all-features
|
||||
cargo +nightly clippy -v
|
||||
|
16
.github/workflows/rust_audit.yml
vendored
Normal file
16
.github/workflows/rust_audit.yml
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
name: Security audit
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '**/Cargo.toml'
|
||||
- '**/Cargo.lock'
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
security_audit:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions-rs/audit-check@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
8
Cargo.lock
generated
8
Cargo.lock
generated
@ -735,7 +735,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "fluence"
|
||||
version = "0.2.11"
|
||||
source = "git+https://github.com/fluencelabs/rust-sdk#8a2570bbc630b2a519aee146ac6c5a52d5afe6cd"
|
||||
source = "git+https://github.com/fluencelabs/rust-sdk#31dc0a30dfd05144439c63d3fc3aae93636de06c"
|
||||
dependencies = [
|
||||
"fluence-sdk-macro 0.2.11 (git+https://github.com/fluencelabs/rust-sdk)",
|
||||
"fluence-sdk-main 0.2.11 (git+https://github.com/fluencelabs/rust-sdk)",
|
||||
@ -791,7 +791,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "fluence-sdk-macro"
|
||||
version = "0.2.11"
|
||||
source = "git+https://github.com/fluencelabs/rust-sdk#8a2570bbc630b2a519aee146ac6c5a52d5afe6cd"
|
||||
source = "git+https://github.com/fluencelabs/rust-sdk#31dc0a30dfd05144439c63d3fc3aae93636de06c"
|
||||
dependencies = [
|
||||
"fluence-sdk-wit 0.2.11 (git+https://github.com/fluencelabs/rust-sdk)",
|
||||
]
|
||||
@ -810,7 +810,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "fluence-sdk-main"
|
||||
version = "0.2.11"
|
||||
source = "git+https://github.com/fluencelabs/rust-sdk#8a2570bbc630b2a519aee146ac6c5a52d5afe6cd"
|
||||
source = "git+https://github.com/fluencelabs/rust-sdk#31dc0a30dfd05144439c63d3fc3aae93636de06c"
|
||||
dependencies = [
|
||||
"fluence-sdk-macro 0.2.11 (git+https://github.com/fluencelabs/rust-sdk)",
|
||||
"log",
|
||||
@ -834,7 +834,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "fluence-sdk-wit"
|
||||
version = "0.2.11"
|
||||
source = "git+https://github.com/fluencelabs/rust-sdk#8a2570bbc630b2a519aee146ac6c5a52d5afe6cd"
|
||||
source = "git+https://github.com/fluencelabs/rust-sdk#31dc0a30dfd05144439c63d3fc3aae93636de06c"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -137,7 +137,7 @@ fn make_faas_config(
|
||||
aquamarine_wasm_file: &str,
|
||||
call_service: HostImportDescriptor,
|
||||
current_peer_id: String,
|
||||
logging_mask: i64,
|
||||
logging_mask: i32,
|
||||
) -> FaaSConfig {
|
||||
use fluence_faas::FaaSModuleConfig;
|
||||
use maplit::hashmap;
|
||||
|
@ -33,5 +33,5 @@ pub struct AquamarineVMConfig {
|
||||
pub particle_data_store: PathBuf,
|
||||
|
||||
/// Mask used to filter logs, for details see `log_utf8_string` in fluence-faas.
|
||||
pub logging_mask: i64,
|
||||
pub logging_mask: i32,
|
||||
}
|
||||
|
14
examples/build.sh
Executable file
14
examples/build.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
for dir in ./*; do
|
||||
# skip non-directory entries
|
||||
[ -d "$dir" ] || continue
|
||||
|
||||
# skip if there's no build.sh in the directory
|
||||
[ -e "$dir/build.sh" ] || continue
|
||||
|
||||
(cd "$dir"; ./build.sh)
|
||||
done
|
||||
|
Binary file not shown.
@ -9,4 +9,4 @@ name = "greeting"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
fluence = { git = "https://github.com/fluencelabs/rust-sdk", features = ["debug"] }
|
||||
fluence = { git = "https://github.com/fluencelabs/rust-sdk" }
|
||||
|
@ -3,4 +3,4 @@ modules_dir = "artifacts/"
|
||||
[[module]]
|
||||
name = "greeting"
|
||||
mem_pages_count = 1
|
||||
logger_enabled = true
|
||||
logger_enabled = false
|
||||
|
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.
@ -49,7 +49,7 @@ pub struct FaaSModuleConfig {
|
||||
pub wasi: Option<FaaSWASIConfig>,
|
||||
|
||||
/// Mask used to filter logs, for details see `log_utf8_string`
|
||||
pub logging_mask: i64,
|
||||
pub logging_mask: i32,
|
||||
}
|
||||
|
||||
impl FaaSModuleConfig {
|
||||
|
@ -18,9 +18,9 @@ use wasmer_core::vm::Ctx;
|
||||
use wasmer_core::memory::ptr::{Array, WasmPtr};
|
||||
|
||||
pub(crate) fn log_utf8_string_closure(
|
||||
logging_mask: i64,
|
||||
logging_mask: i32,
|
||||
module: String,
|
||||
) -> impl Fn(&mut Ctx, i32, i64, i32, i32) {
|
||||
) -> impl Fn(&mut Ctx, i32, i32, i32, i32) {
|
||||
move |ctx, level, target, msg_offset, msg_size| {
|
||||
if target == 0 || target & logging_mask != 0 {
|
||||
log_utf8_string(&module, ctx, level, msg_offset, msg_size)
|
||||
|
@ -115,7 +115,7 @@ pub struct TomlFaaSModuleConfig {
|
||||
pub logger_enabled: Option<bool>,
|
||||
pub wasi: Option<TomlWASIConfig>,
|
||||
pub mounted_binaries: Option<toml::value::Table>,
|
||||
pub logging_mask: Option<i64>,
|
||||
pub logging_mask: Option<i32>,
|
||||
}
|
||||
|
||||
impl TomlFaaSNamedModuleConfig {
|
||||
@ -182,7 +182,7 @@ pub fn from_toml_module_config(config: TomlFaaSModuleConfig) -> Result<FaaSModul
|
||||
logger_enabled: config.logger_enabled.unwrap_or(true),
|
||||
host_imports: host_cli_imports,
|
||||
wasi,
|
||||
logging_mask: config.logging_mask.unwrap_or(i64::max_value()),
|
||||
logging_mask: config.logging_mask.unwrap_or(i32::max_value()),
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user