From b3a4a9d014879ae95f71cd0348ae89b4ece89ba1 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Tue, 29 Aug 2017 11:02:20 +0100 Subject: [PATCH 1/2] libexpr: add sha256 noop argument to fetch Nix 1.12 is going to support that argument fully. This addition is only there to allow forward-compatibility. --- src/libexpr/primops.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 819e1080175..7232e53d5e0 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -1709,6 +1709,8 @@ void fetch(EvalState & state, const Pos & pos, Value * * args, Value & v, string n(attr.name); if (n == "url") url = state.forceStringNoCtx(*attr.value, *attr.pos); + else if (n == "sha256") + // noop, added for forward-compatiblity else if (n == "name") name = state.forceStringNoCtx(*attr.value, *attr.pos); else From 35c3b05c035afa7b7b627b47c52c57f5a600c6fa Mon Sep 17 00:00:00 2001 From: zimbatm Date: Tue, 29 Aug 2017 15:03:17 +0100 Subject: [PATCH 2/2] libexpr: warn if the fetch sha256 argument is being used --- src/libexpr/primops.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 7232e53d5e0..de8c8eacd70 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -1711,6 +1711,8 @@ void fetch(EvalState & state, const Pos & pos, Value * * args, Value & v, url = state.forceStringNoCtx(*attr.value, *attr.pos); else if (n == "sha256") // noop, added for forward-compatiblity + static bool haveWarned = false; + warnOnce(haveWarned, "the fetchurl/fetchTarball sha256 argument is currently ignored. Upgrade to Nix 1.12 to support this feature."); else if (n == "name") name = state.forceStringNoCtx(*attr.value, *attr.pos); else