From 8440ec08d0610910f4773b643e2fc6541b7f5470 Mon Sep 17 00:00:00 2001 From: figsoda Date: Thu, 30 Mar 2023 19:23:28 -0400 Subject: [PATCH] ruff: fix on emulated x86_64-darwin --- pkgs/development/tools/ruff/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/tools/ruff/default.nix b/pkgs/development/tools/ruff/default.nix index e732e6f24c80..78bf24389070 100644 --- a/pkgs/development/tools/ruff/default.nix +++ b/pkgs/development/tools/ruff/default.nix @@ -40,6 +40,12 @@ rustPlatform.buildRustPackage rec { cargoBuildFlags = [ "--package=ruff_cli" ]; cargoTestFlags = cargoBuildFlags; + preBuild = lib.optionalString (stdenv.isDarwin && stdenv.isx86_64) '' + # See https://github.com/jemalloc/jemalloc/issues/1997 + # Using a value of 48 should work on both emulated and native x86_64-darwin. + export JEMALLOC_SYS_WITH_LG_VADDR=48 + ''; + postInstall = '' installShellCompletion --cmd ruff \ --bash <($out/bin/ruff generate-shell-completion bash) \