beamPackages.mixRelease: Make determinism toggleable

This commit is contained in:
Mathew Polzin 2023-12-03 09:53:06 -06:00 committed by Yt
parent c865c66216
commit 2d5053fca3
2 changed files with 11 additions and 2 deletions

View File

@ -6,6 +6,10 @@
, buildInputs ? [ ]
, nativeBuildInputs ? [ ]
, erlangCompilerOptions ? [ ]
# Deterministic Erlang builds remove full system paths from debug information
# among other things to keep builds more reproducible. See their docs for more:
# https://www.erlang.org/doc/man/compile
, erlangDeterministicBuilds ? true
, beamDeps ? [ ]
, propagatedBuildInputs ? [ ]
, postPatch ? ""
@ -35,7 +39,7 @@ let
ERL_COMPILER_OPTIONS =
let
options = [ "deterministic" ] ++ erlangCompilerOptions;
options = erlangCompilerOptions ++ lib.optionals erlangDeterministicBuilds [ "deterministic" ];
in
"[${lib.concatStringsSep "," options}]";

View File

@ -33,6 +33,11 @@
# See https://www.erlang.org/doc/man/compile
, erlangCompilerOptions ? [ ]
# Deterministic Erlang builds remove full system paths from debug information
# among other things to keep builds more reproducible. See their docs for more:
# https://www.erlang.org/doc/man/compile
, erlangDeterministicBuilds ? true
# Mix dependencies provided as a fixed output derivation
, mixFodDeps ? null
@ -100,7 +105,7 @@ stdenv.mkDerivation (overridable // {
ERL_COMPILER_OPTIONS =
let
options = [ "deterministic" ] ++ erlangCompilerOptions;
options = erlangCompilerOptions ++ lib.optionals erlangDeterministicBuilds [ "deterministic" ];
in
"[${lib.concatStringsSep "," options}]";