disable more unnecessary features in various build outputs

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2025-01-10 22:45:48 -05:00
parent d5217566d9
commit e524590860
No known key found for this signature in database
3 changed files with 115 additions and 55 deletions

146
flake.nix
View file

@ -191,27 +191,57 @@
in in
{ {
packages = { packages = {
default = scopeHost.main; default = scopeHost.main.override {
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;
disable_features = [ disable_features = [
# this is non-functional on nix for some reason
"hardened_malloc"
# dont include experimental features # dont include experimental features
"experimental" "experimental"
# jemalloc profiling/stats features are expensive and shouldn't # jemalloc profiling/stats features are expensive and shouldn't
# be expected on non-debug builds. # be expected on non-debug builds.
"jemalloc_prof" "jemalloc_prof"
"jemalloc_stats" "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 is a development-only hot reload feature
"conduwuit_mods" "conduwuit_mods"
]; ];
@ -222,10 +252,10 @@
# debug build users expect full logs # debug build users expect full logs
disable_release_max_log_level = true; disable_release_max_log_level = true;
disable_features = [ disable_features = [
# this is non-functional on nix for some reason
"hardened_malloc"
# dont include experimental features # dont include experimental features
"experimental" "experimental"
# this is non-functional on nix for some reason
"hardened_malloc"
# conduwuit_mods is a development-only hot reload feature # conduwuit_mods is a development-only hot reload feature
"conduwuit_mods" "conduwuit_mods"
]; ];
@ -237,14 +267,14 @@
main = scopeHost.main.override { main = scopeHost.main.override {
all_features = true; all_features = true;
disable_features = [ disable_features = [
# this is non-functional on nix for some reason
"hardened_malloc"
# dont include experimental features # dont include experimental features
"experimental" "experimental"
# jemalloc profiling/stats features are expensive and shouldn't # jemalloc profiling/stats features are expensive and shouldn't
# be expected on non-debug builds. # be expected on non-debug builds.
"jemalloc_prof" "jemalloc_prof"
"jemalloc_stats" "jemalloc_stats"
# this is non-functional on nix for some reason
"hardened_malloc"
# conduwuit_mods is a development-only hot reload feature # conduwuit_mods is a development-only hot reload feature
"conduwuit_mods" "conduwuit_mods"
]; ];
@ -257,10 +287,10 @@
# debug build users expect full logs # debug build users expect full logs
disable_release_max_log_level = true; disable_release_max_log_level = true;
disable_features = [ disable_features = [
# this is non-functional on nix for some reason
"hardened_malloc"
# dont include experimental features # dont include experimental features
"experimental" "experimental"
# this is non-functional on nix for some reason
"hardened_malloc"
# conduwuit_mods is a development-only hot reload feature # conduwuit_mods is a development-only hot reload feature
"conduwuit_mods" "conduwuit_mods"
]; ];
@ -321,6 +351,14 @@
value = scopeCrossStatic.main.override { value = scopeCrossStatic.main.override {
profile = "test"; profile = "test";
disable_release_max_log_level = true; 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 { value = scopeCrossStatic.main.override {
all_features = true; all_features = true;
disable_features = [ disable_features = [
# this is non-functional on nix for some reason
"hardened_malloc"
# dont include experimental features # dont include experimental features
"experimental" "experimental"
# jemalloc profiling/stats features are expensive and shouldn't # jemalloc profiling/stats features are expensive and shouldn't
# be expected on non-debug builds. # be expected on non-debug builds.
"jemalloc_prof" "jemalloc_prof"
"jemalloc_stats" "jemalloc_stats"
# this is non-functional on nix for some reason
"hardened_malloc"
# conduwuit_mods is a development-only hot reload feature # conduwuit_mods is a development-only hot reload feature
"conduwuit_mods" "conduwuit_mods"
]; ];
@ -351,14 +389,14 @@
value = scopeCrossStatic.main.override { value = scopeCrossStatic.main.override {
all_features = true; all_features = true;
disable_features = [ disable_features = [
# this is non-functional on nix for some reason
"hardened_malloc"
# dont include experimental features # dont include experimental features
"experimental" "experimental"
# jemalloc profiling/stats features are expensive and shouldn't # jemalloc profiling/stats features are expensive and shouldn't
# be expected on non-debug builds. # be expected on non-debug builds.
"jemalloc_prof" "jemalloc_prof"
"jemalloc_stats" "jemalloc_stats"
# this is non-functional on nix for some reason
"hardened_malloc"
# conduwuit_mods is a development-only hot reload feature # conduwuit_mods is a development-only hot reload feature
"conduwuit_mods" "conduwuit_mods"
]; ];
@ -375,10 +413,10 @@
# debug build users expect full logs # debug build users expect full logs
disable_release_max_log_level = true; disable_release_max_log_level = true;
disable_features = [ disable_features = [
# this is non-functional on nix for some reason
"hardened_malloc"
# dont include experimental features # dont include experimental features
"experimental" "experimental"
# this is non-functional on nix for some reason
"hardened_malloc"
# conduwuit_mods is a development-only hot reload feature # conduwuit_mods is a development-only hot reload feature
"conduwuit_mods" "conduwuit_mods"
]; ];
@ -429,16 +467,16 @@
main = scopeCrossStatic.main.override { main = scopeCrossStatic.main.override {
all_features = true; all_features = true;
disable_features = [ disable_features = [
# this is non-functional on nix for some reason # dont include experimental features
"hardened_malloc" "experimental"
# dont include experimental features # jemalloc profiling/stats features are expensive and shouldn't
"experimental" # be expected on non-debug builds.
# jemalloc profiling/stats features are expensive and shouldn't "jemalloc_prof"
# be expected on non-debug builds. "jemalloc_stats"
"jemalloc_prof" # this is non-functional on nix for some reason
"jemalloc_stats" "hardened_malloc"
# conduwuit_mods is a development-only hot reload feature # conduwuit_mods is a development-only hot reload feature
"conduwuit_mods" "conduwuit_mods"
]; ];
}; };
}; };
@ -452,16 +490,16 @@
main = scopeCrossStatic.main.override { main = scopeCrossStatic.main.override {
all_features = true; all_features = true;
disable_features = [ disable_features = [
# this is non-functional on nix for some reason # dont include experimental features
"hardened_malloc" "experimental"
# dont include experimental features # jemalloc profiling/stats features are expensive and shouldn't
"experimental" # be expected on non-debug builds.
# jemalloc profiling/stats features are expensive and shouldn't "jemalloc_prof"
# be expected on non-debug builds. "jemalloc_stats"
"jemalloc_prof" # this is non-functional on nix for some reason
"jemalloc_stats" "hardened_malloc"
# conduwuit_mods is a development-only hot reload feature # conduwuit_mods is a development-only hot reload feature
"conduwuit_mods" "conduwuit_mods"
]; ];
x86_64_haswell_target_optimised = (if (crossSystem == "x86_64-linux-gnu" || crossSystem == "x86_64-linux-musl") then true else false); 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 # debug build users expect full logs
disable_release_max_log_level = true; disable_release_max_log_level = true;
disable_features = [ disable_features = [
# this is non-functional on nix for some reason # dont include experimental features
"hardened_malloc" "experimental"
# dont include experimental features # this is non-functional on nix for some reason
"experimental" "hardened_malloc"
# conduwuit_mods is a development-only hot reload feature # conduwuit_mods is a development-only hot reload feature
"conduwuit_mods" "conduwuit_mods"
]; ];
}; };
}; };
@ -522,14 +560,14 @@
main = prev.main.override { main = prev.main.override {
all_features = true; all_features = true;
disable_features = [ disable_features = [
# this is non-functional on nix for some reason
"hardened_malloc"
# dont include experimental features # dont include experimental features
"experimental" "experimental"
# jemalloc profiling/stats features are expensive and shouldn't # jemalloc profiling/stats features are expensive and shouldn't
# be expected on non-debug builds. # be expected on non-debug builds.
"jemalloc_prof" "jemalloc_prof"
"jemalloc_stats" "jemalloc_stats"
# this is non-functional on nix for some reason
"hardened_malloc"
# conduwuit_mods is a development-only hot reload feature # conduwuit_mods is a development-only hot reload feature
"conduwuit_mods" "conduwuit_mods"
]; ];

View file

@ -20,6 +20,8 @@ let
disable_features = [ disable_features = [
# no reason to use jemalloc for complement, just has compatibility/build issues # no reason to use jemalloc for complement, just has compatibility/build issues
"jemalloc" "jemalloc"
"jemalloc_stats"
"jemalloc_prof"
# console/CLI stuff isn't used or relevant for complement # console/CLI stuff isn't used or relevant for complement
"console" "console"
"tokio_console" "tokio_console"
@ -32,6 +34,14 @@ let
"hardened_malloc" "hardened_malloc"
# dont include experimental features # dont include experimental features
"experimental" "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"
]; ];
}; };

View file

@ -15,7 +15,19 @@
# Options (keep sorted) # Options (keep sorted)
, all_features ? false , all_features ? false
, default_features ? true , 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 , disable_release_max_log_level ? false
, features ? [] , features ? []
, profile ? "release" , profile ? "release"