Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: enable no_opt_arch flag for mimalloc-safe on linux-aarch64 #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 24, 2025

Conversation

JounQin
Copy link
Member

@JounQin JounQin commented Apr 24, 2025

related #64


Important

Enable no_opt_arch flag for mimalloc-safe on linux-aarch64 and update dependencies and tests.

  • Behavior:
    • Enable no_opt_arch flag for mimalloc-safe on linux-aarch64 in Cargo.toml and lib.rs.
    • Add test case for resolving recursive symbolic links in resolver.test.mjs.
  • Refactor:
    • Rename oxc_resolver() to unrs_resolver() in resolver.rs.
    • Simplify directory path constants in resolver.test.mjs.
  • Dependencies:
    • Update mimalloc-safe to version 0.1.51 and napi-postinstall to 0.1.6 in Cargo.lock and package.json.
  • CI/CD:
    • Modify workflow in release-napi.yml to run on pull requests targeting the main branch.
    • Adjust test and initialization commands in justfile to include JavaScript/Node tests.

This description was created by Ellipsis for cf87758. You can customize this summary. It will automatically update as commits are pushed.


Summary by CodeRabbit

  • New Features

    • Added a new test case for resolving recursive symbolic links within pnpm workspace projects.
  • Bug Fixes

    • Enabled the mimalloc allocator on additional platforms, including Linux/aarch64, for improved performance.
  • Refactor

    • Simplified and reused directory path constants in test files for improved readability.
    • Renamed a resolver function in benchmarking code for consistency.
  • Chores

    • Updated dependencies: mimalloc-safe and napi-postinstall to newer versions.
    • Modified workflow to run on pull requests targeting the main branch.
    • Adjusted test and initialization commands to include JavaScript/Node tests and reordered tool installations.

@JounQin JounQin requested a review from Copilot April 24, 2025 07:08
Copy link

coderabbitai bot commented Apr 24, 2025

Walkthrough

This set of changes updates various aspects of the project across workflow configuration, benchmarking, dependency management, test structure, and scripting. The release workflow is modified to trigger on pull requests to the main branch and to always run the build job. The benchmarking code renames a resolver function for clarity. Dependency versions and conditional compilation expressions for the mimalloc-safe allocator are updated and simplified, with corresponding adjustments in Rust code to enable the allocator on more platforms. Test scripts are refactored for maintainability, and a new test is added for recursive symlink resolution. Additionally, a dependency version is updated in the npm package manifest, and the project’s task script is refined.

Changes

File(s) Change Summary
.github/workflows/release-napi.yml Workflow now also triggers on pull requests to main; build job always runs regardless of version change.
benches/resolver.rs Renamed function oxc_resolver to unrs_resolver throughout benchmarks.
justfile Reordered tool installation in init recipe; appended pnpm test to test recipe for JavaScript/Node tests.
napi/Cargo.toml
napi/src/lib.rs
Updated mimalloc-safe to 0.1.51; refined conditional compilation for allocator: simplified expressions and enabled mimalloc on Linux/aarch64; updated Rust code to match new conditions.
napi/tests/resolver.test.mjs Refactored test paths using constants; added new test for recursive symlink resolution in pnpm workspace.
npm/package.json Updated napi-postinstall dependency version from ^0.1.5 to ^0.1.6.

Sequence Diagram(s)

sequenceDiagram
    participant TestRunner as Node.js Test Runner
    participant Resolver as unrs_resolver
    participant FS as File System

    TestRunner->>Resolver: create resolver instance
    TestRunner->>Resolver: resolve deeply nested package.json (recursive symlink)
    Resolver->>FS: follow symlinks, resolve path
    FS-->>Resolver: resolved real path
    Resolver-->>TestRunner: return resolved path
    TestRunner->>TestRunner: assert resolved path matches expected
Loading

Possibly related PRs

  • unrs/unrs-resolver#66: Added the napi-postinstall dependency and postinstall script, which is directly updated in this PR.
  • unrs/unrs-resolver#69: Disabled mimalloc on Linux/aarch64, which is reversed in this PR to re-enable it.
  • unrs/unrs-resolver#96: Modified the same workflow file for build matrix; both PRs alter .github/workflows/release-napi.yml.

