Skip to content

Commit a043e77

Browse files
committed
fix(javascript): Error during loading the module on x86_64-unknown-linux-musl
1 parent 29e6417 commit a043e77

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

bindings/javascript/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44

5+
### Fixed
6+
7+
- Error during loading the module on `x86_64-unknown-linux-musl`
8+
59
## [0.13.0] - 2024-01-19
610

711
### Added

bindings/javascript/Cargo.toml

+5-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ include = ["src/*.rs", "LICENSE", "README.md", "CHANGELOG.md"]
1515
[lib]
1616
crate-type = ["cdylib"]
1717

18-
[target.'cfg(all(not(all(target_os = "linux", target_arch = "aarch64", target_env = "musl")), not(all(target_os = "windows", target_arch = "aarch64")), not(target_arch = "wasm32")))'.dependencies]
19-
mimalloc-rust = { version = "0.2" }
18+
[target.'cfg(not(any(target_os = "linux", target_family = "wasm")))'.dependencies]
19+
mimalloc = "0.1"
20+
21+
[target.'cfg(target_os = "linux")'.dependencies]
22+
mimalloc = { version = "0.1", features = ["local_dynamic_tls"] }
2023

2124
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
2225
napi = { version = "2.14.1", default-features = false, features = ["napi4"] }

bindings/javascript/src/lib.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,9 @@ mod errors;
77
mod options;
88
use options::Options;
99

10-
#[cfg(all(
11-
not(target_arch = "wasm32"),
12-
not(debug_assertions),
13-
not(all(target_os = "windows", target_arch = "aarch64")),
14-
not(all(target_os = "linux", target_arch = "aarch64", target_env = "musl")),
15-
))]
10+
#[cfg(not(target_family = "wasm"))]
1611
#[global_allocator]
17-
static ALLOC: mimalloc_rust::GlobalMiMalloc = mimalloc_rust::GlobalMiMalloc;
12+
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
1813

1914
#[cfg(not(target_arch = "wasm32"))]
2015
#[napi]

0 commit comments

Comments
 (0)