Skip to content
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

Update mimalloc, enable for glibc Linux aarch64, explicitly disable for wasm and musl #8462

Merged
merged 2 commits into from
Jun 14, 2024

Conversation

bgw
Copy link
Member

@bgw bgw commented Jun 12, 2024

Description

Related Next.JS PRs: vercel/next.js#66815 (reverted) and vercel/next.js#66885 (second attempt with fixes to the next.js CI)

Testing

On glibc Linux aarch64

pnpm pack-next

Install into a test project and try running the development server.

Other platforms

I have not tested other platforms, and will rely on CI for those (here and in vercel/next.js#66815)

Copy link

vercel bot commented Jun 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 14, 2024 3:11am
rust-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 14, 2024 3:11am
8 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Jun 14, 2024 3:11am
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview Jun 14, 2024 3:11am
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview Jun 14, 2024 3:11am
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview Jun 14, 2024 3:11am
examples-native-web ⬜️ Ignored (Inspect) Visit Preview Jun 14, 2024 3:11am
examples-svelte-web ⬜️ Ignored (Inspect) Visit Preview Jun 14, 2024 3:11am
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Jun 14, 2024 3:11am
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview Jun 14, 2024 3:11am

Copy link
Member Author

bgw commented Jun 12, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @bgw and the rest of your teammates on Graphite Graphite

Copy link
Contributor

github-actions bot commented Jun 12, 2024

🟢 Turbopack Benchmark CI successful 🟢

Thanks

Copy link
Contributor

github-actions bot commented Jun 12, 2024

✅ This change can build next-swc

bgw added a commit to vercel/next.js that referenced this pull request Jun 12, 2024
This was previously disabled on aarch64-unknown-linux-musl and wasm,
due to compilation errors.

I moved the logic to disable mimalloc on these platforms into the
turbo-tasks-malloc crates in vercel/turborepo#8462

In addition to centralizing mimalloc platform support logic, this means
that we can get allocation data from these platforms while using the
system allocator.
@bgw bgw marked this pull request as ready for review June 12, 2024 23:44
@bgw bgw requested a review from a team as a code owner June 12, 2024 23:44
Copy link
Contributor

github-actions bot commented Jun 13, 2024

⚠️ CI failed ⚠️

The following steps have failed in CI:

  • Turbopack Rust tests (mac/win, non-blocking)

See workflow summary for details

bgw added 2 commits June 13, 2024 20:09
…or wasm and musl

- mimalloc seems to work just fine with Linux on aarch64 with glibc
- This is already disabled for wasm and musl in next-swc, but I want to centralize these platform checks: https://github.com/vercel/next.js/blob/73918c6711b538678dd66303fdbd61bfd10b288c/packages/next-swc/crates/napi/src/lib.rs#L71
The two implementations were identical, aside from the allocator used.
Move the compile-time branch into an inlined function.
@bgw bgw enabled auto-merge (squash) June 14, 2024 03:11
@bgw bgw merged commit 3d9c2de into main Jun 14, 2024
56 of 57 checks passed
@bgw bgw deleted the bgw/mimalloc-updates branch June 14, 2024 03:31
bgw added a commit to vercel/next.js that referenced this pull request Jun 14, 2024
This was previously disabled on aarch64-unknown-linux-musl and wasm,
due to compilation errors.

I moved the logic to disable mimalloc on these platforms into the
turbo-tasks-malloc crates in vercel/turborepo#8462

In addition to centralizing mimalloc platform support logic, this means
that we can get allocation data from these platforms while using the
system allocator.
bgw added a commit to vercel/next.js that referenced this pull request Jun 14, 2024
This was previously disabled on `aarch64-unknown-linux-musl` and `wasm`,
due to compilation errors.
    
I moved the logic to disable `mimalloc` on these platforms into the
`turbo-tasks-malloc` crates in vercel/turborepo#8462
(which this PR depends on).
    
In addition to centralizing mimalloc platform support logic, this means
that we can get allocation data from these platforms while using the
system allocator.

**Depends on:** vercel/turborepo#8462

Included turbopack changes:
* vercel/turborepo#8409 <!-- hrmny -
fix(turbopack-ecmascript-runtime): prevent hanging when top level await
is skipped -->
* vercel/turborepo#8466 <!-- hrmny - fix(turbopack):
make external module wrapper return not found instead of panicking -->
* vercel/turborepo#8469 <!-- hrmny - fix(turbopack):
add ecmascript options to mdx -->
* vercel/turborepo#8447 <!-- Donny/강동윤 - build:
Update `swc_core` to `v0.93.4` -->
* vercel/turborepo#8472 <!-- Donny/강동윤 - feat:
Reduce the number of parts created by tree shaking -->
* vercel/turborepo#8480 <!-- Will Binns-Smith -
Publish `@vercel/devlow-bench` -->
* vercel/turborepo#8481 <!-- Will Binns-Smith -
chore: release npm packages -->
* vercel/turborepo#8462 <!-- Benjamin Woodruff -
Update mimalloc, enable for glibc Linux aarch64, explicitly disable for
wasm and musl -->
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 25, 2024
…or wasm and musl (vercel/turborepo#8462)

# Description
    
- **Update mimalloc** dependency.
- **Enable mimalloc for Linux on aarch64 with glibc:** it seems to work
  just fine!
- **Disable mimalloc for wasm and musl.** Mimalloc is already disabled
  for these platforms in next-swc, but I want to centralize these platform
  checks:
  https://github.com/vercel/next.js/blob/73918c6711b538678dd66303fdbd61bfd10b288c/packages/next-swc/crates/napi/src/lib.rs#L71
- **Reduce duplicate code across platforms.** The two implementations of
  `TurboMalloc` were identical, aside from the base allocator used. Move
  the compile-time branch into an inlined function.

**Related Next.JS PR:** #66815

# Testing

## On glibc Linux aarch64

```
pnpm pack-next
```

Install into a test project and try running the development server.

## Other platforms

I have not tested other platforms, and will rely on CI for those (here
and in #66815)
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
…or wasm and musl (vercel/turborepo#8462)

# Description
    
- **Update mimalloc** dependency.
- **Enable mimalloc for Linux on aarch64 with glibc:** it seems to work
  just fine!
- **Disable mimalloc for wasm and musl.** Mimalloc is already disabled
  for these platforms in next-swc, but I want to centralize these platform
  checks:
  https://github.com/vercel/next.js/blob/73918c6711b538678dd66303fdbd61bfd10b288c/packages/next-swc/crates/napi/src/lib.rs#L71
- **Reduce duplicate code across platforms.** The two implementations of
  `TurboMalloc` were identical, aside from the base allocator used. Move
  the compile-time branch into an inlined function.

**Related Next.JS PR:** #66815

# Testing

## On glibc Linux aarch64

```
pnpm pack-next
```

Install into a test project and try running the development server.

## Other platforms

I have not tested other platforms, and will rely on CI for those (here
and in #66815)
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
…or wasm and musl (vercel/turborepo#8462)

# Description
    
- **Update mimalloc** dependency.
- **Enable mimalloc for Linux on aarch64 with glibc:** it seems to work
  just fine!
- **Disable mimalloc for wasm and musl.** Mimalloc is already disabled
  for these platforms in next-swc, but I want to centralize these platform
  checks:
  https://github.com/vercel/next.js/blob/73918c6711b538678dd66303fdbd61bfd10b288c/packages/next-swc/crates/napi/src/lib.rs#L71
- **Reduce duplicate code across platforms.** The two implementations of
  `TurboMalloc` were identical, aside from the base allocator used. Move
  the compile-time branch into an inlined function.

**Related Next.JS PR:** #66815

# Testing

## On glibc Linux aarch64

```
pnpm pack-next
```

Install into a test project and try running the development server.

## Other platforms

I have not tested other platforms, and will rely on CI for those (here
and in #66815)
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 1, 2024
…or wasm and musl (vercel/turborepo#8462)

# Description
    
- **Update mimalloc** dependency.
- **Enable mimalloc for Linux on aarch64 with glibc:** it seems to work
  just fine!
- **Disable mimalloc for wasm and musl.** Mimalloc is already disabled
  for these platforms in next-swc, but I want to centralize these platform
  checks:
  https://github.com/vercel/next.js/blob/73918c6711b538678dd66303fdbd61bfd10b288c/packages/next-swc/crates/napi/src/lib.rs#L71
- **Reduce duplicate code across platforms.** The two implementations of
  `TurboMalloc` were identical, aside from the base allocator used. Move
  the compile-time branch into an inlined function.

**Related Next.JS PR:** #66815

# Testing

## On glibc Linux aarch64

```
pnpm pack-next
```

Install into a test project and try running the development server.

## Other platforms

I have not tested other platforms, and will rely on CI for those (here
and in #66815)
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 14, 2024
This was previously disabled on `aarch64-unknown-linux-musl` and `wasm`,
due to compilation errors.
    
I moved the logic to disable `mimalloc` on these platforms into the
`turbo-tasks-malloc` crates in vercel/turborepo#8462
(which this PR depends on).
    
In addition to centralizing mimalloc platform support logic, this means
that we can get allocation data from these platforms while using the
system allocator.

**Depends on:** vercel/turborepo#8462

Included turbopack changes:
* vercel/turborepo#8409 <!-- hrmny -
fix(turbopack-ecmascript-runtime): prevent hanging when top level await
is skipped -->
* vercel/turborepo#8466 <!-- hrmny - fix(turbopack):
make external module wrapper return not found instead of panicking -->
* vercel/turborepo#8469 <!-- hrmny - fix(turbopack):
add ecmascript options to mdx -->
* vercel/turborepo#8447 <!-- Donny/강동윤 - build:
Update `swc_core` to `v0.93.4` -->
* vercel/turborepo#8472 <!-- Donny/강동윤 - feat:
Reduce the number of parts created by tree shaking -->
* vercel/turborepo#8480 <!-- Will Binns-Smith -
Publish `@vercel/devlow-bench` -->
* vercel/turborepo#8481 <!-- Will Binns-Smith -
chore: release npm packages -->
* vercel/turborepo#8462 <!-- Benjamin Woodruff -
Update mimalloc, enable for glibc Linux aarch64, explicitly disable for
wasm and musl -->
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 15, 2024
This was previously disabled on `aarch64-unknown-linux-musl` and `wasm`,
due to compilation errors.
    
I moved the logic to disable `mimalloc` on these platforms into the
`turbo-tasks-malloc` crates in vercel/turborepo#8462
(which this PR depends on).
    
In addition to centralizing mimalloc platform support logic, this means
that we can get allocation data from these platforms while using the
system allocator.

**Depends on:** vercel/turborepo#8462

Included turbopack changes:
* vercel/turborepo#8409 <!-- hrmny -
fix(turbopack-ecmascript-runtime): prevent hanging when top level await
is skipped -->
* vercel/turborepo#8466 <!-- hrmny - fix(turbopack):
make external module wrapper return not found instead of panicking -->
* vercel/turborepo#8469 <!-- hrmny - fix(turbopack):
add ecmascript options to mdx -->
* vercel/turborepo#8447 <!-- Donny/강동윤 - build:
Update `swc_core` to `v0.93.4` -->
* vercel/turborepo#8472 <!-- Donny/강동윤 - feat:
Reduce the number of parts created by tree shaking -->
* vercel/turborepo#8480 <!-- Will Binns-Smith -
Publish `@vercel/devlow-bench` -->
* vercel/turborepo#8481 <!-- Will Binns-Smith -
chore: release npm packages -->
* vercel/turborepo#8462 <!-- Benjamin Woodruff -
Update mimalloc, enable for glibc Linux aarch64, explicitly disable for
wasm and musl -->
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 16, 2024
This was previously disabled on `aarch64-unknown-linux-musl` and `wasm`,
due to compilation errors.
    
I moved the logic to disable `mimalloc` on these platforms into the
`turbo-tasks-malloc` crates in vercel/turborepo#8462
(which this PR depends on).
    
In addition to centralizing mimalloc platform support logic, this means
that we can get allocation data from these platforms while using the
system allocator.

**Depends on:** vercel/turborepo#8462

Included turbopack changes:
* vercel/turborepo#8409 <!-- hrmny -
fix(turbopack-ecmascript-runtime): prevent hanging when top level await
is skipped -->
* vercel/turborepo#8466 <!-- hrmny - fix(turbopack):
make external module wrapper return not found instead of panicking -->
* vercel/turborepo#8469 <!-- hrmny - fix(turbopack):
add ecmascript options to mdx -->
* vercel/turborepo#8447 <!-- Donny/강동윤 - build:
Update `swc_core` to `v0.93.4` -->
* vercel/turborepo#8472 <!-- Donny/강동윤 - feat:
Reduce the number of parts created by tree shaking -->
* vercel/turborepo#8480 <!-- Will Binns-Smith -
Publish `@vercel/devlow-bench` -->
* vercel/turborepo#8481 <!-- Will Binns-Smith -
chore: release npm packages -->
* vercel/turborepo#8462 <!-- Benjamin Woodruff -
Update mimalloc, enable for glibc Linux aarch64, explicitly disable for
wasm and musl -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants