Unverified Commit a00146e0 authored by Benjamin Woodruff's avatar Benjamin Woodruff Committed by GitHub

Use turbo-tasks-malloc on all platforms (#66815)

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 https://github.com/vercel/turbo/pull/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:** https://github.com/vercel/turbo/pull/8462

Included turbopack changes:
* https://github.com/vercel/turbo/pull/8409 <!-- hrmny -
fix(turbopack-ecmascript-runtime): prevent hanging when top level await
is skipped -->
* https://github.com/vercel/turbo/pull/8466 <!-- hrmny - fix(turbopack):
make external module wrapper return not found instead of panicking -->
* https://github.com/vercel/turbo/pull/8469 <!-- hrmny - fix(turbopack):
add ecmascript options to mdx -->
* https://github.com/vercel/turbo/pull/8447 <!-- Donny/강동윤 - build:
Update `swc_core` to `v0.93.4` -->
* https://github.com/vercel/turbo/pull/8472 <!-- Donny/강동윤 - feat:
Reduce the number of parts created by tree shaking -->
* https://github.com/vercel/turbo/pull/8480 <!-- Will Binns-Smith -
Publish `@vercel/devlow-bench` -->
* https://github.com/vercel/turbo/pull/8481 <!-- Will Binns-Smith -
chore: release npm packages -->
* https://github.com/vercel/turbo/pull/8462 <!-- Benjamin Woodruff -
Update mimalloc, enable for glibc Linux aarch64, explicitly disable for
wasm and musl -->
parent 1b93f366
This diff is collapsed.
......@@ -37,11 +37,11 @@ swc_core = { version = "0.93.4", features = [
testing = { version = "0.35.25" }
# Turbo crates
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240612.3" }
turbopack-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240614.1" }
# [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros..
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240612.3" }
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240614.1" }
# [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240612.3" }
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-240614.1" }
# General Deps
......
......@@ -35,26 +35,6 @@ __internal_dhat-heap = ["dhat"]
# effectively does nothing.
__internal_dhat-ad-hoc = ["dhat"]
# Making custom_allocator as default feature will break some targets (i.e aarch64-linux), controlling it with
# build-time cfg instead.
#
# [NOTE] this is a workaround to enable downstream features for the own pkgs, since
# cargo does not support per-target features enablement.
[target.'cfg(all(target_os = "linux", target_arch = "aarch64"))'.dependencies]
turbopack-binding = { workspace = true, features = ["__turbo_tasks_malloc"] }
[target.'cfg(all(target_os = "linux", not(any(target_arch = "aarch64", target_arch = "wasm32"))))'.dependencies]
turbopack-binding = { workspace = true, features = [
"__turbo_tasks_malloc",
"__turbo_tasks_malloc_custom_allocator",
] }
[target.'cfg(not(any(target_os = "linux", target_arch = "wasm32")))'.dependencies]
turbopack-binding = { workspace = true, features = [
"__turbo_tasks_malloc",
"__turbo_tasks_malloc_custom_allocator",
] }
# Enable specific tls features per-target.
[target.'cfg(all(target_os = "windows", target_arch = "aarch64"))'.dependencies]
next-core = { workspace = true, features = ["native-tls"] }
......@@ -108,6 +88,8 @@ turbopack-binding = { workspace = true, features = [
"__feature_mdx_rs",
"__turbo",
"__turbo_tasks",
"__turbo_tasks_malloc",
"__turbo_tasks_malloc_custom_allocator",
"__turbo_tasks_memory",
"__turbopack",
"__turbopack_ecmascript_hmr_protocol",
......@@ -121,6 +103,7 @@ turbopack-binding = { workspace = true, features = [
"__swc_core_binding_napi",
"__swc_core_serde",
"__feature_mdx_rs",
"__turbo_tasks_malloc",
] }
# wasi-only dependencies.
......
......@@ -68,14 +68,7 @@ pub mod util;
// Declare build-time information variables generated in build.rs
shadow_rs::shadow!(build);
// don't use turbo malloc (`mimalloc`) on linux-musl-aarch64 because of the
// compile error
#[cfg(not(any(
all(target_os = "linux", target_env = "musl", target_arch = "aarch64"),
target_arch = "wasm32",
feature = "__internal_dhat-heap",
feature = "__internal_dhat-ad-hoc"
)))]
#[cfg(not(any(feature = "__internal_dhat-heap", feature = "__internal_dhat-ad-hoc")))]
#[global_allocator]
static ALLOC: turbopack_binding::turbo::malloc::TurboMalloc =
turbopack_binding::turbo::malloc::TurboMalloc;
......
......@@ -206,7 +206,7 @@
"@types/ws": "8.2.0",
"@vercel/ncc": "0.34.0",
"@vercel/nft": "0.27.1",
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240612.1",
"@vercel/turbopack-ecmascript-runtime": "https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240614.1",
"acorn": "8.11.3",
"amphtml-validator": "1.0.35",
"anser": "1.4.9",
......
......@@ -1108,8 +1108,8 @@ importers:
specifier: 0.27.1
version: 0.27.1
'@vercel/turbopack-ecmascript-runtime':
specifier: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240612.1
version: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240612.1'
specifier: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240614.1
version: '@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240614.1'
acorn:
specifier: 8.11.3
version: 8.11.3
......@@ -26558,8 +26558,8 @@ packages:
/zwitch@2.0.4:
resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==}
'@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240612.1':
resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240612.1}
'@gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240614.1':
resolution: {tarball: https://gitpkg-fork.vercel.sh/vercel/turbo/crates/turbopack-ecmascript-runtime/js?turbopack-240614.1}
name: '@vercel/turbopack-ecmascript-runtime'
version: 0.0.0
dependencies:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment