buildRebar3: enable deterministic builds (#434713)

authored by

Adam C. Stephens and committed by
GitHub
e4a689c0 96677427

+11 -3
+11 -3
pkgs/development/beam-modules/build-rebar3.nix
··· 21 buildPhase ? null, 22 configurePhase ? null, 23 meta ? { }, 24 - enableDebugInfo ? false, 25 ... 26 }@attrs: 27 28 let 29 - debugInfoFlag = lib.optionalString (enableDebugInfo || erlang.debugInfo) "debug-info"; 30 - 31 rebar3 = rebar3WithPlugins { 32 plugins = buildPlugins; 33 }; ··· 66 propagatedBuildInputs = lib.unique beamDeps; 67 68 inherit src; 69 70 # stripping does not have any effect on beam files 71 # it is however needed for dependencies with NIFs
··· 21 buildPhase ? null, 22 configurePhase ? null, 23 meta ? { }, 24 + erlangCompilerOptions ? [ ], 25 + # Deterministic Erlang builds remove full system paths from debug information 26 + # among other things to keep builds more reproducible. See their docs for more: 27 + # https://www.erlang.org/doc/man/compile 28 + erlangDeterministicBuilds ? true, 29 ... 30 }@attrs: 31 32 let 33 rebar3 = rebar3WithPlugins { 34 plugins = buildPlugins; 35 }; ··· 68 propagatedBuildInputs = lib.unique beamDeps; 69 70 inherit src; 71 + 72 + ERL_COMPILER_OPTIONS = 73 + let 74 + options = erlangCompilerOptions ++ lib.optionals erlangDeterministicBuilds [ "deterministic" ]; 75 + in 76 + "[${lib.concatStringsSep "," options}]"; 77 78 # stripping does not have any effect on beam files 79 # it is however needed for dependencies with NIFs