From 1a27fc7ef7191a7180f5b4fac023af82fc36092a Mon Sep 17 00:00:00 2001 From: Yureka Date: Mon, 24 Feb 2025 16:18:50 +0100 Subject: [PATCH] fractal: save memory by building without debug symbols The debug symbols are stripped afterwards anyways, and linking with them requires extra memory --- pkgs/by-name/fr/fractal/disable-debug.patch | 12 ++++++++++++ pkgs/by-name/fr/fractal/package.nix | 6 ++++++ 2 files changed, 18 insertions(+) create mode 100644 pkgs/by-name/fr/fractal/disable-debug.patch diff --git a/pkgs/by-name/fr/fractal/disable-debug.patch b/pkgs/by-name/fr/fractal/disable-debug.patch new file mode 100644 index 000000000000..e72b4961df5d --- /dev/null +++ b/pkgs/by-name/fr/fractal/disable-debug.patch @@ -0,0 +1,12 @@ +diff --git a/Cargo.toml b/Cargo.toml +index d614a94..674f2d6 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -7,7 +7,6 @@ rust-version = "1.82" + publish = false + + [profile.release] +-debug = true + lto = "thin" + codegen-units = 1 + diff --git a/pkgs/by-name/fr/fractal/package.nix b/pkgs/by-name/fr/fractal/package.nix index 5f5def674258..9c15ddd6a4e8 100644 --- a/pkgs/by-name/fr/fractal/package.nix +++ b/pkgs/by-name/fr/fractal/package.nix @@ -45,6 +45,12 @@ stdenv.mkDerivation rec { hash = "sha256-e3IW8D4aLU6d36ErUHDUDiXF1lN4HCn5OCX6GwaT3iQ="; }; + patches = [ + # Disable debug symbols in release builds + # The debug symbols are stripped afterwards anyways, and building with them requires extra memory + ./disable-debug.patch + ]; + # Dirty approach to add patches after cargoSetupPostUnpackHook # We should eventually use a cargo vendor patch hook instead preConfigure = ''