From d8c5e33f6015e3f17aaf5fd290b1834e6e6c1049 Mon Sep 17 00:00:00 2001 From: Paul Bonaud Date: Thu, 13 Aug 2020 16:01:49 +0200 Subject: dhall: BREAKING CHANGE update dhall config for 1.33+ compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since dhall 1.33.0 lang version the `Optional/fold` function is removed from the language and can be replaced by the usage of the `merge` function which now works on Optional values 🎉 since 1.29 https://github.com/dhall-lang/dhall-haskell/pull/1608 This new code is thus not compatible with versions of dhall <1.29.0 (due to the new feature of the `merge` fonction). --- .travis.yml | 2 +- dhall-1.26.1.nix | 22 ---------------------- dhall-1.34.0.nix | 22 ++++++++++++++++++++++ dhall/server/service/plugin/correlationId.dhall | 24 +++++++++--------------- 4 files changed, 32 insertions(+), 38 deletions(-) delete mode 100644 dhall-1.26.1.nix create mode 100644 dhall-1.34.0.nix diff --git a/.travis.yml b/.travis.yml index 14ab868..99c10c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ install: # Install ansible - nix-env -i python3 ansible ansible-lint - - nix-env -if ./dhall-1.26.1.nix + - nix-env -if ./dhall-1.34.0.nix # Check ansible version - ansible --version diff --git a/dhall-1.26.1.nix b/dhall-1.26.1.nix deleted file mode 100644 index 918a528..0000000 --- a/dhall-1.26.1.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ pkgs ? import {} }: with pkgs; - -let - mkVersion = - version: sha256: - stdenv.mkDerivation { - name = "dhall-${version}"; - inherit version; - src = fetchurl { - url = "https://github.com/dhall-lang/dhall-haskell/releases/download/${version}/dhall-${version}-x86_64-linux.tar.bz2"; - inherit sha256; - }; - unpackPhase = '' - tar -xjf $src - ''; - installPhase = '' - mkdir -p $out/bin - mv bin/dhall $out/bin/ - ''; - }; -in - mkVersion "1.26.1" "0sl4r3mfairgd6kn26hs1r1lkh8rn992grd73078rhqf5w90ag05" diff --git a/dhall-1.34.0.nix b/dhall-1.34.0.nix new file mode 100644 index 0000000..a70d201 --- /dev/null +++ b/dhall-1.34.0.nix @@ -0,0 +1,22 @@ +{ pkgs ? import {} }: with pkgs; + +let + mkVersion = + version: sha256: + stdenv.mkDerivation { + name = "dhall-${version}"; + inherit version; + src = fetchurl { + url = "https://github.com/dhall-lang/dhall-haskell/releases/download/${version}/dhall-${version}-x86_64-linux.tar.bz2"; + inherit sha256; + }; + unpackPhase = '' + tar -xjf $src + ''; + installPhase = '' + mkdir -p $out/bin + mv bin/dhall $out/bin/ + ''; + }; +in + mkVersion "1.34.0" "0n64jkgbv7a3cmlv3gxpgc11p9b5w0k9nc0zm9am2pzmp6vm6b4n" diff --git a/dhall/server/service/plugin/correlationId.dhall b/dhall/server/service/plugin/correlationId.dhall index d5d5928..41c5720 100644 --- a/dhall/server/service/plugin/correlationId.dhall +++ b/dhall/server/service/plugin/correlationId.dhall @@ -2,22 +2,16 @@ let Plugin = ./Plugin.dhall let config = ./Config.dhall -in λ(generator : Optional Text) - → { name = - "correlation-id" +in λ(generator : Optional Text) → + { name = "correlation-id" , config = config.CorrelationId - { header_name = - "X-correl" - , echo_downstream = - True - , generator = - Optional/fold - Text - generator - Text - (λ(t : Text) → t) - "uuid#counter" - } + { header_name = "X-correl" + , echo_downstream = True + , generator = + merge + { None = "uuid#counter", Some = λ(x : Text) → x } + generator + } } : Plugin -- cgit v1.2.3