From patchwork Fri May 29 13:40:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: John Soo X-Patchwork-Id: 22438 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4343A27BBE1; Fri, 29 May 2020 14:41:18 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id D8FBE27BBE3 for ; Fri, 29 May 2020 14:41:09 +0100 (BST) Received: from localhost ([::1]:37206 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jefG1-0000zD-EW for patchwork@mira.cbaines.net; Fri, 29 May 2020 09:41:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47736) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jefFu-0000yv-H0 for guix-patches@gnu.org; Fri, 29 May 2020 09:41:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42618) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jefFu-0003yq-8C for guix-patches@gnu.org; Fri, 29 May 2020 09:41:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jefFu-0003J0-6M for guix-patches@gnu.org; Fri, 29 May 2020 09:41:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40557] [PATCH] Add dhall. Resent-From: John Soo Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 29 May 2020 13:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40557 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Leo Famulari Cc: 40557@debbugs.gnu.org Received: via spool by 40557-submit@debbugs.gnu.org id=B40557.159075964312672 (code B ref 40557); Fri, 29 May 2020 13:41:02 +0000 Received: (at 40557) by debbugs.gnu.org; 29 May 2020 13:40:43 +0000 Received: from localhost ([127.0.0.1]:54164 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jefFO-0003I6-Ve for submit@debbugs.gnu.org; Fri, 29 May 2020 09:40:43 -0400 Received: from mail-pj1-f54.google.com ([209.85.216.54]:34709) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jefFJ-0003Hl-9l for 40557@debbugs.gnu.org; Fri, 29 May 2020 09:40:29 -0400 Received: by mail-pj1-f54.google.com with SMTP id a45so1736630pje.1 for <40557@debbugs.gnu.org>; Fri, 29 May 2020 06:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=asu-edu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=RHvbiP+Q8EtoivqSCx4fChRBjWcPmq+bNLgYxTmvqT0=; b=phZnzuiNiKaP6/J3CTqdfDqbyd970FvTZmZppzEb4Ayq1N5YATtesN6W7rbIi1q3Bs 3ZC13GWM6FHXkE9oNHIdO7YUVbYBRJxkkDoHGcH41tW5xSjhmeri3M0Sq6sWQkLUvtgp tzJF9w24Q0oeP297hwoesH9T9+Ku7dMpyWlt+B3mmPfackElnoWbQg/t4isderTE5FvJ LgT+yWJif85fHNEhH9TqQs4F2JsoI7FxnmIGnnzNItXDMPLQWfAbI2MnPDJhVxhl3mkZ Q6s1YYVOzluT6Us7IDr4zmMOPGQBb7Xx8olTs+LnU1MjLntXHMrdxud9xvAKtnDHUTlG fSUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=RHvbiP+Q8EtoivqSCx4fChRBjWcPmq+bNLgYxTmvqT0=; b=XUFLv6UxVVFRrnCe6UUfuf8ZiJd5vvuI+kJ8FlJ/ooBOdfvLz7xvJNZ09tCeQ6UIw4 Bmtke0lSAmhA90OwcXOmPt/vJ0Xevx3u8fGQWpr13Y8L2ni4Oxmj9Il2pfZ23H/CL8d/ f08b9XPAufeT4rVzaVGAaPB7S0QYLzdRY9isbPlBZ0xPSsh4V/9LrrQMI4rqRGvVz4vF 2H7kECTCeL9zBhQjkyUZmxRjSwNPERdHc3/2u/dFmN3qrMx95WyuL9qZ+2jHZmEx2f9d eiJVuBm9GhDE/bxhgrPksGIsVdb4zyRXKGMTxO3kISqysU34PAmWGRaBC2Vn9P6Cuj4g DGZw== X-Gm-Message-State: AOAM533OkVsB6h3mD4SQf+Y6l2sIegRHFudQuov1jWzqqFqqnl/mnDhI zBCqOZ3Hx1n5cGz2p8ekAAAvvnZQJKvQvg== X-Google-Smtp-Source: ABdhPJyoCaEzE41YNy56W0CNZo1gsVqcM3OG7TxYoGrGjXshRpZ5EBPBGkXg/ZTQt2yofdoMQBfAIw== X-Received: by 2002:a17:90a:f493:: with SMTP id bx19mr8817833pjb.45.1590759618606; Fri, 29 May 2020 06:40:18 -0700 (PDT) Received: from ecenter ([2600:1700:83b0:8bd0:8e74:a824:70c:a859]) by smtp.gmail.com with ESMTPSA id r18sm7537145pjz.43.2020.05.29.06.40.15 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 May 2020 06:40:16 -0700 (PDT) From: John Soo References: <87r1wuqa9h.fsf@asu.edu> <20200529015042.GJ5443@jasmine.lan> Date: Fri, 29 May 2020 06:40:11 -0700 In-Reply-To: <20200529015042.GJ5443@jasmine.lan> (Leo Famulari's message of "Thu, 28 May 2020 21:50:42 -0400") Message-ID: <877dwuq2pw.fsf@asu.edu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello, Leo Famulari writes: > Thanks! The first 24 patches LGTM as-is. Thank you. >> * gnu/packages/dhall.scm (dhall): New variable. >> * gnu/local.mk (GNU_SYSTEM_MODULES): Add dhall.scm. >> * gnu/packages/patches/dhall-remove-network-tests.patch: Add patch to remove >> network tests. > >> + (arguments >> + `(#:phases >> + (modify-phases %standard-phases >> + (add-after 'unpack 'remove-more-tests > > Can you add a brief comment explaining why we need to remove these > tests, rename the phase to reflect that, and send a revised patch? Alright, done. Let me know what else I can do. Thanks again! - John From 6c57d5fc3a9c574a57acdf753751ccdff4e30930 Mon Sep 17 00:00:00 2001 From: John Soo Date: Fri, 10 Apr 2020 21:01:46 -0700 Subject: [PATCH 25/25] gnu: Add dhall. * gnu/packages/dhall.scm (dhall): New variable. * gnu/local.mk (GNU_SYSTEM_MODULES): Add dhall.scm. * gnu/packages/patches/dhall-remove-network-tests.patch: Add patch to remove network tests. --- gnu/local.mk | 1 + gnu/packages/dhall.scm | 133 ++++++++++++++++++ .../patches/dhall-remove-network-tests.patch | 97 +++++++++++++ 3 files changed, 231 insertions(+) create mode 100644 gnu/packages/dhall.scm create mode 100644 gnu/packages/patches/dhall-remove-network-tests.patch diff --git a/gnu/local.mk b/gnu/local.mk index 80cefe5b63..ee6f7f3f38 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -157,6 +157,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/debian.scm \ %D%/packages/debug.scm \ %D%/packages/dejagnu.scm \ + %D%/packages/dhall.scm \ %D%/packages/dico.scm \ %D%/packages/dictionaries.scm \ %D%/packages/diffoscope.scm \ diff --git a/gnu/packages/dhall.scm b/gnu/packages/dhall.scm new file mode 100644 index 0000000000..bbe2d271d7 --- /dev/null +++ b/gnu/packages/dhall.scm @@ -0,0 +1,133 @@ +;;; Copyright © 2020 John Soo +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages dhall) + #:use-module (gnu packages) + #:use-module (gnu packages haskell-xyz) + #:use-module (gnu packages haskell-check) + #:use-module (gnu packages haskell-crypto) + #:use-module (gnu packages haskell-web) + #:use-module (guix download) + #:use-module (guix build-system haskell) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages)) + +(define-public dhall + (package + (name "dhall") + (version "1.31.1") + (source + (origin + (method url-fetch) + (uri (string-append + "https://hackage.haskell.org/package/dhall/dhall-" + version + ".tar.gz")) + (sha256 + (base32 + "18v7vvcbcm9s7slh6h43rj9yakkkxwnwgj6kv84i6qzd2j7d80mc")) + (patches (search-patches "dhall-remove-network-tests.patch")))) + (build-system haskell-build-system) + (inputs + `(("ghc-aeson" ,ghc-aeson) + ("ghc-aeson-pretty" ,ghc-aeson-pretty) + ("ghc-ansi-terminal" ,ghc-ansi-terminal) + ("ghc-atomic-write" ,ghc-atomic-write-0.2.0.7) + ("ghc-case-insensitive" ,ghc-case-insensitive) + ("ghc-cborg" ,ghc-cborg) + ("ghc-cborg-json" ,ghc-cborg-json) + ("ghc-contravariant" ,ghc-contravariant) + ("ghc-data-fix" ,ghc-data-fix) + ("ghc-diff" ,ghc-diff) + ("ghc-dotgen" ,ghc-dotgen) + ("ghc-either" ,ghc-either) + ("ghc-exceptions" ,ghc-exceptions) + ("ghc-hashable" ,ghc-hashable) + ("ghc-lens-family-core" ,ghc-lens-family-core) + ("ghc-megaparsec" ,ghc-megaparsec) + ("ghc-memory" ,ghc-memory) + ("ghc-network-uri" ,ghc-network-uri) + ("ghc-optparse-applicative" ,ghc-optparse-applicative) + ("ghc-parsers" ,ghc-parsers) + ("ghc-parser-combinators" ,ghc-parser-combinators) + ("ghc-prettyprinter" ,ghc-prettyprinter-1.6) + ("ghc-prettyprinter-ansi-terminal" ,ghc-prettyprinter-ansi-terminal) + ("ghc-pretty-simple" ,ghc-pretty-simple) + ("ghc-profunctors" ,ghc-profunctors) + ("ghc-repline" ,ghc-repline-0.3) + ("ghc-serialise" ,ghc-serialise) + ("ghc-scientific" ,ghc-scientific) + ("ghc-text-manipulate" ,ghc-text-manipulate) + ("ghc-th-lift-instances" ,ghc-th-lift-instances) + ("ghc-transformers-compat" ,ghc-transformers-compat) + ("ghc-unordered-containers" ,ghc-unordered-containers) + ("ghc-uri-encode" ,ghc-uri-encode) + ("ghc-vector" ,ghc-vector) + ("ghc-cryptonite" ,ghc-cryptonite) + ("ghc-http-types" ,ghc-http-types) + ("ghc-http-client" ,ghc-http-client) + ("ghc-http-client-tls" ,ghc-http-client-tls))) + (native-inputs + `(("ghc-foldl" ,ghc-foldl) + ("ghc-generic-random" ,ghc-generic-random-1.3.0.1) + ("ghc-quickcheck" ,ghc-quickcheck) + ("ghc-quickcheck-instances" ,ghc-quickcheck-instances) + ("ghc-semigroups" ,ghc-semigroups) + ("ghc-special-values" ,ghc-special-values) + ("ghc-spoon" ,ghc-spoon) + ("ghc-tasty" ,ghc-tasty) + ("ghc-tasty-expected-failure" ,ghc-tasty-expected-failure) + ("ghc-tasty-hunit" ,ghc-tasty-hunit) + ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck) + ("ghc-turtle" ,ghc-turtle) + ("ghc-mockery" ,ghc-mockery) + ("ghc-doctest" ,ghc-doctest))) + (arguments + `(#:phases + (modify-phases %standard-phases + ;; Remove tests that require network + (add-after 'unpack 'remove-more-tests + (lambda _ + (substitute* "src/Dhall/Tutorial.hs" + (((string-append + "-- >>> input auto " + "\"https://raw.githubusercontent.com/dhall-lang" + "/dhall-haskell/18e4e9a18dc53271146df3ccf5b4177c3552236b/" + "examples/True\" :: IO Bool")) + "") + (((string-append + "-- >>> input auto " + "\"False == " + "https://raw.githubusercontent.com/dhall-lang" + "/dhall-haskell/18e4e9a18dc53271146df3ccf5b4177c3552236b/" + "examples/True\" :: IO Bool")) + "")) + #t))))) + (home-page + "https://dhall-lang.org/") + (synopsis + "Configuration language guaranteed to terminate") + (description + "Dhall is an explicitly typed configuration language that is not Turing +complete. Despite being Turing incomplete, Dhall is a real programming +language with a type-checker and evaluator. + +Use this library to parse, type-check, evaluate, and pretty-print the Dhall +configuration language. This package also includes an executable which +type-checks a Dhall file and reduces the file to a fully evaluated normal +form.") + (license license:bsd-3))) diff --git a/gnu/packages/patches/dhall-remove-network-tests.patch b/gnu/packages/patches/dhall-remove-network-tests.patch new file mode 100644 index 0000000000..c260e7844d --- /dev/null +++ b/gnu/packages/patches/dhall-remove-network-tests.patch @@ -0,0 +1,97 @@ +diff a/dhall-lang/tests/import/failure/referentiallyInsane.dhall b/dhall-lang/tests/import/failure/referentiallyInsane.dhall +--- a/dhall-lang/tests/import/failure/referentiallyInsane.dhall ++++ /dev/null +@@ -1,13 +0,0 @@ +-{- The following remote import attempts to import an environment variable, which +- must be disallowed by the referential sanity check +- +- One reason for doing this is to protect against remote imports exfiltrating +- environment variables (such as via custom headers). Only referentially +- opaque imports (i.e. local imports) have permission to refer to other +- referentially opaque imports in order to protect against this attack. +- +- The referential sanity check also ensures that remote imports are +- referentially transparent. Or in other words, any import that is globally +- addressable must have a meaning that is not context-sensitive. +--} +-https://raw.githubusercontent.com/dhall-lang/dhall-lang/master/tests/import/data/referentiallyOpaque.dhall +diff a/dhall-lang/tests/import/success/customHeadersA.dhall b/dhall-lang/tests/import/success/customHeadersA.dhall +--- a/dhall-lang/tests/import/success/customHeadersA.dhall ++++ /dev/null +@@ -1,3 +0,0 @@ +-https://httpbin.org/user-agent +- using [ { mapKey = "User-Agent", mapValue = "Dhall" } ] +- as Text +diff a/dhall-lang/tests/import/success/noHeaderForwardingA.dhall b/dhall-lang/tests/import/success/noHeaderForwardingA.dhall +--- a/dhall-lang/tests/import/success/noHeaderForwardingA.dhall ++++ /dev/null +@@ -1,6 +0,0 @@ +-{- The purpose of this test is to verify that the custom headers supplied to +- this import are not forwarded to the transitive import of +- https://httpbin.org/user-agent +--} +-https://raw.githubusercontent.com/dhall-lang/dhall-lang/master/tests/import/success/customHeadersA.dhall +- using [ { mapKey = "User-Agent", mapValue = "Secret" } ] +diff a/dhall-lang/tests/import/success/unit/RemoteAsTextA.dhall b/dhall-lang/tests/import/success/unit/RemoteAsTextA.dhall +--- a/dhall-lang/tests/import/success/unit/RemoteAsTextA.dhall ++++ /dev/null +@@ -1 +0,0 @@ +-https://raw.githubusercontent.com/dhall-lang/dhall-lang/0b983b92aa2222dc3e292c20550ee37dea3f41df/tests/import/data/example.txt as Text +diff a/dhall-lang/tests/import/success/unit/SimpleRemoteA.dhall b/dhall-lang/tests/import/success/unit/SimpleRemoteA.dhall +--- a/dhall-lang/tests/import/success/unit/SimpleRemoteA.dhall ++++ /dev/null +@@ -1 +0,0 @@ +-https://raw.githubusercontent.com/dhall-lang/dhall-lang/0b983b92aa2222dc3e292c20550ee37dea3f41df/tests/import/data/simple.dhall +diff a/dhall-lang/tests/import/success/unit/asLocation/RemoteChain1A.dhall b/dhall-lang/tests/import/success/unit/asLocation/RemoteChain1A.dhall +--- a/dhall-lang/tests/import/success/unit/asLocation/RemoteChain1A.dhall ++++ /dev/null +@@ -1 +0,0 @@ +-https://raw.githubusercontent.com/dhall-lang/dhall-lang/0b983b92aa2222dc3e292c20550ee37dea3f41df/tests/import/data/simpleLocation.dhall +diff a/dhall-lang/tests/import/success/unit/asLocation/RemoteChain2A.dhall b/dhall-lang/tests/import/success/unit/asLocation/RemoteChain2A.dhall +--- a/dhall-lang/tests/import/success/unit/asLocation/RemoteChain2A.dhall ++++ /dev/null +@@ -1 +0,0 @@ +-https://raw.githubusercontent.com/Nadrieril/dhall-rust/f7d8c64a9799f139ad65427c2518376adb9e2e2f/dhall/tests/import/success/unit/asLocation/Canonicalize3A.dhall +diff a/dhall-lang/tests/import/success/unit/asLocation/RemoteChain3A.dhall b/dhall-lang/tests/import/success/unit/asLocation/RemoteChain3A.dhall +--- a/dhall-lang/tests/import/success/unit/asLocation/RemoteChain3A.dhall ++++ /dev/null +@@ -1 +0,0 @@ +-https://raw.githubusercontent.com/Nadrieril/dhall-rust/f7d8c64a9799f139ad65427c2518376adb9e2e2f/dhall/tests/import/success/unit/asLocation/Canonicalize5A.dhall +diff a/dhall-lang/tests/import/success/unit/asLocation/RemoteChainEnvA.dhall b/dhall-lang/tests/import/success/unit/asLocation/RemoteChainEnvA.dhall +--- a/dhall-lang/tests/import/success/unit/asLocation/RemoteChainEnvA.dhall ++++ /dev/null +@@ -1,5 +0,0 @@ +-{- +- This test verifies that `env:VAR as Location` isn't rejected as referentially opaque, +- as `env:VAR` on its own would. +--} +-https://raw.githubusercontent.com/Nadrieril/dhall-rust/f7d8c64a9799f139ad65427c2518376adb9e2e2f/dhall/tests/import/success/unit/asLocation/EnvA.dhall +diff a/dhall-lang/tests/import/success/unit/asLocation/RemoteChainMissingA.dhall b/dhall-lang/tests/import/success/unit/asLocation/RemoteChainMissingA.dhall +--- a/dhall-lang/tests/import/success/unit/asLocation/RemoteChainMissingA.dhall ++++ /dev/null +@@ -1,6 +0,0 @@ +-{- This test verifies that `missing as Location` succeeds when chained since: +- * The `missing` is never actually resolved (due to the `as Location`) +- * The `missing` should be treated as referentially transparent (and therefore +- be a valid transitive dependency of a remote import) +--} +-https://raw.githubusercontent.com/Nadrieril/dhall-rust/f7d8c64a9799f139ad65427c2518376adb9e2e2f/dhall/tests/import/success/unit/asLocation/MissingA.dhall +diff a/dhall-lang/tests/type-inference/success/CacheImportsA.dhall b/dhall-lang/tests/type-inference/success/CacheImportsA.dhall +--- a/dhall-lang/tests/type-inference/success/CacheImportsA.dhall ++++ /dev/null +@@ -1,6 +0,0 @@ +-{- +- This URL returns (probably) a different result for each request. This test +- ensures that import results for a given URL are correctly cached within an +- execution of dhall. +--} +-let _ = assert : https://csrng.net/csrng/csrng.php?min=0&max=1000 as Text === https://csrng.net/csrng/csrng.php?min=0&max=1000 as Text in 0 +diff a/dhall-lang/tests/type-inference/success/CacheImportsCanonicalizeA.dhall b/dhall-lang/tests/type-inference/success/CacheImportsCanonicalizeA.dhall +--- a/dhall-lang/tests/type-inference/success/CacheImportsCanonicalizeA.dhall ++++ /dev/null +@@ -1,5 +0,0 @@ +-{- +- This URL returns (probably) a different result for each request. This test +- ensures that import locations are canonicalized before being cached. +--} +-let _ = assert : https://csrng.net/csrng/csrng.php?min=0&max=1000 as Text === https://csrng.net/csrng/../csrng/csrng.php?min=0&max=1000 as Text in 0 -- 2.26.2