From e52459086064a7d29922a0f62d657a217f166805 Mon Sep 17 00:00:00 2001 From: strawberry Date: Fri, 10 Jan 2025 22:45:48 -0500 Subject: [PATCH] disable more unnecessary features in various build outputs Signed-off-by: strawberry --- flake.nix | 146 ++++++++++++++++++++------------ nix/pkgs/complement/default.nix | 10 +++ nix/pkgs/main/default.nix | 14 ++- 3 files changed, 115 insertions(+), 55 deletions(-) diff --git a/flake.nix b/flake.nix index e3497d85..fb40cae7 100644 --- a/flake.nix +++ b/flake.nix @@ -191,27 +191,57 @@ in { packages = { - default = scopeHost.main; - default-debug = scopeHost.main.override { - profile = "dev"; - # debug build users expect full logs - disable_release_max_log_level = true; - }; - default-test = scopeHost.main.override { - profile = "test"; - disable_release_max_log_level = true; - }; - all-features = scopeHost.main.override { - all_features = true; + default = scopeHost.main.override { disable_features = [ - # this is non-functional on nix for some reason - "hardened_malloc" # dont include experimental features "experimental" # jemalloc profiling/stats features are expensive and shouldn't # be expected on non-debug builds. "jemalloc_prof" "jemalloc_stats" + # this is non-functional on nix for some reason + "hardened_malloc" + # conduwuit_mods is a development-only hot reload feature + "conduwuit_mods" + ]; + }; + default-debug = scopeHost.main.override { + profile = "dev"; + # debug build users expect full logs + disable_release_max_log_level = true; + disable_features = [ + # dont include experimental features + "experimental" + # this is non-functional on nix for some reason + "hardened_malloc" + # conduwuit_mods is a development-only hot reload feature + "conduwuit_mods" + ]; + }; + # just a test profile used for things like CI and complement + default-test = scopeHost.main.override { + profile = "test"; + disable_release_max_log_level = true; + disable_features = [ + # dont include experimental features + "experimental" + # this is non-functional on nix for some reason + "hardened_malloc" + # conduwuit_mods is a development-only hot reload feature + "conduwuit_mods" + ]; + }; + all-features = scopeHost.main.override { + all_features = true; + disable_features = [ + # dont include experimental features + "experimental" + # jemalloc profiling/stats features are expensive and shouldn't + # be expected on non-debug builds. + "jemalloc_prof" + "jemalloc_stats" + # this is non-functional on nix for some reason + "hardened_malloc" # conduwuit_mods is a development-only hot reload feature "conduwuit_mods" ]; @@ -222,10 +252,10 @@ # debug build users expect full logs disable_release_max_log_level = true; disable_features = [ - # this is non-functional on nix for some reason - "hardened_malloc" # dont include experimental features "experimental" + # this is non-functional on nix for some reason + "hardened_malloc" # conduwuit_mods is a development-only hot reload feature "conduwuit_mods" ]; @@ -237,14 +267,14 @@ main = scopeHost.main.override { all_features = true; disable_features = [ - # this is non-functional on nix for some reason - "hardened_malloc" # dont include experimental features "experimental" # jemalloc profiling/stats features are expensive and shouldn't # be expected on non-debug builds. "jemalloc_prof" "jemalloc_stats" + # this is non-functional on nix for some reason + "hardened_malloc" # conduwuit_mods is a development-only hot reload feature "conduwuit_mods" ]; @@ -257,10 +287,10 @@ # debug build users expect full logs disable_release_max_log_level = true; disable_features = [ - # this is non-functional on nix for some reason - "hardened_malloc" # dont include experimental features "experimental" + # this is non-functional on nix for some reason + "hardened_malloc" # conduwuit_mods is a development-only hot reload feature "conduwuit_mods" ]; @@ -321,6 +351,14 @@ value = scopeCrossStatic.main.override { profile = "test"; disable_release_max_log_level = true; + disable_features = [ + # dont include experimental features + "experimental" + # this is non-functional on nix for some reason + "hardened_malloc" + # conduwuit_mods is a development-only hot reload feature + "conduwuit_mods" + ]; }; } @@ -330,14 +368,14 @@ value = scopeCrossStatic.main.override { all_features = true; disable_features = [ - # this is non-functional on nix for some reason - "hardened_malloc" # dont include experimental features "experimental" # jemalloc profiling/stats features are expensive and shouldn't # be expected on non-debug builds. "jemalloc_prof" "jemalloc_stats" + # this is non-functional on nix for some reason + "hardened_malloc" # conduwuit_mods is a development-only hot reload feature "conduwuit_mods" ]; @@ -351,14 +389,14 @@ value = scopeCrossStatic.main.override { all_features = true; disable_features = [ - # this is non-functional on nix for some reason - "hardened_malloc" # dont include experimental features "experimental" # jemalloc profiling/stats features are expensive and shouldn't # be expected on non-debug builds. "jemalloc_prof" "jemalloc_stats" + # this is non-functional on nix for some reason + "hardened_malloc" # conduwuit_mods is a development-only hot reload feature "conduwuit_mods" ]; @@ -375,10 +413,10 @@ # debug build users expect full logs disable_release_max_log_level = true; disable_features = [ - # this is non-functional on nix for some reason - "hardened_malloc" # dont include experimental features "experimental" + # this is non-functional on nix for some reason + "hardened_malloc" # conduwuit_mods is a development-only hot reload feature "conduwuit_mods" ]; @@ -429,16 +467,16 @@ main = scopeCrossStatic.main.override { all_features = true; disable_features = [ - # this is non-functional on nix for some reason - "hardened_malloc" - # dont include experimental features - "experimental" - # jemalloc profiling/stats features are expensive and shouldn't - # be expected on non-debug builds. - "jemalloc_prof" - "jemalloc_stats" - # conduwuit_mods is a development-only hot reload feature - "conduwuit_mods" + # dont include experimental features + "experimental" + # jemalloc profiling/stats features are expensive and shouldn't + # be expected on non-debug builds. + "jemalloc_prof" + "jemalloc_stats" + # this is non-functional on nix for some reason + "hardened_malloc" + # conduwuit_mods is a development-only hot reload feature + "conduwuit_mods" ]; }; }; @@ -452,16 +490,16 @@ main = scopeCrossStatic.main.override { all_features = true; disable_features = [ - # this is non-functional on nix for some reason - "hardened_malloc" - # dont include experimental features - "experimental" - # jemalloc profiling/stats features are expensive and shouldn't - # be expected on non-debug builds. - "jemalloc_prof" - "jemalloc_stats" - # conduwuit_mods is a development-only hot reload feature - "conduwuit_mods" + # dont include experimental features + "experimental" + # jemalloc profiling/stats features are expensive and shouldn't + # be expected on non-debug builds. + "jemalloc_prof" + "jemalloc_stats" + # this is non-functional on nix for some reason + "hardened_malloc" + # conduwuit_mods is a development-only hot reload feature + "conduwuit_mods" ]; x86_64_haswell_target_optimised = (if (crossSystem == "x86_64-linux-gnu" || crossSystem == "x86_64-linux-musl") then true else false); }; @@ -478,12 +516,12 @@ # debug build users expect full logs disable_release_max_log_level = true; disable_features = [ - # this is non-functional on nix for some reason - "hardened_malloc" - # dont include experimental features - "experimental" - # conduwuit_mods is a development-only hot reload feature - "conduwuit_mods" + # dont include experimental features + "experimental" + # this is non-functional on nix for some reason + "hardened_malloc" + # conduwuit_mods is a development-only hot reload feature + "conduwuit_mods" ]; }; }; @@ -522,14 +560,14 @@ main = prev.main.override { all_features = true; disable_features = [ - # this is non-functional on nix for some reason - "hardened_malloc" # dont include experimental features "experimental" # jemalloc profiling/stats features are expensive and shouldn't # be expected on non-debug builds. "jemalloc_prof" "jemalloc_stats" + # this is non-functional on nix for some reason + "hardened_malloc" # conduwuit_mods is a development-only hot reload feature "conduwuit_mods" ]; diff --git a/nix/pkgs/complement/default.nix b/nix/pkgs/complement/default.nix index 36f12400..e35cbf04 100644 --- a/nix/pkgs/complement/default.nix +++ b/nix/pkgs/complement/default.nix @@ -20,6 +20,8 @@ let disable_features = [ # no reason to use jemalloc for complement, just has compatibility/build issues "jemalloc" + "jemalloc_stats" + "jemalloc_prof" # console/CLI stuff isn't used or relevant for complement "console" "tokio_console" @@ -32,6 +34,14 @@ let "hardened_malloc" # dont include experimental features "experimental" + # compression isn't needed for complement + "brotli_compression" + "gzip_compression" + "zstd_compression" + # complement doesn't need hot reloading + "conduwuit_mods" + # complement doesn't have URL preview media tests + "url_preview" ]; }; diff --git a/nix/pkgs/main/default.nix b/nix/pkgs/main/default.nix index a785e7f2..d7424d11 100644 --- a/nix/pkgs/main/default.nix +++ b/nix/pkgs/main/default.nix @@ -15,7 +15,19 @@ # Options (keep sorted) , all_features ? false , default_features ? true -, disable_features ? [] +# default list of disabled features +, disable_features ? [ + # dont include experimental features + "experimental" + # jemalloc profiling/stats features are expensive and shouldn't + # be expected on non-debug builds. + "jemalloc_prof" + "jemalloc_stats" + # this is non-functional on nix for some reason + "hardened_malloc" + # conduwuit_mods is a development-only hot reload feature + "conduwuit_mods" +] , disable_release_max_log_level ? false , features ? [] , profile ? "release"