From 09680f653f873687728e44461d85b7c3ad747f3e Mon Sep 17 00:00:00 2001 From: strawberry Date: Wed, 24 Jul 2024 19:17:37 -0400 Subject: [PATCH] nix: add outputs for debug builds Signed-off-by: strawberry --- flake.nix | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/flake.nix b/flake.nix index a56d1bc0..bd948c86 100644 --- a/flake.nix +++ b/flake.nix @@ -144,6 +144,11 @@ { packages = { default = scopeHost.main; + default-debug = scopeHost.main.override { + profile = "dev"; + # debug build users expect full logs + disable_release_max_log_level = true; + }; all-features = scopeHost.main.override { all_features = true; disable_features = [ @@ -153,6 +158,18 @@ "experimental" ]; }; + all-features-debug = scopeHost.main.override { + profile = "dev"; + all_features = true; + # 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" + ]; + }; hmalloc = scopeHost.main.override { features = ["hardened_malloc"]; }; oci-image = scopeHost.oci-image; @@ -167,6 +184,20 @@ ]; }; }; + oci-image-all-features-debug = scopeHost.oci-image.override { + main = scopeHost.main.override { + profile = "dev"; + all_features = true; + # 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" + ]; + }; + }; oci-image-hmalloc = scopeHost.oci-image.override { main = scopeHost.main.override { features = ["hardened_malloc"]; @@ -201,6 +232,16 @@ value = scopeCrossStatic.main; } + # An output for a statically-linked unstripped debug ("dev") binary + { + name = "${binaryName}-debug"; + value = scopeCrossStatic.main.override { + profile = "dev"; + # debug build users expect full logs + disable_release_max_log_level = true; + }; + } + # An output for a statically-linked binary with `--all-features` { name = "${binaryName}-all-features"; @@ -215,6 +256,23 @@ }; } + # An output for a statically-linked unstripped debug ("dev") binary with `--all-features` + { + name = "${binaryName}-all-features-debug"; + value = scopeCrossStatic.main.override { + profile = "dev"; + all_features = true; + # 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" + ]; + }; + } + # An output for a statically-linked binary with hardened_malloc { name = "${binaryName}-hmalloc"; @@ -229,6 +287,18 @@ value = scopeCrossStatic.oci-image; } + # An output for an OCI image based on that unstripped debug ("dev") binary + { + name = "oci-image-${crossSystem}-debug"; + value = scopeCrossStatic.oci-image.override { + main = scopeCrossStatic.main.override { + profile = "dev"; + # debug build users expect full logs + disable_release_max_log_level = true; + }; + }; + } + # An output for an OCI image based on that binary with `--all-features` { name = "oci-image-${crossSystem}-all-features"; @@ -245,6 +315,25 @@ }; } + # An output for an OCI image based on that unstripped debug ("dev") binary with `--all-features` + { + name = "oci-image-${crossSystem}-all-features-debug"; + value = scopeCrossStatic.oci-image.override { + main = scopeCrossStatic.main.override { + profile = "dev"; + all_features = true; + # 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" + ]; + }; + }; + } + # An output for an OCI image based on that binary with hardened_malloc { name = "oci-image-${crossSystem}-hmalloc";