From ec37778a7824c167d715895e415d86ae7ae7c71b Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Mon, 5 Feb 2024 15:53:53 +0000 Subject: [PATCH 1/7] .gitignore: ignore all cabal build directories --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 7b4a9a45..7f5202f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -/dist/ -/dist-newstyle/ +dist +dist-newstyle .cabal-sandbox cabal.sandbox.config .stack-work From d5cdfa1019695f4d785fef6bb3a8d70fdbcecf8c Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Fri, 2 Feb 2024 01:57:12 +0000 Subject: [PATCH 2/7] inline-r: use common stanzas and remove unused packages --- inline-r/inline-r.cabal | 116 ++++++++++++++++++---------------------- 1 file changed, 52 insertions(+), 64 deletions(-) diff --git a/inline-r/inline-r.cabal b/inline-r/inline-r.cabal index 04e7f41a..e483772e 100644 --- a/inline-r/inline-r.cabal +++ b/inline-r/inline-r.cabal @@ -39,7 +39,29 @@ source-repository head location: git://github.com/tweag/HaskellR.git subdir: inline-r +common common-config + ghc-options: -Werror=unused-packages -Wall + default-language: Haskell2010 + +common common-test-and-benchmark-config + import: common-config + ghc-options: -threaded + hs-source-dirs: tests + +common common-test-suite-deps + build-depends: + inline-r, + base >=4.6 && <5, + tasty-hunit >=0.4.1 && <0.11, + +common common-benchmark-deps + build-depends: + inline-r, + base >=4.6 && <5, + criterion >=0.8 && <1.7, + library + import: common-config exposed-modules: Control.Memory.Region Data.Vector.SEXP @@ -88,7 +110,6 @@ library heredoc >=0.2 && <0.3, inline-c >=0.6 && <0.10, mtl >=2.1 && <2.4, - pretty >=1.1 && <1.2, primitive >=0.5 && <0.9, process >=1.2 && <1.7, reflection >=2 && <2.2, @@ -96,9 +117,6 @@ library template-haskell >=2.8 && <2.21, temporary >=1.2 && <1.4, text >=0.11 && <2.1, - th-lift >=0.6 && <0.9, - th-orphans >=0.8 && <0.14, - transformers >=0.3 && <0.7, vector >=0.10 && <0.14, if impl(ghc <9) build-depends: @@ -111,7 +129,6 @@ library includes: cbits/missing_r.h c-sources: cbits/missing_r.c include-dirs: cbits - default-language: Haskell2010 other-extensions: CPP ForeignFunctionInterface @@ -125,31 +142,26 @@ library ghc-options: -freduction-depth=32 --- We don't use ticks for promoted constructors, because we use --- promoted constructors heavily and because they confuse hsc2hs. - ghc-options: -Wall -fno-warn-unticked-promoted-constructors + ghc-options: -fno-warn-unticked-promoted-constructors test-suite tests - main-is: tests.hs + import: + common-test-and-benchmark-config, + common-test-suite-deps, type: exitcode-stdio-1.0 + main-is: tests.hs build-depends: - inline-r, - base >=4.6 && <5, bytestring >=0.10 && <0.12, directory >=1.2 && <1.4, - filepath >=1.3 && <1.5, heredoc >=0.2 && <0.3, ieee754 >=0.7 && <0.9, - mtl >=2.0 && <2.4, - process >=1.2 && <1.7, quickcheck-assertions >=0.1.1 && <0.4, singletons >=0.10 && <3.1, - strict >=0.3.2 && <0.6, tasty >=0.11 && <1.5, tasty-expected-failure >=0.11 && <0.13, - tasty-golden >=2.3 && <2.4, tasty-hunit >=0.4.1 && <0.11, tasty-quickcheck >=0.4.1 && <0.11, temporary >=1.2 && <1.4, - text >=0.11 && <2.1, vector >=0.12.3.1 && <0.14, if !os(windows) build-depends: unix >=2.5 && <2.9, @@ -161,92 +173,68 @@ test-suite tests Test.Regions Test.Vector Test.Matcher - ghc-options: -Wall -threaded - hs-source-dirs: tests - default-language: Haskell2010 test-suite test-qq - main-is: test-qq.hs + import: + common-test-and-benchmark-config, + common-test-suite-deps, type: exitcode-stdio-1.0 + main-is: test-qq.hs build-depends: - inline-r, - base >=4.6 && <5, mtl >=2.0 && <2.4, - process >=1.2 && <1.7, - tasty-hunit >=0.4.1 && <0.11, singletons >=0.9 && <3.1, text >=0.11 && <2.1, - ghc-options: -Wall -threaded - hs-source-dirs: tests - default-language: Haskell2010 test-suite test-shootout - main-is: test-shootout.hs + import: + common-test-and-benchmark-config, + common-test-suite-deps, type: exitcode-stdio-1.0 + main-is: test-shootout.hs other-modules: Test.Scripts build-depends: - inline-r, - base >=4.6 && <5, filepath >=1.3 && <1.5, process >=1.2 && <1.7, silently >=1.2 && <1.3, - tasty >=0.3 && <1.5, - tasty-hunit >=0.4.1 && <0.11, + tasty >=0.11 && <1.5, template-haskell >=2.8 && <2.21, - ghc-options: -Wall -threaded - hs-source-dirs: tests - default-language: Haskell2010 if os(windows) buildable: False test-suite test-env1 - main-is: test-env1.hs + import: + common-test-and-benchmark-config, + common-test-suite-deps, type: exitcode-stdio-1.0 + main-is: test-env1.hs build-depends: - inline-r, - base >=4.6 && <5, - tasty >=0.3 && <1.5, - tasty-hunit >=0.4.1 && <0.11, - ghc-options: -Wall -threaded - hs-source-dirs: tests - default-language: Haskell2010 + tasty >=0.11 && <1.5, test-suite test-env2 - main-is: test-env2.hs + import: + common-test-and-benchmark-config, + common-test-suite-deps, type: exitcode-stdio-1.0 + main-is: test-env2.hs build-depends: - inline-r, - base >=4.6 && <5, - tasty >=0.3 && <1.5, - tasty-hunit >=0.4.1 && <0.11, - ghc-options: -Wall -threaded - hs-source-dirs: tests - default-language: Haskell2010 + tasty >=0.11 && <1.5, benchmark bench-qq + import: + common-test-and-benchmark-config, + common-benchmark-deps, main-is: bench-qq.hs type: exitcode-stdio-1.0 build-depends: - inline-r, - base >=4.6 && <5, - criterion >=0.8 && <1.7, filepath >=1.3 && <1.5, - process >=1.2 && <1.7, template-haskell >=2.8 && <2.21, - ghc-options: -Wall -threaded - hs-source-dirs: tests - default-language: Haskell2010 benchmark bench-hexp + import: + common-test-and-benchmark-config, + common-benchmark-deps, main-is: bench-hexp.hs type: exitcode-stdio-1.0 build-depends: - inline-r, - base >=4.6 && <5, - criterion >=0.8 && <1.7, primitive >=0.5 && <0.9, - vector >=0.10 && <0.14, singletons >=2.7 && <3.1, - ghc-options: -Wall -threaded - hs-source-dirs: tests - default-language: Haskell2010 From 90dff5709a96a203f79a0079325507c4cd4dcf3e Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Fri, 2 Feb 2024 03:17:42 +0000 Subject: [PATCH 3/7] inline-r: bump upper package bounds --- inline-r/inline-r.cabal | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/inline-r/inline-r.cabal b/inline-r/inline-r.cabal index e483772e..60a4f7f3 100644 --- a/inline-r/inline-r.cabal +++ b/inline-r/inline-r.cabal @@ -101,22 +101,22 @@ library Internal.Error build-depends: base >=4.7 && <5, - aeson >=0.6 && <2.2, - bytestring >=0.10 && <0.12, - containers >=0.5 && <0.7, + aeson >=0.6 && <2.3, + bytestring >=0.10 && <0.13, + containers >=0.5 && <0.8, data-default-class >=0.1.2.0 && <0.2, - deepseq >=1.3 && <1.5, + deepseq >=1.3 && <1.6, exceptions >=0.6 && <1.1, heredoc >=0.2 && <0.3, inline-c >=0.6 && <0.10, mtl >=2.1 && <2.4, - primitive >=0.5 && <0.9, + primitive >=0.5 && <0.10, process >=1.2 && <1.7, reflection >=2 && <2.2, setenv >=0.1.1 && <0.2, - template-haskell >=2.8 && <2.21, + template-haskell >=2.8 && <2.22, temporary >=1.2 && <1.4, - text >=0.11 && <2.1, + text >=0.11 && <2.2, vector >=0.10 && <0.14, if impl(ghc <9) build-depends: @@ -124,7 +124,7 @@ library else build-depends: singletons >=3 && <3.1, - singletons-th >=3 && <3.3, + singletons-th >=3 && <3.4, hs-source-dirs: src includes: cbits/missing_r.h c-sources: cbits/missing_r.c @@ -151,13 +151,13 @@ test-suite tests type: exitcode-stdio-1.0 main-is: tests.hs build-depends: - bytestring >=0.10 && <0.12, + bytestring >=0.10 && <0.13, directory >=1.2 && <1.4, heredoc >=0.2 && <0.3, ieee754 >=0.7 && <0.9, quickcheck-assertions >=0.1.1 && <0.4, singletons >=0.10 && <3.1, - tasty >=0.11 && <1.5, + tasty >=0.11 && <1.6, tasty-expected-failure >=0.11 && <0.13, tasty-hunit >=0.4.1 && <0.11, tasty-quickcheck >=0.4.1 && <0.11, @@ -183,7 +183,7 @@ test-suite test-qq build-depends: mtl >=2.0 && <2.4, singletons >=0.9 && <3.1, - text >=0.11 && <2.1, + text >=0.11 && <2.2, test-suite test-shootout import: @@ -193,11 +193,11 @@ test-suite test-shootout main-is: test-shootout.hs other-modules: Test.Scripts build-depends: - filepath >=1.3 && <1.5, + filepath >=1.3 && <1.6, process >=1.2 && <1.7, silently >=1.2 && <1.3, - tasty >=0.11 && <1.5, - template-haskell >=2.8 && <2.21, + tasty >=0.11 && <1.6, + template-haskell >=2.8 && <2.22, if os(windows) buildable: False @@ -208,7 +208,7 @@ test-suite test-env1 type: exitcode-stdio-1.0 main-is: test-env1.hs build-depends: - tasty >=0.11 && <1.5, + tasty >=0.11 && <1.6, test-suite test-env2 import: @@ -217,7 +217,7 @@ test-suite test-env2 type: exitcode-stdio-1.0 main-is: test-env2.hs build-depends: - tasty >=0.11 && <1.5, + tasty >=0.11 && <1.6, benchmark bench-qq import: @@ -226,8 +226,8 @@ benchmark bench-qq main-is: bench-qq.hs type: exitcode-stdio-1.0 build-depends: - filepath >=1.3 && <1.5, - template-haskell >=2.8 && <2.21, + filepath >=1.3 && <1.6, + template-haskell >=2.8 && <2.22, benchmark bench-hexp import: @@ -236,5 +236,5 @@ benchmark bench-hexp main-is: bench-hexp.hs type: exitcode-stdio-1.0 build-depends: - primitive >=0.5 && <0.9, + primitive >=0.5 && <0.10, singletons >=2.7 && <3.1, From 80d2e58fec3c548119b3e9d55b217c3a9e8ebccf Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Fri, 2 Feb 2024 03:23:32 +0000 Subject: [PATCH 4/7] H: bump bytestring and remove unused packages --- H/H.cabal | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/H/H.cabal b/H/H.cabal index 39e69b92..841124d0 100644 --- a/H/H.cabal +++ b/H/H.cabal @@ -23,13 +23,10 @@ executable H main-is: H.hs other-modules: Paths_H build-depends: base >= 4.6 && < 5 - , bytestring >= 0.10 && <0.12 + , bytestring >= 0.10 && <0.13 , cmdargs >= 0.10.5 && <0.11 , file-embed >= 0.0.7 && <0.1 - , inline-r >= 0.9 && <1.1 - , pretty >= 1.1 && <1.2 , process >= 1.2 && <1.7 , temporary >= 1.2.0.3 && <1.4 - , vector >= 0.10 && <0.14 default-language: Haskell2010 - ghc-options: -Wall -threaded + ghc-options: -Werror=unused-packages -Wall -threaded From aadedd228c5ce0bf5ecf65962e486ec2ef80ff73 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Fri, 2 Feb 2024 03:36:47 +0000 Subject: [PATCH 5/7] examples: add license and update cabal file --- examples/HaskellR-examples.cabal | 62 ++++++++++++++++++-------------- examples/LICENSE | 28 +++++++++++++++ 2 files changed, 63 insertions(+), 27 deletions(-) create mode 100644 examples/LICENSE diff --git a/examples/HaskellR-examples.cabal b/examples/HaskellR-examples.cabal index 61d1e515..a81ec3fd 100644 --- a/examples/HaskellR-examples.cabal +++ b/examples/HaskellR-examples.cabal @@ -1,13 +1,14 @@ +cabal-version: 2.2 name: HaskellR-examples version: 0.1.0.0 -license: AllRightsReserved +license: BSD-3-Clause +license-file: LICENSE copyright: Copyright (c) 2013-2015 Amgen, Inc. Copyright (c) 2015 Tweag I/O Limited. build-type: Simple Category: FFI Synopsis: Examples bundled with the HaskellR project description: This package is part of the HaskellR project. -cabal-version: >=1.10 extra-source-files: nls/nls.H nls2/nls2.H @@ -17,47 +18,54 @@ source-repository head location: git://github.com/tweag/HaskellR.git subdir: examples +common common-config + default-language: Haskell2010 + ghc-options: -Wall -threaded + +common common-deps + build-depends: + inline-r, + base >= 4.6 && < 5, + executable fft + import: + common-config, + common-deps, main-is: Main.hs hs-source-dirs: fft - build-depends: inline-r - , base >= 4.6 && < 5 - default-language: Haskell2010 - ghc-options: -Wall -threaded executable fib + import: + common-config, + common-deps, main-is: Main.hs hs-source-dirs: fib other-modules: Fib - build-depends: inline-r - , base >= 4.6 && < 5 - default-language: Haskell2010 - ghc-options: -Wall -threaded executable nls + import: + common-config, + common-deps, main-is: Main.hs hs-source-dirs: nls - build-depends: inline-r - , base >= 4.6 && < 5 - , mwc-random >= 0.12 && <0.16 - default-language: Haskell2010 - ghc-options: -Wall -threaded + build-depends: + mwc-random >= 0.12 && <0.16, executable nls2 + import: + common-config, + common-deps, main-is: Main.hs hs-source-dirs: nls2 - build-depends: inline-r - , base >= 4.6 && < 5 - , mwc-random >= 0.12 && <0.16 - default-language: Haskell2010 - ghc-options: -Wall -threaded + build-depends: + mwc-random >= 0.12 && <0.16, executable RelaxWithNM + import: + common-config, + common-deps, main-is: RelaxWithNM.hs - build-depends: inline-r - , base >= 4.6 && < 5 - , deepseq >=1.4.4.0 && <1.5 - , integration >=0.2.1 && <0.3 - , temporary >= 1.2.0.3 && <1.4 - default-language: Haskell2010 - ghc-options: -Wall -threaded + build-depends: + deepseq >=1.4.4.0 && <1.6, + integration >=0.2.1 && <0.3, + temporary >= 1.2.0.3 && <1.4, diff --git a/examples/LICENSE b/examples/LICENSE new file mode 100644 index 00000000..96d78a31 --- /dev/null +++ b/examples/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2013-2015 Amgen, Inc. +Copyright (c) 2015 Tweag I/O Limited. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The names of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. From 47c0e34f6320e99daa9785ffc3ace0514d80149b Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Mon, 5 Feb 2024 15:52:36 +0000 Subject: [PATCH 6/7] IHaskell: bump versions and drop unused packages --- IHaskell/ihaskell-inline-r.cabal | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/IHaskell/ihaskell-inline-r.cabal b/IHaskell/ihaskell-inline-r.cabal index 8c4da86e..0e170fb6 100644 --- a/IHaskell/ihaskell-inline-r.cabal +++ b/IHaskell/ihaskell-inline-r.cabal @@ -19,17 +19,16 @@ library ,inline-r >=0.6.0.1 && <1.11 ,ihaskell >=0.10.2.2 && <0.12 ,ihaskell-blaze >=0.3.0.1 && <0.4 - ,filepath >=1.4.2.1 && <1.5 ,blaze-html >=0.9.1.2 && <0.10 - ,bytestring >=0.10.12.0 && <0.12 + ,bytestring >=0.10.12.0 && <0.13 ,base64-bytestring >=1.1.0.0 && <1.3 - ,template-haskell >=2.16.0.0 && <2.21 + ,template-haskell >=2.16.0.0 && <2.22 ,temporary >=1.2 && <1.4 other-extensions: TemplateHaskell QuasiQuotes hs-source-dirs: src default-language: Haskell2010 - ghc-options: -Wall + ghc-options: -Werror=unused-packages -Wall source-repository head type: git From bea91d0c5efd4d6d8d254a236073820cdce8d88f Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Mon, 5 Feb 2024 17:34:25 +0000 Subject: [PATCH 7/7] stack-nightly: init --- .github/workflows/workflow.yaml | 1 + shell-nightly.nix | 1 + stack-nightly.yaml | 14 ++++++++++++++ stack-nightly.yaml.lock | 19 +++++++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 shell-nightly.nix create mode 100644 stack-nightly.yaml create mode 100644 stack-nightly.yaml.lock diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 6db01e72..3e4892fc 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -45,6 +45,7 @@ jobs: - stack-lts-19.yaml - stack-lts-20.yaml - stack-lts-21.yaml + - stack-nightly.yaml runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 diff --git a/shell-nightly.nix b/shell-nightly.nix new file mode 100644 index 00000000..2e2c4941 --- /dev/null +++ b/shell-nightly.nix @@ -0,0 +1 @@ +builtins.import ./shell.nix { ghcAttr = "ghc98"; } diff --git a/stack-nightly.yaml b/stack-nightly.yaml new file mode 100644 index 00000000..dbe1d123 --- /dev/null +++ b/stack-nightly.yaml @@ -0,0 +1,14 @@ +resolver: nightly-2024-02-05 + +packages: +- examples +- H +- IHaskell +- inline-r + +extra-deps: +- ihaskell-blaze-0.3.0.1 + +nix: + shell-file: ./shell-nightly.nix + path: ["nixpkgs=./nixpkgs.nix"] diff --git a/stack-nightly.yaml.lock b/stack-nightly.yaml.lock new file mode 100644 index 00000000..14eee7db --- /dev/null +++ b/stack-nightly.yaml.lock @@ -0,0 +1,19 @@ +# This file was autogenerated by Stack. +# You should not edit this file by hand. +# For more information, please see the documentation at: +# https://docs.haskellstack.org/en/stable/lock_files + +packages: +- completed: + hackage: ihaskell-blaze-0.3.0.1@sha256:57f0e79758d084da3a662d0909ba2b01e469200029fed495fc208ba5f59024fd,2161 + pantry-tree: + sha256: 69fee7554a6410e45011c89d9e9547d18e2798e4f01ebd0426573b05e0e21696 + size: 223 + original: + hackage: ihaskell-blaze-0.3.0.1 +snapshots: +- completed: + sha256: 2523d9824f60f8eb181ddb58fbde9d78751a20a06a424057e73ca19eace11c7d + size: 597454 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2024/2/5.yaml + original: nightly-2024-02-05