From 4ff7dae7211a53c3d60f512a39d12425a1b9496c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E9=9B=85=20misaki=20masa?= Date: Mon, 30 Jun 2025 23:18:30 +0800 Subject: [PATCH] fix: Cargo doesn't respect `.cargo/config.toml` for the crates (#2936) --- .cargo/config.toml | 16 ---------------- yazi-cli/Cargo.toml | 6 ++++++ yazi-fm/Cargo.toml | 8 ++++++++ 3 files changed, 14 insertions(+), 16 deletions(-) delete mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index 29a55dea..00000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,16 +0,0 @@ -[env] -MACOSX_DEPLOYMENT_TARGET = "10.11" -JEMALLOC_SYS_WITH_LG_PAGE = "16" - -# environment variable for tikv-jemalloc-sys -# -# https://jemalloc.net/jemalloc.3.html#opt.narenas -# narenas is the maximum number of arenas to use for automatic multiplexing -# of threads and arenas. The default is four times the number of CPUs, -# or one if there is a single CPU. -# -# Improve memory efficiency by reducing fragmentation and ensuring all threads allocate from the same pool -JEMALLOC_SYS_WITH_MALLOC_CONF = "narenas:1" - -[target.aarch64-apple-darwin] -rustflags = [ "-Ctarget-cpu=apple-m1" ] diff --git a/yazi-cli/Cargo.toml b/yazi-cli/Cargo.toml index f38a6397..5743ffa8 100644 --- a/yazi-cli/Cargo.toml +++ b/yazi-cli/Cargo.toml @@ -47,9 +47,15 @@ clap_complete_nushell = "4.5.7" serde_json = { workspace = true } vergen-gitcl = { version = "1.0.8", features = [ "build" ] } +[target.aarch64-apple-darwin] +rustflags = [ "-Ctarget-cpu=apple-m1" ] + [target.'cfg(target_os = "macos")'.dependencies] crossterm = { workspace = true, features = [ "use-dev-tty", "libc" ] } +[env] +MACOSX_DEPLOYMENT_TARGET = "10.11" + [[bin]] name = "ya" path = "src/main.rs" diff --git a/yazi-fm/Cargo.toml b/yazi-fm/Cargo.toml index 2a71042a..205f4c38 100644 --- a/yazi-fm/Cargo.toml +++ b/yazi-fm/Cargo.toml @@ -59,6 +59,9 @@ tracing = { workspace = true } tracing-appender = "0.2.3" tracing-subscriber = { version = "0.3.19", features = [ "env-filter" ] } +[target.aarch64-apple-darwin] +rustflags = [ "-Ctarget-cpu=apple-m1" ] + [target."cfg(unix)".dependencies] libc = { workspace = true } signal-hook-tokio = { version = "0.3.1", features = [ "futures-v0_3" ] } @@ -69,6 +72,11 @@ crossterm = { workspace = true, features = [ "use-dev-tty", "libc" ] } [target.'cfg(all(not(target_os = "macos"), not(target_os = "windows")))'.dependencies] tikv-jemallocator = "0.6.0" +[env] +MACOSX_DEPLOYMENT_TARGET = "10.11" +JEMALLOC_SYS_WITH_LG_PAGE = "16" +JEMALLOC_SYS_WITH_MALLOC_CONF = "narenas:1" + [[bin]] name = "yazi" path = "src/main.rs"