Poem

Hopping through the code with cheer,
A new resolver name appears!
Mimalloc now on more machines,
And tests for symlinks in between.
The workflow’s ready, npm’s up to date—
This bunny’s proud to celebrate!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bf6a63d and cf87758.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • .github/workflows/release-napi.yml (2 hunks)
  • benches/resolver.rs (4 hunks)
  • justfile (2 hunks)
  • napi/Cargo.toml (1 hunks)
  • napi/src/lib.rs (1 hunks)
  • napi/tests/resolver.test.mjs (3 hunks)
  • npm/package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
  • npm/package.json
  • .github/workflows/release-napi.yml
  • justfile
  • napi/src/lib.rs
  • napi/tests/resolver.test.mjs
  • napi/Cargo.toml
  • benches/resolver.rs
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Package aarch64-unknown-linux-musl
  • GitHub Check: Package riscv64gc-unknown-linux-musl
  • GitHub Check: Package aarch64-pc-windows-msvc
  • GitHub Check: Package i686-pc-windows-msvc
  • GitHub Check: Package x86_64-pc-windows-msvc
  • GitHub Check: Codacy Static Code Analysis
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables mimalloc on Linux/aarch64 by introducing the "no_opt_arch" flag and updating the dependency configurations accordingly. Other changes include refactoring test and benchmark paths to use newly defined directories and renaming resolver helper functions for clarity.

  • Updated directory resolution in tests for more reliable path joins.
  • Modified mimalloc-safe cfg attributes and dependency conditions in Cargo.toml.
  • Renamed resolver function calls in benchmarks for consistency.
  • Adjusted GitHub workflow triggers.

Reviewed Changes

Copilot reviewed 6 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
napi/tests/resolver.test.mjs Refactored directory path variables to improve fixture location resolution.
napi/src/lib.rs Updated #[cfg] attribute to enable mimalloc on Linux/aarch64 with new flag.
napi/Cargo.toml Adjusted dependency conditions and updated mimalloc-safe version/features.
benches/resolver.rs Renamed resolver function calls from oxc_resolver to unrs_resolver.
.github/workflows/release-napi.yml Added a pull_request trigger on main and commented out a conditional build step.
Files not reviewed (3)
  • justfile: Language not supported
  • npm/package.json: Language not supported
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

napi/src/lib.rs:1

  • The top comment in lib.rs still indicates that mimalloc is disabled for Linux/aarch64, but the configuration now enables it via the no_opt_arch flag. Please update the comment to accurately reflect the current behavior.
// Disable mimalloc on ARM, FreeBSD, WASM, and Linux/aarch64 due to known allocator issues (see #64).

Copy link

socket-security bot commented Apr 24, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License

View full report

@JounQin JounQin changed the title feat: enable no_opt_arch flag for mimalloc-safe with linux-aarch64 feat: enable no_opt_arch flag for mimalloc-safe on linux-aarch64 Apr 24, 2025
Copy link

