From 7f4dfc0df79f059be2aadfa8cc74ce98694d70d3 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Fri, 29 May 2026 16:19:48 +0800 Subject: [PATCH 1/5] Bump version --- CHANGELOG.md | 11 +++++++++++ Cargo.toml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a535d85ea..596cfa2cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,17 @@ Rhai Release Notes ================== +Version 1.25.1 +============== + +This is a patch release that reverses the change in `1.25.0` that removed certain exports from the +`rhai::plugin` module, which is a breaking change. + +The exports are now re-added will only be removed in the next major version. + +Thanks to [`@Abendrill`](https://github.com/Abendrill) [`#1099`](https://github.com/rhaiscript/rhai/pull/1099). + + Version 1.25.0 ============== diff --git a/Cargo.toml b/Cargo.toml index 7974d7538..a0e1f789e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = [".", "codegen", "codegen/tests/custom_root"] [package] name = "rhai" -version = "1.25.0" +version = "1.25.1" rust-version = "1.66.0" edition = "2018" resolver = "2" From ec905ccb599d6af77edfa08a03183b3b68e401f3 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sun, 31 May 2026 11:16:15 +0800 Subject: [PATCH 2/5] Add new CI test jobs and expand feature coverage - Add f32_float+only_i32 and ultra-minimal embedded feature combos to build matrix - Restore macOS no_std build (was commented out) - Restore bare wasm32-unknown-unknown target (was commented out) - Extend Clippy to deny correctness and suspicious lints - Add audit job: cargo audit for CVE scanning - Add doc job: cargo doc with -D warnings - Add cross_32bit job: i686-unknown-linux-gnu build - Add cross_arm64 job: aarch64-unknown-linux-gnu build - Add miri job: UB detection in unsafe blocks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/build.yml | 100 ++++++++++++++++++++++++++++++++++-- 1 file changed, 95 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a7f4e81d..f48fe3758 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,6 +71,10 @@ jobs: - "--features testing-environ,no_closure,serde,metadata,internals,debugging" - "--features testing-environ,sync,no_time,no_function,no_float,no_position,no_optimize,no_module,no_closure,no_custom_syntax,metadata,serde,unchecked,debugging" - "--features testing-environ,no_time,no_function,no_float,no_position,no_index,no_object,no_optimize,no_module,no_closure,no_custom_syntax,unchecked" + # Combined reduced numeric types: common embedded config not previously tested together + - "--features testing-environ,f32_float,only_i32,serde,metadata,internals,debugging" + # Most stripped-down embedded config + - "--features testing-environ,no_float,only_i32,no_object,no_index,no_module,no_function,sync" toolchain: [stable] experimental: [false] include: @@ -104,7 +108,7 @@ jobs: include: - {os: ubuntu-latest, flags: "--profile unix", experimental: false} - {os: windows-latest, flags: "--profile windows", experimental: true} - #- {os: macos-latest, flags: "--profile macos", experimental: false} + - {os: macos-latest, flags: "--profile macos", experimental: false} steps: - name: Checkout uses: actions/checkout@v4 @@ -126,8 +130,7 @@ jobs: matrix: flags: - "--target wasm32-wasip1" -# These fail currently, future PR should fix them -# - "--target wasm32-unknown-unknown" + - "--target wasm32-unknown-unknown" - "--target wasm32-unknown-unknown --features wasm-bindgen" - "--target wasm32-unknown-unknown --no-default-features --features std" - "--target wasm32-unknown-unknown --no-default-features --features std,wasm-bindgen" @@ -175,7 +178,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: clippy - args: --all -- -Aclippy::all -Dclippy::perf + args: --all -- -Aclippy::all -Dclippy::perf -Dclippy::correctness -Dclippy::suspicious codegen_build: name: Codegen Build @@ -203,4 +206,91 @@ jobs: uses: actions-rs/cargo@v1 with: command: test - args: --manifest-path=codegen/tests/custom_root/Cargo.toml ${{matrix.flags}} \ No newline at end of file + args: --manifest-path=codegen/tests/custom_root/Cargo.toml ${{matrix.flags}} + + # Security audit: check dependencies for known CVEs + audit: + name: Security Audit + runs-on: ubuntu-latest + continue-on-error: true + steps: + - uses: actions/checkout@v4 + - name: Install cargo-audit + run: cargo install cargo-audit --locked + - name: Run cargo audit + run: cargo audit + + # Ensure all doc-comments compile cleanly with doc-relevant features + doc: + name: Check Documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Build docs + uses: actions-rs/cargo@v1 + env: + RUSTDOCFLAGS: "-D warnings" + with: + command: doc + args: --no-deps --features document-features,metadata,serde,internals,decimal,debugging + + # 32-bit Linux: catch pointer/size assumptions for embedded targets + cross_32bit: + name: Cross-compile 32-bit Linux + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + target: i686-unknown-linux-gnu + - name: Install 32-bit libc + run: sudo apt-get update && sudo apt-get install -y gcc-multilib + - name: Build (32-bit) + uses: actions-rs/cargo@v1 + with: + command: build + args: --target i686-unknown-linux-gnu --features testing-environ,serde,metadata,internals,debugging + + # ARM64 cross-compile: common deployment target for embedded Rhai + cross_arm64: + name: Cross-compile ARM64 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + target: aarch64-unknown-linux-gnu + - name: Install cross-linker + run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu + - name: Build (ARM64) + uses: actions-rs/cargo@v1 + env: + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc + with: + command: build + args: --target aarch64-unknown-linux-gnu --features testing-environ,serde,metadata,internals,debugging + + # MIRI: detect undefined behavior in unsafe blocks (reify.rs, call.rs, register.rs) + miri: + name: MIRI + runs-on: ubuntu-latest + continue-on-error: true + steps: + - uses: actions/checkout@v4 + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + components: miri + - name: Run MIRI + env: + MIRIFLAGS: "-Zmiri-strict-provenance" + run: cargo miri test --features testing-environ -- --test-threads=1 \ No newline at end of file From 537c8c2c3d44b47f37fcf5dddee9352131a0e49f Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sun, 31 May 2026 12:13:25 +0800 Subject: [PATCH 3/5] Fix some CI errors --- .github/workflows/build.yml | 9 ++++----- src/func/call.rs | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f48fe3758..6edc0b3c2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,10 +71,8 @@ jobs: - "--features testing-environ,no_closure,serde,metadata,internals,debugging" - "--features testing-environ,sync,no_time,no_function,no_float,no_position,no_optimize,no_module,no_closure,no_custom_syntax,metadata,serde,unchecked,debugging" - "--features testing-environ,no_time,no_function,no_float,no_position,no_index,no_object,no_optimize,no_module,no_closure,no_custom_syntax,unchecked" - # Combined reduced numeric types: common embedded config not previously tested together - - "--features testing-environ,f32_float,only_i32,serde,metadata,internals,debugging" - # Most stripped-down embedded config - - "--features testing-environ,no_float,only_i32,no_object,no_index,no_module,no_function,sync" + - "--tests --features testing-environ,f32_float,only_i32,serde,metadata,internals,debugging" + - "--tests --features testing-environ,no_float,only_i32,no_object,no_index,no_module,no_function,sync" toolchain: [stable] experimental: [false] include: @@ -130,7 +128,8 @@ jobs: matrix: flags: - "--target wasm32-wasip1" - - "--target wasm32-unknown-unknown" + # The `wasm32-unknown-unknown` target is not supported by default as it requires `wasm_js`. + #- "--target wasm32-unknown-unknown" - "--target wasm32-unknown-unknown --features wasm-bindgen" - "--target wasm32-unknown-unknown --no-default-features --features std" - "--target wasm32-unknown-unknown --no-default-features --features std,wasm-bindgen" diff --git a/src/func/call.rs b/src/func/call.rs index 72ff34d2e..9e1ac16d7 100644 --- a/src/func/call.rs +++ b/src/func/call.rs @@ -85,7 +85,7 @@ impl<'a> ArgBackup<'a> { // We can do this here because, before the end of this scope, we'd restore the original // reference via `restore_first_arg`. Therefore this shorter lifetime does not leak. self.orig_mut = Some(mem::replace(&mut args[0], unsafe { - mem::transmute(&mut self.value_copy) + mem::transmute::<&mut Dynamic, &'a mut Dynamic>(&mut self.value_copy) })); } /// This function restores the first argument that was replaced by `change_first_arg_to_copy`. From 8b0989cf684cfcd3a172d0014dcf76172cde2dc5 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sun, 31 May 2026 16:08:27 +0800 Subject: [PATCH 4/5] Fix tests output --- codegen/ui_tests/export_fn_raw_return.stderr | 4 ++-- codegen/ui_tests/export_mod_raw_return.stderr | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/codegen/ui_tests/export_fn_raw_return.stderr b/codegen/ui_tests/export_fn_raw_return.stderr index 9458b58ec..ce7344c43 100644 --- a/codegen/ui_tests/export_fn_raw_return.stderr +++ b/codegen/ui_tests/export_fn_raw_return.stderr @@ -7,6 +7,6 @@ error[E0599]: `bool` is not an iterator | ^^^^ `bool` is not an iterator | = note: the following trait bounds were not satisfied: - `bool: Iterator` - which is required by `&mut bool: Iterator` + `bool: std::iter::Iterator` + which is required by `&mut bool: std::iter::Iterator` = note: this error originates in the attribute macro `export_fn` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/codegen/ui_tests/export_mod_raw_return.stderr b/codegen/ui_tests/export_mod_raw_return.stderr index 0ae1c34f0..1725166d8 100644 --- a/codegen/ui_tests/export_mod_raw_return.stderr +++ b/codegen/ui_tests/export_mod_raw_return.stderr @@ -8,6 +8,6 @@ error[E0599]: `bool` is not an iterator | ^^^^ `bool` is not an iterator | = note: the following trait bounds were not satisfied: - `bool: Iterator` - which is required by `&mut bool: Iterator` + `bool: std::iter::Iterator` + which is required by `&mut bool: std::iter::Iterator` = note: this error originates in the attribute macro `export_module` (in Nightly builds, run with -Z macro-backtrace for more info) From 61e409ed884114d38cd63647b034d450e1da5781 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sun, 31 May 2026 16:10:56 +0800 Subject: [PATCH 5/5] Disable Miri tests --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6edc0b3c2..fa7e75cea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -277,9 +277,9 @@ jobs: command: build args: --target aarch64-unknown-linux-gnu --features testing-environ,serde,metadata,internals,debugging - # MIRI: detect undefined behavior in unsafe blocks (reify.rs, call.rs, register.rs) miri: name: MIRI + if: false runs-on: ubuntu-latest continue-on-error: true steps: