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

chore(binding): minor cleanup #1989

Merged
merged 1 commit into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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