Skip to content

Commit

Permalink
chore(binding): minor cleanup (#1989)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Feb 27, 2023
1 parent fb5d0ce commit 4124159
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion crates/node_binding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ tokio = { version = "1.21.0", features = [
] }
tracing = "0.1.34"

[target.'cfg(all(not(all(target_os = "linux", target_arch = "aarch64", target_env = "musl"))))'.dependencies]
[target.'cfg(not(target_os = "linux"))'.dependencies]
mimalloc-rust = { version = "0.2" }

[target.'cfg(all(target_os = "linux", not(all(target_env = "musl", target_arch = "aarch64"))))'.dependencies]
mimalloc-rust = { version = "0.2", features = ["local-dynamic-tls"] }

[build-dependencies]
napi-build = { version = "=2.0.1" }

Expand Down
3 changes: 2 additions & 1 deletion crates/node_binding/binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ function isMusl() {
// For Node 10
if (!process.report || typeof process.report.getReport !== 'function') {
try {
return readFileSync('/usr/bin/ldd', 'utf8').includes('musl')
const lddPath = require('child_process').execSync('which ldd').toString().trim();
return readFileSync(lddPath, 'utf8').includes('musl')
} catch (e) {
return true
}
Expand Down
2 changes: 0 additions & 2 deletions crates/node_binding/src/js_values/stats.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::collections::HashMap;

use napi::bindgen_prelude::SharedReference;
use rspack_core::Stats;

Expand Down

0 comments on commit 4124159

Please sign in to comment.