fetchMixDeps, mixRelease: move env variables into env (#489754)

This commit is contained in:
Adam C. Stephens
2026-02-12 19:47:22 +00:00
committed by GitHub
2 changed files with 35 additions and 29 deletions
@@ -53,17 +53,20 @@ stdenvNoCC.mkDerivation (
git
];
MIX_ENV = mixEnv;
MIX_TARGET = mixTarget;
MIX_DEBUG = if debug then 1 else 0;
DEBUG = if debug then 1 else 0; # for rebar3
# the api with `mix local.rebar rebar path` makes a copy of the binary
MIX_REBAR = "${rebar}/bin/rebar";
MIX_REBAR3 = "${rebar3}/bin/rebar3";
# there is a persistent download failure with absinthe 1.6.3
# those defaults reduce the failure rate
HEX_HTTP_CONCURRENCY = 1;
HEX_HTTP_TIMEOUT = 120;
env = {
MIX_ENV = mixEnv;
MIX_TARGET = mixTarget;
MIX_DEBUG = if debug then 1 else 0;
DEBUG = if debug then 1 else 0; # for rebar3
# the api with `mix local.rebar rebar path` makes a copy of the binary
MIX_REBAR = "${rebar}/bin/rebar";
MIX_REBAR3 = "${rebar3}/bin/rebar3";
# there is a persistent download failure with absinthe 1.6.3
# those defaults reduce the failure rate
HEX_HTTP_CONCURRENCY = 1;
HEX_HTTP_TIMEOUT = 120;
}
// (attrs.env or { });
configurePhase =
attrs.configurePhase or ''
+21 -18
View File
@@ -123,28 +123,31 @@ stdenv.mkDerivation (
buildInputs = buildInputs ++ lib.optionals (escriptBinName != null) [ erlang ];
MIX_ENV = mixEnv;
MIX_TARGET = mixTarget;
MIX_BUILD_PREFIX = (if mixTarget == "host" then "" else "${mixTarget}_") + "${mixEnv}";
MIX_DEBUG = if enableDebugInfo then 1 else 0;
HEX_OFFLINE = 1;
__darwinAllowLocalNetworking = true;
DEBUG = if enableDebugInfo then 1 else 0; # for Rebar3 compilation
# The API with `mix local.rebar rebar path` makes a copy of the binary
# some older dependencies still use rebar.
MIX_REBAR = "${rebar}/bin/rebar";
MIX_REBAR3 = "${rebar3}/bin/rebar3";
env = {
MIX_ENV = mixEnv;
MIX_TARGET = mixTarget;
MIX_BUILD_PREFIX = (if mixTarget == "host" then "" else "${mixTarget}_") + "${mixEnv}";
MIX_DEBUG = if enableDebugInfo then 1 else 0;
HEX_OFFLINE = 1;
ERL_COMPILER_OPTIONS =
let
options = erlangCompilerOptions ++ lib.optionals erlangDeterministicBuilds [ "deterministic" ];
in
"[${lib.concatStringsSep "," options}]";
DEBUG = if enableDebugInfo then 1 else 0; # for Rebar3 compilation
# The API with `mix local.rebar rebar path` makes a copy of the binary
# some older dependencies still use rebar.
MIX_REBAR = "${rebar}/bin/rebar";
MIX_REBAR3 = "${rebar3}/bin/rebar3";
LANG = if stdenv.hostPlatform.isLinux then "C.UTF-8" else "C";
LC_CTYPE = if stdenv.hostPlatform.isLinux then "C.UTF-8" else "UTF-8";
ERL_COMPILER_OPTIONS =
let
options = erlangCompilerOptions ++ lib.optionals erlangDeterministicBuilds [ "deterministic" ];
in
"[${lib.concatStringsSep "," options}]";
LANG = if stdenv.hostPlatform.isLinux then "C.UTF-8" else "C";
LC_CTYPE = if stdenv.hostPlatform.isLinux then "C.UTF-8" else "UTF-8";
}
// (attrs.env or { });
postUnpack = ''
# Mix and Hex