From e27030456d6f2f9bd5faab0436aab1fe33b7bd59 Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Tue, 12 Aug 2025 09:57:52 +0800 Subject: [PATCH 1/4] Run CI tests with aarch64-apple-darwin Apple will stop supporting Intel Mac, and Rust 1.89 has demoted the x86_64-apple-darwin toolchain to Tier 2. We instead run CI tests against aarch64-apple-darwin which is used by Mac computers with Apple silicon. Fixes: https://github.com/mmtk/mmtk-core/issues/1365 --- ...86_64-apple-darwin.sh => ci-setup-aarch64-apple-darwin.sh} | 0 .github/scripts/ci-style.sh | 4 ---- .github/workflows/merge-check.yml | 4 ++-- .github/workflows/minimal-tests-core.yml | 4 ++-- 4 files changed, 4 insertions(+), 8 deletions(-) rename .github/scripts/{ci-setup-x86_64-apple-darwin.sh => ci-setup-aarch64-apple-darwin.sh} (100%) diff --git a/.github/scripts/ci-setup-x86_64-apple-darwin.sh b/.github/scripts/ci-setup-aarch64-apple-darwin.sh similarity index 100% rename from .github/scripts/ci-setup-x86_64-apple-darwin.sh rename to .github/scripts/ci-setup-aarch64-apple-darwin.sh diff --git a/.github/scripts/ci-style.sh b/.github/scripts/ci-style.sh index 0482321b52..4c71edf6d5 100755 --- a/.github/scripts/ci-style.sh +++ b/.github/scripts/ci-style.sh @@ -13,10 +13,6 @@ if [[ $CLIPPY_VERSION == "clippy 0.1.72"* ]]; then export CARGO_INCREMENTAL=0 fi -if [[ $CLIPPY_VERSION == "clippy 0.1.77"* && $CARGO_BUILD_TARGET == "x86_64-apple-darwin" ]]; then - export SKIP_CLIPPY=1 -fi - # --- Check main crate --- if [[ $SKIP_CLIPPY == 1 ]]; then diff --git a/.github/workflows/merge-check.yml b/.github/workflows/merge-check.yml index 8dd53785e9..be33f7bfff 100644 --- a/.github/workflows/merge-check.yml +++ b/.github/workflows/merge-check.yml @@ -22,10 +22,10 @@ env: "check-api-migration-update", "minimal-tests-core/x86_64-unknown-linux-gnu/stable", "minimal-tests-core/i686-unknown-linux-gnu/stable", - "minimal-tests-core/x86_64-apple-darwin/stable", + "minimal-tests-core/aarch64-apple-darwin/stable", "style-check/x86_64-unknown-linux-gnu/stable", "style-check/i686-unknown-linux-gnu/stable", - "style-check/x86_64-apple-darwin/stable", + "style-check/aarch64-apple-darwin/stable", "extended-tests-openjdk / test", "extended-tests-v8", "extended-tests-jikesrvm", diff --git a/.github/workflows/minimal-tests-core.yml b/.github/workflows/minimal-tests-core.yml index 2a113ca850..cf453d5196 100644 --- a/.github/workflows/minimal-tests-core.yml +++ b/.github/workflows/minimal-tests-core.yml @@ -36,7 +36,7 @@ jobs: target: - { os: ubuntu-22.04, triple: x86_64-unknown-linux-gnu } - { os: ubuntu-22.04, triple: i686-unknown-linux-gnu } - - { os: macos-15, triple: x86_64-apple-darwin } + - { os: macos-15, triple: aarch64-apple-darwin } rust: ${{ fromJson(needs.setup-test-matrix.outputs.rust )}} name: minimal-tests-core/${{ matrix.target.triple }}/${{ matrix.rust }} @@ -87,7 +87,7 @@ jobs: target: - { os: ubuntu-22.04, triple: x86_64-unknown-linux-gnu } - { os: ubuntu-22.04, triple: i686-unknown-linux-gnu } - - { os: macos-15, triple: x86_64-apple-darwin } + - { os: macos-15, triple: aarch64-apple-darwin } rust: ${{ fromJson(needs.setup-test-matrix.outputs.rust )}} name: style-check/${{ matrix.target.triple }}/${{ matrix.rust }} From 7c7f47600623eefe98e26bb5f2aa3556170bcc5a Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Tue, 12 Aug 2025 10:19:39 +0800 Subject: [PATCH 2/4] Switch to libmimalloc-sys The `mimalloc-sys` crate is not actively maintained. We switch to `libmimalloc-sys` instead. --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f96df1ec29..55c5b9e806 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ lazy_static = "1.1" libc = "0.2" log = { version = "0.4", features = ["max_level_trace", "release_max_level_off"] } memoffset = "0.9" -mimalloc-sys = { version = "0.1.6", optional = true } +libmimalloc-sys = { version = "0.1.43", optional = true } # MMTk macros - we have to specify a version here in order to publish the crate, even though we use the dependency from a local path. mmtk-macros = { version="0.31.0", path = "macros/" } num_cpus = "1.8" @@ -238,7 +238,7 @@ vo_bit_access = [] # Group:malloc # only one of the following features should be enabled, or none to use the default malloc from libc # this does not replace the global Rust allocator, but provides these libraries for GC implementation -malloc_mimalloc = ["dep:mimalloc-sys"] +malloc_mimalloc = ["dep:libmimalloc-sys"] malloc_jemalloc = ["dep:jemalloc-sys"] # Use the native mimalloc allocator for malloc. This is not tested by me (Yi) yet, and it is only used to make sure that some code From 0a5a736545de0f19fcf3fd1537eec929b2935ed9 Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Tue, 12 Aug 2025 10:31:43 +0800 Subject: [PATCH 3/4] Fix crate name and func names --- Cargo.toml | 2 +- src/util/malloc/library.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 55c5b9e806..edbc85f3d2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ lazy_static = "1.1" libc = "0.2" log = { version = "0.4", features = ["max_level_trace", "release_max_level_off"] } memoffset = "0.9" -libmimalloc-sys = { version = "0.1.43", optional = true } +libmimalloc-sys = { version = "0.1.43", features = ["extended"], optional = true } # MMTk macros - we have to specify a version here in order to publish the crate, even though we use the dependency from a local path. mmtk-macros = { version="0.31.0", path = "macros/" } num_cpus = "1.8" diff --git a/src/util/malloc/library.rs b/src/util/malloc/library.rs index 2177a06144..7796eb9f30 100644 --- a/src/util/malloc/library.rs +++ b/src/util/malloc/library.rs @@ -33,13 +33,13 @@ mod mimalloc { // Normal 4K page accounting pub const LOG_BYTES_IN_MALLOC_PAGE: u8 = crate::util::constants::LOG_BYTES_IN_PAGE; // ANSI C - pub use mimalloc_sys::{ + pub use libmimalloc_sys::{ mi_calloc as calloc, mi_free as free, mi_malloc as malloc, mi_realloc as realloc, }; // Posix - pub use mimalloc_sys::mi_posix_memalign as posix_memalign; + pub use libmimalloc_sys::mi_posix_memalign as posix_memalign; // GNU - pub use mimalloc_sys::mi_malloc_usable_size as malloc_usable_size; + pub use libmimalloc_sys::mi_usable_size as malloc_usable_size; } /// If no malloc lib is specified, use the libc implementation From 6feb46b9f307ab40d96f186af363b59afc0144dd Mon Sep 17 00:00:00 2001 From: Kunshan Wang Date: Tue, 12 Aug 2025 10:47:00 +0800 Subject: [PATCH 4/4] Order dependencies alphabetically. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index edbc85f3d2..cd4df3b9c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,9 +35,9 @@ itertools = "0.14.0" jemalloc-sys = { version = "0.5.3", features = ["disable_initial_exec_tls"], optional = true } lazy_static = "1.1" libc = "0.2" +libmimalloc-sys = { version = "0.1.43", features = ["extended"], optional = true } log = { version = "0.4", features = ["max_level_trace", "release_max_level_off"] } memoffset = "0.9" -libmimalloc-sys = { version = "0.1.43", features = ["extended"], optional = true } # MMTk macros - we have to specify a version here in order to publish the crate, even though we use the dependency from a local path. mmtk-macros = { version="0.31.0", path = "macros/" } num_cpus = "1.8"