codecov bot commented Apr 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.40%. Comparing base (05b094f) to head (134ec8f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #98   +/-   ##
=======================================
  Coverage   93.40%   93.40%           
=======================================
  Files          13       13           
  Lines        2865     2865           
=======================================
  Hits         2676     2676           
  Misses        189      189           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

codspeed-hq bot commented Apr 24, 2025

CodSpeed Performance Report

Merging #98 will not alter performance

Comparing bump/mimalloc-safe (134ec8f) with main (05b094f)

Summary

✅ 3 untouched benchmarks

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Changes requested ❌

Reviewed everything up to bf6a63d in 2 minutes and 23 seconds. Click for details.
  • Reviewed 270 lines of code in 8 files
  • Skipped 1 files when reviewing.
  • Skipped posting 12 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. benches/resolver.rs:104
  • Draft comment:
    Renamed resolver function to unrs_resolver for consistency.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is purely informative, stating that a function was renamed for consistency. It does not provide any actionable feedback or suggestions for improvement.
2. napi/Cargo.toml:25
  • Draft comment:
    Updated mimalloc-safe version and cfg conditions for linux-aarch64 to include 'no_opt_arch'. Ensure this change has been well tested on Linux ARM64.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to ensure that the change has been well tested, which violates the rule against asking for confirmation or testing. It does not provide a specific suggestion or point out a specific issue with the code.
3. napi/src/lib.rs:2
  • Draft comment:
    Removed linux-aarch64 exclusion in the global allocator attribute. Confirm allocator stability on linux-aarch64 as referenced in Illegal instruction error - Raspberry PI 4 aarch64 #64.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to confirm allocator stability on linux-aarch64, which violates the rule against asking the author to confirm or ensure behavior. It does not provide a specific code suggestion or ask for a specific test to be written.
4. napi/tests/resolver.test.mjs:16
  • Draft comment:
    Path variables (like fixturesDir and pnpmDir) are now explicitly defined for test clarity; verify that these paths correctly align with project structure.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to verify that the paths align with the project structure, which is a form of asking for confirmation or verification. This violates the rule against asking the PR author to confirm or ensure things. The comment does not provide a specific suggestion or point out a clear issue, so it should be removed.
5. npm/package.json:51
  • Draft comment:
    Bumped napi-postinstall version to ^0.1.6; ensure version bump is intentional for compatibility.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is about a version bump of a dependency, which is not allowed according to the rules. The comment asks the author to ensure the version bump is intentional, which is also not allowed.
6. napi/src/lib.rs:1
  • Draft comment:
    Comment outdated: The header still mentions disabling mimalloc on Linux/aarch64, but now the build enables it using no_opt_arch. Please update the comment accordingly.
  • Reason this comment was not posted:
    Marked as duplicate.
7. napi/Cargo.toml:25
  • Draft comment:
    Good update: The targets for Linux now correctly separate aarch64 with the additional 'no_opt_arch' flag. Verify that these cfg expressions match intended platforms.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
8. benches/resolver.rs:10
  • Draft comment:
    Renamed resolver helper from 'oxc_resolver' to 'unrs_resolver' consistently. Ensure all related tooling/tests correctly reference the new name.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
9. justfile:12
  • Draft comment:
    Initialization script updated. Verify that the reordering of cargo binstall dependencies doesn’t affect tool installation order.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
10. npm/package.json:48
  • Draft comment:
    napi-postinstall version bump to ^0.1.6 looks appropriate; please ensure compatibility with the latest resolver binary.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
11. napi/tests/resolver.test.mjs:266
  • Draft comment:
    Consider renaming the test title from 'resolve recursive symbol link' to 'resolve recursive symlink' for clarity and consistency with common terminology.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% While the suggestion is technically correct (symlink is the proper term), this is a very minor naming issue that doesn't affect functionality. The current name is still understandable. The comment is about changed code (new test), but it's more of a nitpick than a substantial improvement. Test names are primarily for developer readability and documentation. The change would make the code slightly more accurate and professional. Test names are important for documentation and maintainability. However, the current name is still clear enough to understand the test's purpose, and this kind of minor terminology correction doesn't warrant a review comment. While technically correct, this comment is too minor and doesn't meet the bar for "clearly a code change required." The existing test name is functional and clear enough.
12. npm/package.json:44
  • Draft comment:
    Typo detected in the target platform name on line 44: 'wasm32-wasip1-threads'. It likely should be 'wasm32-wasi-threads' (if this is what you intended). Please review this entry.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.

Workflow ID: wflow_A0eSzyHxjSmkB9vy

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
napi/src/lib.rs (1)

1-2: Update the comment to match the implementation.

The comment on line 1 includes "Linux/aarch64" as a platform where mimalloc is disabled, but the updated code on line 2 no longer disables mimalloc on Linux/aarch64. The comment should be updated to match the implementation.

-// Disable mimalloc on ARM, FreeBSD, WASM, and Linux/aarch64 due to known allocator issues (see #64).
+// Disable mimalloc on ARM, FreeBSD, and WASM due to known allocator issues (see #64).
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 05b094f and bf6a63d.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • .github/workflows/release-napi.yml (2 hunks)
  • benches/resolver.rs (4 hunks)
  • justfile (2 hunks)
  • napi/Cargo.toml (1 hunks)
  • napi/src/lib.rs (1 hunks)
  • napi/tests/resolver.test.mjs (3 hunks)
  • npm/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
napi/tests/resolver.test.mjs (1)
Learnt from: JounQin
PR: unrs/unrs-resolver#40
File: src/tests/resolve.rs:121-136
Timestamp: 2025-03-29T04:14:03.715Z
Learning: For tests involving npm/yarn package resolution in the unrs-resolver project, dependencies must be installed first using the appropriate package manager commands (pnpm i, yarn) in both the root directory and fixture directories like fixtures/pnp and fixtures/misc/nested-package-json.
⏰ Context from checks skipped due to timeout of 90000ms (18)
  • GitHub Check: Upload coverage file
  • GitHub Check: Package x86_64-apple-darwin
  • GitHub Check: Package wasm32-wasip1-threads
  • GitHub Check: Package aarch64-apple-darwin
  • GitHub Check: Package riscv64gc-unknown-linux-musl
  • GitHub Check: Package s390x-unknown-linux-gnu
  • GitHub Check: Package riscv64gc-unknown-linux-gnu
  • GitHub Check: Package aarch64-unknown-linux-musl
  • GitHub Check: Package powerpc64le-unknown-linux-gnu
  • GitHub Check: Package armv7-unknown-linux-musleabihf
  • GitHub Check: Package x86_64-unknown-linux-musl
  • GitHub Check: Package aarch64-pc-windows-msvc
  • GitHub Check: Package x86_64-pc-windows-msvc
  • GitHub Check: Package i686-pc-windows-msvc
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Test (windows-latest)
  • GitHub Check: zizmor
  • GitHub Check: Benchmark
🔇 Additional comments (14)
npm/package.json (1)

52-52: Dependency version update looks good.

The update to napi-postinstall from ^0.1.5 to ^0.1.6 aligns with changes in the release workflow that you've made in .github/workflows/release-napi.yml.

justfile (2)

13-13: Tool installation order change looks fine.

Reordering the tools in the init command to install cargo-shear first doesn't affect functionality.


55-55: Good addition to test command.

Adding pnpm test to run JavaScript/Node tests alongside the existing Rust tests makes the test suite more comprehensive. This ensures both Rust and Node.js aspects of the project are properly tested.

.github/workflows/release-napi.yml (2)

12-14: Enhancement to workflow triggers.

Adding pull requests targeting the main branch as a trigger is a good practice. This allows you to catch build issues earlier in the development process, before changes are merged into the main branch.


48-48: Verify if unconditional build is intentional.

You've commented out the conditional check that previously only ran the build job if the version changed. This means the build job will now run unconditionally on all workflow triggers, which could increase CI usage. Is this intentional?

Note that the build-freebsd job at line 141 still has the conditional check.

benches/resolver.rs (2)

104-104: Function rename for consistency.

Renaming from oxc_resolver to unrs_resolver improves consistency with the project name.


151-151: Consistently updated all function references.

All references to the renamed function have been properly updated throughout the benchmark code.

Also applies to: 160-161, 168-169, 177-178, 189-190, 193-194

napi/tests/resolver.test.mjs (4)

18-21: Good refactoring of directory paths!

I like the introduction of rootDir and fixturesDir constants to improve code maintainability and reduce duplication. This makes path management more consistent throughout the test file.


236-237: Well-defined PNPM directory constant

The addition of pnpmDir constant helps standardize references to the .pnpm directory across test assertions. This makes the code more maintainable and easier to update if directory structures change.


266-279: Good addition of recursive symlink resolution test

This new test case is valuable as it verifies the resolver can correctly handle recursive symbolic links in a monorepo setup, which is a common pattern in PNPM workspaces. The test aligns well with the path refactoring changes.

However, I'm curious about the relationship between this test and the PR objective of enabling the no_opt_arch flag for mimalloc-safe with linux-aarch64. Could you clarify if this test is meant to verify functionality on that platform or if it's an unrelated improvement?


248-249: Consistent path references using the new constants

The path references in assertions have been correctly updated to use the new pnpmDir constant, maintaining consistency throughout the test file. This change improves maintainability.

Also applies to: 255-257, 262-263

napi/src/lib.rs (1)

2-4:

❓ Verification inconclusive

Allocator configuration change looks good.

This change enables the MiMalloc allocator for Linux/aarch64 platform which aligns with the PR's objective to use mimalloc-safe with the no_opt_arch flag on this platform.

To verify that mimalloc is correctly enabled for Linux/aarch64 and all other platforms are configured as expected:


🏁 Script executed:

#!/bin/bash
echo "Checking conditional compilation for global allocator in lib.rs"
rg "#\[cfg\(not\(any\(target_arch = \"arm\", target_os = \"freebsd\", target_family = \"wasm\"\)\)\)\]" napi/src/lib.rs -A 2

echo -e "\nChecking current target platform to see if it's affected:"
rustc --version --verbose | grep host

Length of output: 697


Allocator is correctly configured with mimalloc_safe
I’ve confirmed that napi/src/lib.rs contains the expected conditional compilation and global allocator:

#[cfg(not(any(target_arch = "arm", target_os = "freebsd", target_family = "wasm")))]
#[global_allocator]
static ALLOC: mimalloc_safe::MiMalloc = mimalloc_safe::MiMalloc;

This matches the PR’s intent to enable MiMalloc on supported platforms. Since rustc isn’t available in this environment, please verify locally that your host triple (from rustc --version --verbose | grep host) falls under this cfg (e.g. x86_64-unknown-linux-gnu or aarch64-unknown-linux-gnu).

napi/Cargo.toml (2)

19-20: Improved target configuration expression.

The target configuration has been simplified by using not(any(...)) instead of multiple nested conditions, which is more readable. The update to the mimalloc-safe version from 0.1.50 to 0.1.51 is also appropriate.


22-26:

✅ Verification successful

Correctly implemented platform-specific configurations.

The changes split the Linux target configuration into two parts:

  1. Linux on non-ARM, non-aarch64 platforms with standard features
  2. Linux on aarch64 with the additional no_opt_arch feature

This change aligns with the PR objective to enable no_opt_arch flag for mimalloc-safe specifically on Linux/aarch64 platforms.

Let's verify the versions and features of the mimalloc-safe crate:


🏁 Script executed:

#!/bin/bash
echo "Checking mimalloc-safe version and features:"
cargo metadata --format-version 1 | jq '.packages[] | select(.name == "mimalloc-safe") | {version: .version, features: .features}'

echo -e "\nVerifying the no_opt_arch feature is available in mimalloc-safe:"
rg -A 3 "feature.*no_opt_arch" $(cargo metadata --format-version 1 | jq -r '.packages[] | select(.name == "mimalloc-safe") | .manifest_path') || echo "Feature not found in manifest"

echo -e "\nChecking issue #64 to understand the allocator issues:"
gh issue view 64 --json title,body,comments --repo unrs/unrs-resolver

Length of output: 4318


🏁 Script executed:

#!/usr/bin/env bash
echo "Fetching mimalloc-safe 0.1.51 features from crates.io API..."
curl -s https://crates.io/api/v1/crates/mimalloc-safe/0.1.51 | jq '.version.features'

echo -e "\nChecking if \"no_opt_arch\" is a valid feature key..."
curl -s https://crates.io/api/v1/crates/mimalloc-safe/0.1.51 | jq '.version.features | has("no_opt_arch")'

Length of output: 923


Approved: mimalloc-safe platform configurations validated

  • Linux (non-ARM, non-aarch64): uses skip_collect_on_exit, local_dynamic_tls
  • Linux/aarch64: additionally enables no_opt_arch
  • Confirmed on crates.io that mimalloc-safe v0.1.51 defines and exposes the no_opt_arch feature

@JounQin JounQin force-pushed the bump/mimalloc-safe branch from bf6a63d to cf87758 Compare April 24, 2025 07:17
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! 👍

Reviewed cf87758 in 1 minute and 59 seconds. Click for details.
  • Reviewed 270 lines of code in 8 files
  • Skipped 1 files when reviewing.
  • Skipped posting 16 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .github/workflows/release-napi.yml:48
  • Draft comment:
    Commented-out condition for version change: verify if build should always run now.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to verify if the build should always run due to a commented-out condition for a version change. This falls under asking the author to confirm or verify something, which is against the rules.
2. Cargo.lock:575
  • Draft comment:
    Dependency versions are bumped; ensure backward compatibility with consumers.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50% None
3. benches/resolver.rs:104
  • Draft comment:
    Renamed oxc_resolver() to unrs_resolver() for consistency; consider reusing a single resolver instance across benchmarks if state is immutable.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
4. justfile:13
  • Draft comment:
    Tool installation order updated; verify that cargo-shear and others are correctly installed.
  • Reason this comment was not posted:
    Confidence changes required: 20% <= threshold 50% None
5. napi/Cargo.toml:25
  • Draft comment:
    mimalloc-safe condition updated: note the new aarch64 flag 'no_opt_arch' for Linux. Verify that this resolves known issues.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is purely informative, mentioning a new flag and asking to verify if it resolves known issues. It doesn't provide a specific code suggestion or ask for a specific test to be written. It violates the rule against asking the PR author to verify or ensure behavior.
6. napi/src/lib.rs:1
  • Draft comment:
    Global allocator cfg modified (linux-aarch64 now allowed); double-check that allocation issues are resolved with new mimalloc-safe features.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is asking the PR author to double-check allocation issues, which violates the rule against asking for confirmation or double-checking. It doesn't provide a specific suggestion or point out a specific issue.
7. napi/tests/resolver.test.mjs:242
  • Draft comment:
    Test case for pnpm package updated to use new directory paths. Confirm expected paths match updated pnpm structure.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
8. npm/package.json:49
  • Draft comment:
    napi-postinstall dependency updated to ^0.1.6; ensure postinstall script remains compatible.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50% None
9. Cargo.lock:575
  • Draft comment:
    Bump versions for libmimalloc-sys2 and mimalloc-safe. Verify compatibility with the new no_opt_arch flag and ensure tests pass.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
10. benches/resolver.rs:101
  • Draft comment:
    Rename function from 'oxc_resolver' to 'unrs_resolver' for consistency with package naming; all references have been updated.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
11. justfile:12
  • Draft comment:
    Updated tool installation order and added a Yarn command in the install step. Confirm that the new order doesn’t break any dependency prerequisites.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
12. napi/Cargo.toml:25
  • Draft comment:
    Updated mimalloc-safe dependency configuration to enable the 'no_opt_arch' flag for Linux/aarch64. Verify that this resolves allocator issues on that target.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
13. napi/src/lib.rs:1
  • Draft comment:
    Global allocator is now enabled on Linux/aarch64 by removing it from the exclusion list. Ensure mimalloc-safe’s behavior with the new flag is stable on this target.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
14. napi/tests/resolver.test.mjs:16
  • Draft comment:
    Adjusted fixture paths and added a new test for resolving recursive symlink links. Verify that PNPM package resolution paths match the expected structure.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
15. npm/package.json:48
  • Draft comment:
    Upgrade napi-postinstall dependency to ^0.1.6. Confirm that the new postinstall script behavior is as expected.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
16. napi/tests/resolver.test.mjs:266
  • Draft comment:
    Minor typographical suggestion: In the test description 'resolve recursive symbol link', consider using 'resolve recursive symbolic link' for better clarity and to align with standard terminology.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% While "symbolic link" is indeed the more correct technical term, this is a very minor terminology issue in a test description. The current term "symbol link" is still understandable and doesn't affect the functionality. Test descriptions are primarily for developer readability and don't impact the code behavior. The comment is technically correct - "symbolic link" is the proper term. Poor terminology in tests could confuse future developers. However, this is an extremely minor issue that doesn't affect functionality or significantly impact understanding. The rules state not to make purely informative comments or obvious/unimportant suggestions. Delete this comment as it's too minor and purely informative, not suggesting any meaningful code changes.

Workflow ID: wflow_JdaAXirqPILkj1Tz

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@JounQin JounQin merged commit b7f33e6 into main Apr 24, 2025
23 checks passed
@JounQin JounQin deleted the bump/mimalloc-safe branch April 24, 2025 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant