fix(ci): skip mimalloc FFI and disable isolation for Miri (#621)

- Add cfg(not(miri)) guards to mimalloc module, global allocator, and
  allocator-memory-limits code paths so Miri falls back to the default
  system allocator instead of calling unsupported FFI functions.
- Set MIRIFLAGS="-Zmiri-disable-isolation" in the workflow so tests
  that perform file I/O can run under Miri.
- Skip units/parse tests under Miri due to Float-vs-BigInt Number
  representation mismatch with Miri's soft-float emulation.

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
Anand Krishnamoorthi
2026-03-11 15:13:51 -05:00
committed by GitHub
parent b8e15f46f3
commit ee3dff9a3d
9 changed files with 34 additions and 19 deletions

View File

@@ -1,25 +1,25 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#[cfg(not(any(target_family = "wasm")))]
#[cfg(not(any(target_family = "wasm", miri)))]
pub mod mimalloc;
#[cfg(feature = "allocator-memory-limits")]
#[cfg(not(any(target_family = "wasm")))]
#[cfg(not(any(target_family = "wasm", miri)))]
pub use mimalloc::{
allocation_stats_snapshot, current_thread_allocation_stats, global_allocation_stats_snapshot,
GlobalAllocationStats, ThreadAllocationStats,
};
#[cfg(feature = "allocator-memory-limits")]
#[cfg(not(any(target_family = "wasm")))]
#[cfg(not(any(target_family = "wasm", miri)))]
pub mod limits;
/// Declare a global allocator if the platform supports it.
#[macro_export]
macro_rules! assign_global {
() => {
#[cfg(not(any(target_family = "wasm")))]
#[cfg(not(any(target_family = "wasm", miri)))]
#[global_allocator]
static GLOBAL: mimalloc::mimalloc::Mimalloc = mimalloc::mimalloc::Mimalloc;
};