diff --git a/.circleci/config.yml b/.circleci/config.yml index d405aa64a..594179f21 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ jobs: # All checks on the codebase that can run in parallel to build_shared_library libwasmvm_sanity: docker: - - image: cimg/rust:1.65.0 + - image: cimg/rust:1.67.0 steps: - checkout - run: @@ -18,8 +18,8 @@ jobs: command: rustup component add clippy rustfmt - restore_cache: keys: - - cargocache-v3-libwasmvm_sanity-rust:1.65.0-{{ checksum "libwasmvm/Cargo.lock" }} - - cargocache-v3-libwasmvm_sanity-rust:1.65.0- + - cargocache-v3-libwasmvm_sanity-rust:1.67.0-{{ checksum "libwasmvm/Cargo.lock" }} + - cargocache-v3-libwasmvm_sanity-rust:1.67.0- - run: name: Ensure libwasmvm/bindings.h is up-to-date working_directory: libwasmvm @@ -66,7 +66,7 @@ jobs: - libwasmvm/target/release/.fingerprint - libwasmvm/target/release/build - libwasmvm/target/release/deps - key: cargocache-v3-libwasmvm_sanity-rust:1.65.0-{{ checksum "libwasmvm/Cargo.lock" }} + key: cargocache-v3-libwasmvm_sanity-rust:1.67.0-{{ checksum "libwasmvm/Cargo.lock" }} # This performs all the Rust debug builds on Windows. Similar to libwasmvm_sanity # but avoids duplicating things that are not platform dependent. @@ -84,15 +84,15 @@ jobs: command: | set -o errexit curl -sS --output rustup-init.exe https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe - ./rustup-init.exe --no-modify-path --profile minimal --default-toolchain 1.65.0 -y + ./rustup-init.exe --no-modify-path --profile minimal --default-toolchain 1.67.0 -y echo 'export PATH="$PATH;$USERPROFILE/.cargo/bin"' >> "$BASH_ENV" - run: name: Show Rust version information command: rustc --version; cargo --version; rustup --version - restore_cache: keys: - - cachev4-libwasmvm_sanity_windows-rust:1.65.0-{{ checksum "libwasmvm/Cargo.lock" }} - - cachev4-libwasmvm_sanity_windows-rust:1.65.0- + - cachev4-libwasmvm_sanity_windows-rust:1.67.0-{{ checksum "libwasmvm/Cargo.lock" }} + - cachev4-libwasmvm_sanity_windows-rust:1.67.0- - run: name: Run unit tests working_directory: libwasmvm @@ -104,7 +104,7 @@ jobs: - libwasmvm/target/debug/.fingerprint - libwasmvm/target/debug/build - libwasmvm/target/debug/deps - key: cachev4-libwasmvm_sanity_windows-rust:1.65.0-{{ checksum "libwasmvm/Cargo.lock" }} + key: cachev4-libwasmvm_sanity_windows-rust:1.67.0-{{ checksum "libwasmvm/Cargo.lock" }} libwasmvm_audit: docker: @@ -219,7 +219,7 @@ jobs: build_shared_library: docker: - - image: cimg/rust:1.65.0 + - image: cimg/rust:1.67.0 steps: - checkout - run: @@ -227,8 +227,8 @@ jobs: command: rustc --version; cargo --version; rustup --version - restore_cache: keys: - - cargocache-v3-build_shared_library-rust:1.65.0-{{ checksum "libwasmvm/Cargo.lock" }} - - cargocache-v3-build_shared_library-rust:1.65.0- + - cargocache-v3-build_shared_library-rust:1.67.0-{{ checksum "libwasmvm/Cargo.lock" }} + - cargocache-v3-build_shared_library-rust:1.67.0- - run: name: Create release build of libwasmvm command: make build-rust @@ -245,7 +245,7 @@ jobs: - libwasmvm/target/release/.fingerprint - libwasmvm/target/release/build - libwasmvm/target/release/deps - key: cargocache-v3-build_shared_library-rust:1.65.0-{{ checksum "libwasmvm/Cargo.lock" }} + key: cargocache-v3-build_shared_library-rust:1.67.0-{{ checksum "libwasmvm/Cargo.lock" }} # Test the Go project wasmvm_test: diff --git a/docs/COMPILER_VERSIONS.md b/docs/COMPILER_VERSIONS.md index 06e7c3bc8..785053066 100644 --- a/docs/COMPILER_VERSIONS.md +++ b/docs/COMPILER_VERSIONS.md @@ -64,5 +64,5 @@ We currently use the following version: | Type | Rust version | Note | | ------------------------ | ------------ | --------------------------------- | | Production Rust compiler | 1.69.0 | Builders version 0016 | -| Min Rust compiler | 1.65.0 | Supports builder versions >= 0014 | +| Min Rust compiler | 1.67.0 | Supports builder versions >= 0015 | | Tooling Rust compiler | 1.69.0 | | diff --git a/libwasmvm/src/api.rs b/libwasmvm/src/api.rs index 39b63dd54..e62f39fe1 100644 --- a/libwasmvm/src/api.rs +++ b/libwasmvm/src/api.rs @@ -64,7 +64,7 @@ impl BackendApi for GoApi { let gas_info = GasInfo::with_cost(used_gas); // return complete error message (reading from buffer for GoError::Other) - let default = || format!("Failed to canonicalize the address: {}", human); + let default = || format!("Failed to canonicalize the address: {human}"); unsafe { if let Err(err) = go_error.into_result(error_msg, default) { return (Err(err), gas_info); diff --git a/libwasmvm/src/cache.rs b/libwasmvm/src/cache.rs index 1f0fe8823..736392187 100644 --- a/libwasmvm/src/cache.rs +++ b/libwasmvm/src/cache.rs @@ -41,7 +41,7 @@ pub extern "C" fn init_cache( ) }) .unwrap_or_else(|err| { - eprintln!("Panic in do_init_cache: {:?}", err); + eprintln!("Panic in do_init_cache: {err:?}"); Err(Error::panic()) }); handle_c_error_ptr(r, error_msg) as *mut cache_t @@ -93,7 +93,7 @@ pub extern "C" fn save_wasm( let r = match to_cache(cache) { Some(c) => catch_unwind(AssertUnwindSafe(move || do_save_wasm(c, wasm, unchecked))) .unwrap_or_else(|err| { - eprintln!("Panic in do_save_wasm: {:?}", err); + eprintln!("Panic in do_save_wasm: {err:?}"); Err(Error::panic()) }), None => Err(Error::unset_arg(CACHE_ARG)), @@ -125,7 +125,7 @@ pub extern "C" fn remove_wasm( let r = match to_cache(cache) { Some(c) => catch_unwind(AssertUnwindSafe(move || do_remove_wasm(c, checksum))) .unwrap_or_else(|err| { - eprintln!("Panic in do_remove_wasm: {:?}", err); + eprintln!("Panic in do_remove_wasm: {err:?}"); Err(Error::panic()) }), None => Err(Error::unset_arg(CACHE_ARG)), @@ -154,7 +154,7 @@ pub extern "C" fn load_wasm( let r = match to_cache(cache) { Some(c) => catch_unwind(AssertUnwindSafe(move || do_load_wasm(c, checksum))) .unwrap_or_else(|err| { - eprintln!("Panic in do_load_wasm: {:?}", err); + eprintln!("Panic in do_load_wasm: {err:?}"); Err(Error::panic()) }), None => Err(Error::unset_arg(CACHE_ARG)), @@ -184,7 +184,7 @@ pub extern "C" fn pin( let r = match to_cache(cache) { Some(c) => { catch_unwind(AssertUnwindSafe(move || do_pin(c, checksum))).unwrap_or_else(|err| { - eprintln!("Panic in do_pin: {:?}", err); + eprintln!("Panic in do_pin: {err:?}"); Err(Error::panic()) }) } @@ -214,7 +214,7 @@ pub extern "C" fn unpin( let r = match to_cache(cache) { Some(c) => { catch_unwind(AssertUnwindSafe(move || do_unpin(c, checksum))).unwrap_or_else(|err| { - eprintln!("Panic in do_unpin: {:?}", err); + eprintln!("Panic in do_unpin: {err:?}"); Err(Error::panic()) }) } @@ -279,7 +279,7 @@ pub extern "C" fn analyze_code( let r = match to_cache(cache) { Some(c) => catch_unwind(AssertUnwindSafe(move || do_analyze_code(c, checksum))) .unwrap_or_else(|err| { - eprintln!("Panic in do_analyze_code: {:?}", err); + eprintln!("Panic in do_analyze_code: {err:?}"); Err(Error::panic()) }), None => Err(Error::unset_arg(CACHE_ARG)), @@ -357,7 +357,7 @@ pub extern "C" fn get_metrics( let r = match to_cache(cache) { Some(c) => { catch_unwind(AssertUnwindSafe(move || do_get_metrics(c))).unwrap_or_else(|err| { - eprintln!("Panic in do_get_metrics: {:?}", err); + eprintln!("Panic in do_get_metrics: {err:?}"); Err(Error::panic()) }) } diff --git a/libwasmvm/src/calls.rs b/libwasmvm/src/calls.rs index 8d89a8788..8bbd048d6 100644 --- a/libwasmvm/src/calls.rs +++ b/libwasmvm/src/calls.rs @@ -432,7 +432,7 @@ fn call_2_args( ) })) .unwrap_or_else(|err| { - eprintln!("Panic in do_call_2_args: {:?}", err); + eprintln!("Panic in do_call_2_args: {err:?}"); Err(Error::panic()) }), None => Err(Error::unset_arg(CACHE_ARG)), @@ -519,7 +519,7 @@ fn call_3_args( ) })) .unwrap_or_else(|err| { - eprintln!("Panic in do_call_3_args: {:?}", err); + eprintln!("Panic in do_call_3_args: {err:?}"); Err(Error::panic()) }), None => Err(Error::unset_arg(CACHE_ARG)), diff --git a/libwasmvm/src/querier.rs b/libwasmvm/src/querier.rs index 854c50583..3d22a48a7 100644 --- a/libwasmvm/src/querier.rs +++ b/libwasmvm/src/querier.rs @@ -74,7 +74,7 @@ impl Querier for GoQuerier { let bin_result: Vec = output.unwrap_or_default(); let result = serde_json::from_slice(&bin_result).or_else(|e| { Ok(SystemResult::Err(SystemError::InvalidResponse { - error: format!("Parsing Go response: {}", e), + error: format!("Parsing Go response: {e}"), response: bin_result.into(), })) }); diff --git a/libwasmvm/src/test_utils.rs b/libwasmvm/src/test_utils.rs index d6e5f515a..9dbd08dc8 100644 --- a/libwasmvm/src/test_utils.rs +++ b/libwasmvm/src/test_utils.rs @@ -40,12 +40,10 @@ pub fn assert_approx_eq_impl>( if rel_diff > max_rel_diff { match panic_msg { Some(panic_msg) => panic!( - "assertion failed: `(left ≈ right)`\nleft: {}\nright: {}\nrelative difference: {}\nmax allowed relative difference: {}\n: {}", - left, right, rel_diff, max_rel_diff, panic_msg + "assertion failed: `(left ≈ right)`\nleft: {left}\nright: {right}\nrelative difference: {rel_diff}\nmax allowed relative difference: {max_rel_diff}\n: {panic_msg}" ), None => panic!( - "assertion failed: `(left ≈ right)`\nleft: {}\nright: {}\nrelative difference: {}\nmax allowed relative difference: {}\n", - left, right, rel_diff, max_rel_diff + "assertion failed: `(left ≈ right)`\nleft: {left}\nright: {right}\nrelative difference: {rel_diff}\nmax allowed relative difference: {max_rel_diff}\n" ), } } diff --git a/libwasmvm/src/tests.rs b/libwasmvm/src/tests.rs index dcd9485f3..9cd7f63a7 100644 --- a/libwasmvm/src/tests.rs +++ b/libwasmvm/src/tests.rs @@ -42,7 +42,7 @@ fn handle_cpu_loop_with_cache() { let res = call_instantiate_raw(&mut instance, &raw_env, &raw_info, b"{}"); let gas_left = instance.get_gas_left(); let gas_used = options.gas_limit - gas_left; - println!("Init gas left: {}, used: {}", gas_left, gas_used); + println!("Init gas left: {gas_left}, used: {gas_used}"); assert!(res.is_ok()); let backend = instance.recycle().unwrap(); @@ -52,7 +52,7 @@ fn handle_cpu_loop_with_cache() { let res = call_execute_raw(&mut instance, &raw_env, &raw_info, raw_msg); let gas_left = instance.get_gas_left(); let gas_used = options.gas_limit - gas_left; - println!("Handle gas left: {}, used: {}", gas_left, gas_used); + println!("Handle gas left: {gas_left}, used: {gas_used}"); assert!(res.is_err()); assert_eq!(gas_left, 0); let _ = instance.recycle(); @@ -71,7 +71,7 @@ fn handle_cpu_loop_no_cache() { let res = call_instantiate_raw(&mut instance, &raw_env, &raw_info, b"{}"); let gas_left = instance.get_gas_left(); let gas_used = gas_limit - gas_left; - println!("Init gas left: {}, used: {}", gas_left, gas_used); + println!("Init gas left: {gas_left}, used: {gas_used}"); assert!(res.is_ok()); // execute @@ -79,7 +79,7 @@ fn handle_cpu_loop_no_cache() { let res = call_execute_raw(&mut instance, &raw_env, &raw_info, raw_msg); let gas_left = instance.get_gas_left(); let gas_used = gas_limit - gas_left; - println!("Handle gas left: {}, used: {}", gas_left, gas_used); + println!("Handle gas left: {gas_left}, used: {gas_used}"); assert!(res.is_err()); assert_eq!(gas_left, 0); }