From 872987d040303394aef2fdba5ea5a3ee93e66e67 Mon Sep 17 00:00:00 2001 From: Kerstin Date: Tue, 16 May 2023 10:50:34 +0200 Subject: [PATCH] beam/mixRelease: default stripDebug to false due frequent runtime errors (#232107) This flag appears to cause issues in 3 out 4 users of mixRelease in Nixpkgs, plus Mobilizon, which isn't merged yet. It might be safer to set it to fals for now, as the runtime error messages produced by it are quite cryptic. --- pkgs/development/beam-modules/elixir-ls/default.nix | 2 ++ pkgs/development/beam-modules/mix-release.nix | 11 ++++++++++- pkgs/servers/akkoma/default.nix | 3 --- pkgs/servers/pleroma/default.nix | 1 - pkgs/servers/web-apps/plausible/default.nix | 3 --- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pkgs/development/beam-modules/elixir-ls/default.nix b/pkgs/development/beam-modules/elixir-ls/default.nix index 885b6eec49af..8573b4b7ca16 100644 --- a/pkgs/development/beam-modules/elixir-ls/default.nix +++ b/pkgs/development/beam-modules/elixir-ls/default.nix @@ -16,6 +16,8 @@ in mixRelease { inherit pname version src elixir; + stripDebug = true; + mixFodDeps = fetchMixDeps { pname = "mix-deps-${pname}"; inherit src version elixir; diff --git a/pkgs/development/beam-modules/mix-release.nix b/pkgs/development/beam-modules/mix-release.nix index 1a926148d599..1d40da27ecba 100644 --- a/pkgs/development/beam-modules/mix-release.nix +++ b/pkgs/development/beam-modules/mix-release.nix @@ -9,16 +9,25 @@ , enableDebugInfo ? false , mixEnv ? "prod" , compileFlags ? [ ] + # mix fixed output derivation dependencies , mixFodDeps ? null + # mix dependencies generated by mix2nix # this assumes each dependency is built by buildMix or buildRebar3 # each dependency needs to have a setup hook to add the lib path to $ERL_LIBS # this is how mix will find dependencies , mixNixDeps ? { } + , elixir ? inputs.elixir , hex ? inputs.hex.override { inherit elixir; } -, stripDebug ? true + +# This reduces closure size, but can lead to some hard to understand runtime +# errors, so use with caution. See e.g. +# https://github.com/whitfin/cachex/issues/205 +# https://framagit.org/framasoft/mobilizon/-/issues/1169 +, stripDebug ? false + , ... }@attrs: let diff --git a/pkgs/servers/akkoma/default.nix b/pkgs/servers/akkoma/default.nix index 5c9ae060df78..f6fe550bca58 100644 --- a/pkgs/servers/akkoma/default.nix +++ b/pkgs/servers/akkoma/default.nix @@ -31,9 +31,6 @@ beamPackages.mixRelease rec { mix phx.digest --no-deps-check ''; - # cf. https://github.com/whitfin/cachex/issues/205 - stripDebug = false; - mixNixDeps = import ./mix.nix { inherit beamPackages lib; overrides = (final: prev: { diff --git a/pkgs/servers/pleroma/default.nix b/pkgs/servers/pleroma/default.nix index 424944f4e478..05fe4c7d31b9 100644 --- a/pkgs/servers/pleroma/default.nix +++ b/pkgs/servers/pleroma/default.nix @@ -17,7 +17,6 @@ beamPackages.mixRelease rec { rev = "v${version}"; sha256 = "sha256-3iG2s7jVEnhq1kLLgtaHnFmLYBO2Xr5M5jjZfSNA9z4="; }; - stripDebug = false; mixNixDeps = import ./mix.nix { inherit beamPackages lib; diff --git a/pkgs/servers/web-apps/plausible/default.nix b/pkgs/servers/web-apps/plausible/default.nix index d57bcfc0190a..43001649b07e 100644 --- a/pkgs/servers/web-apps/plausible/default.nix +++ b/pkgs/servers/web-apps/plausible/default.nix @@ -49,9 +49,6 @@ beamPackages.mixRelease { nativeBuildInputs = [ nodejs ]; - # https://github.com/whitfin/cachex/issues/205 - stripDebug = false; - passthru = { tests = { inherit (nixosTests) plausible; }; updateScript = ./update.sh;