From a6ba848f3c6bf42e902040a469dedd39a870422f Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 17:07:11 +0300 Subject: [PATCH 01/26] gitignore compatible with the new-style cabal builds. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 7fd67fc..fd2175c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ +.ghc.environment.* /.cabal-sandbox/* /cabal.sandbox.config *.chi *.chs.h +/dist-newstyle /dist/* *.hi /issues/* From 5d3d5993e8191ef2a206e6c7d85b086a9683c96b Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 17:09:31 +0300 Subject: [PATCH 02/26] =?UTF-8?q?fixing=20dodgy-import:=20Module=20?= =?UTF-8?q?=E2=80=98Prelude=E2=80=99=20does=20not=20export=20=E2=80=98catc?= =?UTF-8?q?h=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Control/StateTrans.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Control/StateTrans.hs b/src/Control/StateTrans.hs index fc05470..566fd39 100644 --- a/src/Control/StateTrans.hs +++ b/src/Control/StateTrans.hs @@ -77,7 +77,6 @@ where import Control.Applicative (Applicative(..)) import Control.Monad (liftM, ap) import Control.Exception (catch) -import Prelude hiding (catch) -- BEWARE! You enter monad country. Read any of Wadler's or -- Launchbury/Peyton-Jones' texts before entering. Otherwise, From 8f62f8fca82d6e510c5206dc17143f09da37e8a3 Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 17:25:55 +0300 Subject: [PATCH 03/26] support for v2-config --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index fd2175c..455c544 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ .ghc.environment.* /.cabal-sandbox/* /cabal.sandbox.config +cabal.project.local +cabal.project.local~ *.chi *.chs.h /dist-newstyle From d19e04218b0f635c61c20bd654b8525b4e9697be Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 17:33:25 +0300 Subject: [PATCH 04/26] bump cabal version requirement for v2-features. --- c2hs.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c2hs.cabal b/c2hs.cabal index 0263c9b..c215275 100644 --- a/c2hs.cabal +++ b/c2hs.cabal @@ -19,7 +19,7 @@ Description: C->Haskell assists in the development of Haskell bindings to C correct Haskell types. Category: Development Tested-With: GHC==6.12.3, GHC==7.0.4, GHC==7.6.1, GHC==7.6.3, GHC==7.8.3, GHC==7.10.1 -Cabal-Version: >= 1.10 +Cabal-Version: >= 2.0 Build-Type: Simple --TODO: Cabal should allow 'Data-Files' in the executable stanza From 7f265e2cbb1d2ffea0953ca4bec1bc8081208c35 Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 17:37:36 +0300 Subject: [PATCH 05/26] fixing missing home modules --- c2hs.cabal | 2 ++ 1 file changed, 2 insertions(+) diff --git a/c2hs.cabal b/c2hs.cabal index c215275..d2b660d 100644 --- a/c2hs.cabal +++ b/c2hs.cabal @@ -175,6 +175,7 @@ Test-Suite test-bugs shelly >= 1.0, text, transformers + other-modules: Paths_c2hs default-language: Haskell2010 Test-Suite test-system @@ -189,6 +190,7 @@ Test-Suite test-system shelly >= 1.0, text, transformers + other-modules: Paths_c2hs default-language: Haskell2010 Flag regression From 9822025cc34f39bebf8d98d074908bebe6a67e11 Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 17:43:51 +0300 Subject: [PATCH 06/26] added warnings --- c2hs.cabal | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/c2hs.cabal b/c2hs.cabal index d2b660d..9fbda57 100644 --- a/c2hs.cabal +++ b/c2hs.cabal @@ -157,10 +157,9 @@ Executable c2hs Text.Lexers default-extensions: ForeignFunctionInterface - c-sources: src/C2HS/config.c - --TODO: eliminate the need to suppress these warnings: - ghc-options: -Wall -fno-warn-incomplete-patterns -fwarn-tabs - default-language: Haskell2010 + c-sources: src/C2HS/config.c + ghc-options: -Wall + default-language: Haskell2010 Test-Suite test-bugs type: exitcode-stdio-1.0 @@ -176,7 +175,8 @@ Test-Suite test-bugs text, transformers other-modules: Paths_c2hs - default-language: Haskell2010 + ghc-options: -Wall + default-language: Haskell2010 Test-Suite test-system type: exitcode-stdio-1.0 @@ -191,7 +191,8 @@ Test-Suite test-system text, transformers other-modules: Paths_c2hs - default-language: Haskell2010 + ghc-options: -Wall + default-language: Haskell2010 Flag regression description: Enable regression suite build. @@ -208,4 +209,5 @@ Executable regression-suite yaml >= 0.8 else buildable: False + ghc-options: -Wall default-language: Haskell2010 From 6de11937150256d6c2da5d40b82a55b8c9b896f2 Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 17:59:11 +0300 Subject: [PATCH 07/26] gitignore tests/bugs and tests/system --- .gitignore | 163 +---------------------------------------------------- 1 file changed, 2 insertions(+), 161 deletions(-) diff --git a/.gitignore b/.gitignore index 455c544..e708ef3 100644 --- a/.gitignore +++ b/.gitignore @@ -11,164 +11,5 @@ cabal.project.local~ /issues/* *.o /.shelly/*.txt -/tests/bugs/call_capital/Capital -/tests/bugs/call_capital/Capital.chi -/tests/bugs/call_capital/Capital.chs.h -/tests/bugs/call_capital/Capital_c.o -/tests/bugs/call_capital/Capital.hi -/tests/bugs/call_capital/Capital.hs -/tests/bugs/call_capital/Capital.o -/tests/bugs/issue-09/Issue09.hs -/tests/bugs/issue-102/Issue102 -/tests/bugs/issue-102/Issue102.hs -/tests/bugs/issue-103/Issue103A.hs -/tests/bugs/issue-103/Issue103.hs -/tests/bugs/issue-107/Issue107 -/tests/bugs/issue-107/Issue107.hs -/tests/bugs/issue-10/Issue10 -/tests/bugs/issue-10/Issue10.hs -/tests/bugs/issue-10/Issue10.i -/tests/bugs/issue-113/Issue113 -/tests/bugs/issue-113/Issue113.hs -/tests/bugs/issue-115/Issue115 -/tests/bugs/issue-115/Issue115.hs -/tests/bugs/issue-116/Issue116 -/tests/bugs/issue-116/Issue116.hs -/tests/bugs/issue-15/Issue15 -/tests/bugs/issue-15/Issue15.hs -/tests/bugs/issue-16/Issue16 -/tests/bugs/issue-16/Issue16.hs -/tests/bugs/issue-19/Issue19 -/tests/bugs/issue-19/Issue19.hs -/tests/bugs/issue-20/Issue20.i -/tests/bugs/issue-22/Issue22 -/tests/bugs/issue-22/Issue22.hs -/tests/bugs/issue-23/Issue23 -/tests/bugs/issue-23/Issue23.hs -/tests/bugs/issue-29/Issue29.hs -/tests/bugs/issue-29/Issue29.i -/tests/bugs/issue-30/Issue30 -/tests/bugs/issue-30/Issue30Aux1.hs -/tests/bugs/issue-30/Issue30Aux2.hs -/tests/bugs/issue-30/Issue30.hs -/tests/bugs/issue-31/Issue31 -/tests/bugs/issue-31/Issue31.hs -/tests/bugs/issue-32/Issue32 -/tests/bugs/issue-32/Issue32.hs -/tests/bugs/issue-36/Issue36 -/tests/bugs/issue-36/Issue36.hs -/tests/bugs/issue-37/Issue37 -/tests/bugs/issue-37/Issue37.hs -/tests/bugs/issue-38/Issue38 -/tests/bugs/issue-38/Issue38.hs -/tests/bugs/issue-43/Issue43 -/tests/bugs/issue-43/Issue43.hs -/tests/bugs/issue-44/Issue44 -/tests/bugs/issue-44/Issue44.hs -/tests/bugs/issue-45/Issue45 -/tests/bugs/issue-45/Issue45.hs -/tests/bugs/issue-46/Issue46 -/tests/bugs/issue-46/Issue46.hs -/tests/bugs/issue-47/Issue47 -/tests/bugs/issue-47/Issue47.hs -/tests/bugs/issue-51/Issue51 -/tests/bugs/issue-51/Issue51_GNU -/tests/bugs/issue-51/Issue51_GNU.hs -/tests/bugs/issue-51/Issue51.hs -/tests/bugs/issue-51/Issue51_nonGNU -/tests/bugs/issue-51/Issue51_nonGNU.hs -/tests/bugs/issue-54/Issue54 -/tests/bugs/issue-54/Issue54.hs -/tests/bugs/issue-60/Issue60 -/tests/bugs/issue-60/Issue60.hs -/tests/bugs/issue-60/Issue60.i -/tests/bugs/issue-62/Issue62 -/tests/bugs/issue-62/Issue62.hs -/tests/bugs/issue-65/Issue65 -/tests/bugs/issue-65/Issue65.hs -/tests/bugs/issue-69/Issue69 -/tests/bugs/issue-69/Issue69.hs -/tests/bugs/issue-70/Issue70.hs -/tests/bugs/issue-73/Issue73 -/tests/bugs/issue-73/Issue73.hs -/tests/bugs/issue-75/Issue75 -/tests/bugs/issue-75/Issue75.hs -/tests/bugs/issue-79/Issue79 -/tests/bugs/issue-79/Issue79.hs -/tests/bugs/issue-7/Issue7.hs -/tests/bugs/issue-7/Issue7.i -/tests/bugs/issue-80/Issue80 -/tests/bugs/issue-80/Issue80.hs -/tests/bugs/issue-82/Issue82 -/tests/bugs/issue-82/Issue82.hs -/tests/bugs/issue-83/Issue83 -/tests/bugs/issue-83/Issue83.hs -/tests/bugs/issue-93/Issue93 -/tests/bugs/issue-93/Issue93.hs -/tests/bugs/issue-95/Issue95 -/tests/bugs/issue-95/Issue95.hs -/tests/bugs/issue-96/Issue103 -/tests/bugs/issue-96/Issue96 -/tests/bugs/issue-96/Issue96.hs -/tests/bugs/issue-97/Issue97 -/tests/bugs/issue-97/Issue97A.hs -/tests/bugs/issue-97/Issue97.hs -/tests/bugs/issue-98/Issue98 -/tests/bugs/issue-98/Issue98.hs -/tests/bugs/issue-9/Issue9 -/tests/bugs/issue-9/Issue9.hs -/tests/system/calls/Calls.hs -/tests/system/cpp/Cpp.hs -/tests/system/enums/enums -/tests/system/enums/Enums.hs -/tests/system/marsh/marsh -/tests/system/marsh/Marsh.hs -/tests/system/pointer/pointer -/tests/system/pointer/Pointer.hs -/tests/system/simple/simple -/tests/system/simple/Simple.hs -/tests/system/sizeof/sizeof -/tests/system/sizeof/Sizeof.hs -/tests/system/structs/structs -/tests/system/structs/Structs.hs -/tests/bugs/issue-20/Issue20 -/tests/bugs/issue-20/Issue20.hs -/tests/bugs/issue-25/Issue25 -/tests/bugs/issue-25/Issue25.hs -/tests/bugs/issue-48/Issue48 -/tests/bugs/issue-48/Issue48.hs -/tests/bugs/issue-123/Issue123 -/tests/bugs/issue-123/Issue123.hs -/tests/bugs/issue-102/issue-102.txt -/tests/bugs/issue-117/Issue117 -/tests/bugs/issue-117/Issue117.hs -/tests/bugs/issue-117/Issue117.chs.c -/tests/bugs/issue-127/Issue127 -/tests/bugs/issue-127/Issue127.hs -/tests/bugs/issue-128/Issue128 -/tests/bugs/issue-128/Issue128.chs.c -/tests/bugs/issue-128/Issue128.hs -/tests/bugs/issue-131/Issue131.chs.c -/tests/bugs/issue-131/Issue131.hs -/tests/bugs/issue-131/Issue131 -/tests/bugs/issue-130/Issue130 -/tests/bugs/issue-130/Issue130.hs -/tests/bugs/issue-133/Issue133 -/tests/bugs/issue-133/Issue133.hs -/tests/bugs/issue-136/Issue136.hs -/tests/bugs/issue-136/Issue136 -/tests/bugs/issue-134/Issue134 -/tests/bugs/issue-134/Issue134.hs -/tests/bugs/issue-151/Issue151.hs -/tests/bugs/issue-149/Issue149 -/tests/bugs/issue-149/Issue149.hs -/tests/bugs/issue-141/Issue141A.hs -/tests/bugs/issue-141/Issue141B.hs -/tests/bugs/issue-152/Issue152 -/tests/bugs/issue-140/Issue140 -/tests/bugs/issue-140/Issue140.hs -/tests/bugs/issue-152/Issue152.hs -/tests/bugs/issue-155/Issue155 -/tests/bugs/issue-155/Issue155.hs -/tests/bugs/issue-152/Issue152.hs -/tests/bugs/issue-155/Types.hs +/tests/bugs +/tests/system From c0e595752cd67bf4700cc655e0db68a7a34a6003 Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 18:04:02 +0300 Subject: [PATCH 08/26] fixing unused import Data.Monoid --- tests/regression-suite.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/regression-suite.hs b/tests/regression-suite.hs index 5844e07..88e6fc7 100644 --- a/tests/regression-suite.hs +++ b/tests/regression-suite.hs @@ -9,7 +9,6 @@ import Shelly hiding (FilePath) import Data.Char import Data.List (nub) import Data.Text (Text) -import Data.Monoid import qualified Data.Text as T import Data.Yaml default (T.Text) From dfe5fdcfb53aff151054a096ae00ce4f9fff62df Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 18:06:26 +0300 Subject: [PATCH 09/26] fixing unused local-binds `buildTools` --- tests/regression-suite.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/regression-suite.hs b/tests/regression-suite.hs index 88e6fc7..b184b3b 100644 --- a/tests/regression-suite.hs +++ b/tests/regression-suite.hs @@ -92,7 +92,7 @@ main = shelly $ do readTests "tests/regression-suite.yaml" let ppas = nub $ concatMap aptPPA tests pkgs = nub $ concatMap aptPackages tests - buildTools = nub $ concatMap cabalBuildTools tests + _ {- buildTools-} = nub $ concatMap cabalBuildTools tests specials = concatMap specialSetup tests extraPaths = concatMap extraPath tests extraSOPaths = concatMap extraSOPath tests From 8b87240cc5bd84ceaab79caa060885c9740e0671 Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 18:23:42 +0300 Subject: [PATCH 10/26] contains warnings --- c2hs.cabal | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/c2hs.cabal b/c2hs.cabal index 9fbda57..a0baab9 100644 --- a/c2hs.cabal +++ b/c2hs.cabal @@ -158,7 +158,7 @@ Executable c2hs default-extensions: ForeignFunctionInterface c-sources: src/C2HS/config.c - ghc-options: -Wall + ghc-options: -Wall -Wno-incomplete-patterns default-language: Haskell2010 Test-Suite test-bugs @@ -175,7 +175,7 @@ Test-Suite test-bugs text, transformers other-modules: Paths_c2hs - ghc-options: -Wall + ghc-options: -Wall -Wno-incomplete-patterns -Wno-unused-top-binds -Wno-unused-do-bind -Wno-name-shadowing -Wno-unused-imports default-language: Haskell2010 Test-Suite test-system @@ -191,7 +191,7 @@ Test-Suite test-system text, transformers other-modules: Paths_c2hs - ghc-options: -Wall + ghc-options: -Wall -Wno-incomplete-patterns -Wno-unused-top-binds -Wno-unused-do-bind -Wno-name-shadowing -Wno-unused-imports default-language: Haskell2010 Flag regression @@ -209,5 +209,5 @@ Executable regression-suite yaml >= 0.8 else buildable: False - ghc-options: -Wall + ghc-options: -Wall -Wno-deprecations default-language: Haskell2010 From b1584a27fb37a1f726a1cda84993555c53d8f2e8 Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 18:28:13 +0300 Subject: [PATCH 11/26] fixed unused imports and missing home modules --- c2hs.cabal | 6 ++---- tests/test-bugs.hs | 2 -- tests/test-system.hs | 2 -- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/c2hs.cabal b/c2hs.cabal index a0baab9..daf0094 100644 --- a/c2hs.cabal +++ b/c2hs.cabal @@ -174,8 +174,7 @@ Test-Suite test-bugs shelly >= 1.0, text, transformers - other-modules: Paths_c2hs - ghc-options: -Wall -Wno-incomplete-patterns -Wno-unused-top-binds -Wno-unused-do-bind -Wno-name-shadowing -Wno-unused-imports + ghc-options: -Wall -Wno-incomplete-patterns -Wno-unused-top-binds -Wno-unused-do-bind -Wno-name-shadowing default-language: Haskell2010 Test-Suite test-system @@ -190,8 +189,7 @@ Test-Suite test-system shelly >= 1.0, text, transformers - other-modules: Paths_c2hs - ghc-options: -Wall -Wno-incomplete-patterns -Wno-unused-top-binds -Wno-unused-do-bind -Wno-name-shadowing -Wno-unused-imports + ghc-options: -Wall -Wno-incomplete-patterns -Wno-unused-top-binds -Wno-unused-do-bind -Wno-name-shadowing default-language: Haskell2010 Flag regression diff --git a/tests/test-bugs.hs b/tests/test-bugs.hs index 7850340..f0a6f17 100644 --- a/tests/test-bugs.hs +++ b/tests/test-bugs.hs @@ -12,9 +12,7 @@ import Control.Monad.IO.Class import Shelly import Data.List (sort) import Data.Text (Text) -import Data.Monoid import qualified Data.Text as T -import Paths_c2hs default (T.Text) main :: IO () diff --git a/tests/test-system.hs b/tests/test-system.hs index bc2750d..cf428ee 100644 --- a/tests/test-system.hs +++ b/tests/test-system.hs @@ -10,10 +10,8 @@ import qualified Shelly as Sh import Prelude hiding (FilePath) import Control.Monad (forM_) import Data.Text (Text) -import Data.Monoid import System.Info (os) import qualified Data.Text as T -import Paths_c2hs default (T.Text) main :: IO () From 5a3ceeda3779b36535c90e224480a7504a1f1e1c Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 18:34:17 +0300 Subject: [PATCH 12/26] fixing unused top binds --- c2hs.cabal | 4 ++-- tests/test-bugs.hs | 8 ++++---- tests/test-system.hs | 18 +++++++++--------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/c2hs.cabal b/c2hs.cabal index daf0094..16acff7 100644 --- a/c2hs.cabal +++ b/c2hs.cabal @@ -174,7 +174,7 @@ Test-Suite test-bugs shelly >= 1.0, text, transformers - ghc-options: -Wall -Wno-incomplete-patterns -Wno-unused-top-binds -Wno-unused-do-bind -Wno-name-shadowing + ghc-options: -Wall -Wno-incomplete-patterns -Wno-unused-do-bind -Wno-name-shadowing default-language: Haskell2010 Test-Suite test-system @@ -189,7 +189,7 @@ Test-Suite test-system shelly >= 1.0, text, transformers - ghc-options: -Wall -Wno-incomplete-patterns -Wno-unused-top-binds -Wno-unused-do-bind -Wno-name-shadowing + ghc-options: -Wall -Wno-incomplete-patterns -Wno-unused-do-bind -Wno-name-shadowing default-language: Haskell2010 Flag regression diff --git a/tests/test-bugs.hs b/tests/test-bugs.hs index f0a6f17..160a247 100644 --- a/tests/test-bugs.hs +++ b/tests/test-bugs.hs @@ -208,8 +208,8 @@ issue128 = c2hsShelly $ chdir "tests/bugs/issue-128" $ do issue127 :: Assertion issue127 = expect_issue 127 ["True", "False"] -issue125 :: Assertion -issue125 = expect_issue 125 ["NYI"] +-- issue125 :: Assertion +-- issue125 = expect_issue 125 ["NYI"] issue123 :: Assertion issue123 = expect_issue 123 ["[8,43,94]", "[7,42,93]", "[2,4,8]", "[3,9,27]"] @@ -515,5 +515,5 @@ build_issue_fails_with strict cbuild n c2hsargs = c2hsShelly $ do build_issue_fails :: Int -> Assertion build_issue_fails n = build_issue_fails_with True True n [] -hs_only_build_issue_fails :: Int -> Assertion -hs_only_build_issue_fails n = build_issue_fails_with True False n [] +-- hs_only_build_issue_fails :: Int -> Assertion +-- hs_only_build_issue_fails n = build_issue_fails_with True False n [] diff --git a/tests/test-system.hs b/tests/test-system.hs index cf428ee..684de9b 100644 --- a/tests/test-system.hs +++ b/tests/test-system.hs @@ -99,15 +99,15 @@ test_simple = run_test_expect "tests/system/simple" ["I am the mighty foo!"] -- Issue #10 -test_sizeof :: Assertion -test_sizeof = run_test_expect "tests/system/sizeof" - [("c2hs", ["sizeof.h", "Sizeof.chs"]), - ("ghc", ["-c", "-o", "Sizeof.o", "Sizeof.hs"]), - (cc, ["-o", "sizeof_c.o", "-c", "sizeof.c"]), - ("ghc", ["-o", "sizeof", "sizeof_c.o", "Sizeof.o"])] - "./sizeof" - ["16 & 64 & 4 & 10", - "8 & 8 & 4 & 4"] +-- test_sizeof :: Assertion +-- test_sizeof = run_test_expect "tests/system/sizeof" +-- [("c2hs", ["sizeof.h", "Sizeof.chs"]), +-- ("ghc", ["-c", "-o", "Sizeof.o", "Sizeof.hs"]), +-- (cc, ["-o", "sizeof_c.o", "-c", "sizeof.c"]), +-- ("ghc", ["-o", "sizeof", "sizeof_c.o", "Sizeof.o"])] +-- "./sizeof" +-- ["16 & 64 & 4 & 10", +-- "8 & 8 & 4 & 4"] test_structs :: Assertion test_structs = run_test_expect "tests/system/structs" From 7aa139dab4c5ac1aa639b9a01cf97e1bd12c272e Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 18:45:12 +0300 Subject: [PATCH 13/26] fixing unused do binds --- c2hs.cabal | 4 +-- tests/test-bugs.hs | 76 ++++++++++++++++++++++---------------------- tests/test-system.hs | 2 +- 3 files changed, 41 insertions(+), 41 deletions(-) diff --git a/c2hs.cabal b/c2hs.cabal index 16acff7..8a049e3 100644 --- a/c2hs.cabal +++ b/c2hs.cabal @@ -174,7 +174,7 @@ Test-Suite test-bugs shelly >= 1.0, text, transformers - ghc-options: -Wall -Wno-incomplete-patterns -Wno-unused-do-bind -Wno-name-shadowing + ghc-options: -Wall -Wno-incomplete-patterns -Wno-name-shadowing default-language: Haskell2010 Test-Suite test-system @@ -189,7 +189,7 @@ Test-Suite test-system shelly >= 1.0, text, transformers - ghc-options: -Wall -Wno-incomplete-patterns -Wno-unused-do-bind -Wno-name-shadowing + ghc-options: -Wall -Wno-incomplete-patterns -Wno-name-shadowing default-language: Haskell2010 Flag regression diff --git a/tests/test-bugs.hs b/tests/test-bugs.hs index 160a247..f55f9c1 100644 --- a/tests/test-bugs.hs +++ b/tests/test-bugs.hs @@ -106,9 +106,9 @@ call_capital :: Assertion call_capital = c2hsShelly $ chdir "tests/bugs/call_capital" $ do mapM_ rm_f ["Capital.hs", "Capital.chs.h", "Capital.chi", "Capital_c.o", "Capital"] - cmd "c2hs" "-d" "genbind" "Capital.chs" - cmd cc "-c" "-o" "Capital_c.o" "Capital.c" - cmd "ghc" "--make" "-cpp" "Capital_c.o" "Capital.hs" + _ <- cmd "c2hs" "-d" "genbind" "Capital.chs" + _ <- cmd cc "-c" "-o" "Capital_c.o" "Capital.c" + _ <- cmd "ghc" "--make" "-cpp" "Capital_c.o" "Capital.hs" res <- absPath "./Capital" >>= cmd let expected = ["upper C();", "lower c();", "upper C();"] liftIO $ assertBool "" (T.lines res == expected) @@ -122,7 +122,7 @@ issue192 = hs_only_build_issue 192 issue180 :: Assertion issue180 = c2hsShelly $ chdir "tests/bugs/issue-180" $ do mapM_ rm_f ["Issue180.chs.h"] - errExit False $ do + _ <- errExit False $ do run "c2hs" [toTextIgnore "Issue180.chs"] code <- lastExitCode liftIO $ assertEqual "error code" 1 code @@ -134,9 +134,9 @@ issue155 :: Assertion issue155 = c2hsShelly $ chdir "tests/bugs/issue-155" $ do mapM_ rm_f ["Issue155.hs", "Issue155.chs.h", "Issue155.chs.c", "Issue155.chi", "Issue155.chs.o", "Issue155", "Types.chi", "Types.chs.h", "Types.hs"] - cmd "c2hs" "Types.chs" - cmd "c2hs" "Issue155.chs" - cmd "ghc" "--make" "Issue155.hs" + _ <- cmd "c2hs" "Types.chs" + _ <- cmd "c2hs" "Issue155.chs" + _ <- cmd "ghc" "--make" "Issue155.hs" res <- absPath "./Issue155" >>= cmd let expected = ["OK"] liftIO $ assertBool "" (T.lines res == expected) @@ -156,7 +156,7 @@ issue141 = c2hsShelly $ chdir "tests/bugs/issue-141" $ do "Issue141B.hs", "Issue141B.chs.h", "Issue141B.chi", "Issue141C.hs", "Issue141C.chs.h", "Issue141C.chi"] codes <- forM ["A", "B", "C"] $ \suff -> do - errExit False $ cmd "c2hs" $ "Issue141" <> suff <> ".chs" + _ <- errExit False $ cmd "c2hs" $ "Issue141" <> suff <> ".chs" lastExitCode liftIO $ assertBool "" (all (/= 0) codes) @@ -176,10 +176,10 @@ issue131 :: Assertion issue131 = c2hsShelly $ chdir "tests/bugs/issue-131" $ do mapM_ rm_f ["Issue131.hs", "Issue131.chs.h", "Issue131.chs.c", "Issue131.chi", "issue131_c.o", "Issue131.chs.o", "Issue131"] - cmd "c2hs" "Issue131.chs" - cmd cc "-c" "-o" "issue131_c.o" "issue131.c" - cmd cc "-c" "Issue131.chs.c" - cmd "ghc" "--make" "issue131_c.o" "Issue131.chs.o" "Issue131.hs" + _ <- cmd "c2hs" "Issue131.chs" + _ <- cmd cc "-c" "-o" "issue131_c.o" "issue131.c" + _ <- cmd cc "-c" "Issue131.chs.c" + _ <- cmd "ghc" "--make" "issue131_c.o" "Issue131.chs.o" "Issue131.hs" res <- absPath "./Issue131" >>= cmd let expected = ["5", "3", "True", "False"] @@ -192,10 +192,10 @@ issue128 :: Assertion issue128 = c2hsShelly $ chdir "tests/bugs/issue-128" $ do mapM_ rm_f ["Issue128.hs", "Issue128.chs.h", "Issue128.chs.c", "Issue128.chi", "issue128_c.o", "Issue128.chs.o", "Issue128"] - cmd "c2hs" "Issue128.chs" - cmd cc "-c" "-o" "issue128_c.o" "issue128.c" - cmd cc "-c" "Issue128.chs.c" - cmd "ghc" "--make" "issue128_c.o" "Issue128.chs.o" "Issue128.hs" + _ <- cmd "c2hs" "Issue128.chs" + _ <- cmd cc "-c" "-o" "issue128_c.o" "issue128.c" + _ <- cmd cc "-c" "Issue128.chs.c" + _ <- cmd "ghc" "--make" "issue128_c.o" "Issue128.chs.o" "Issue128.hs" res <- absPath "./Issue128" >>= cmd let expected = ["5", "3", "True", "False", @@ -218,10 +218,10 @@ issue117 :: Assertion issue117 = c2hsShelly $ chdir "tests/bugs/issue-117" $ do mapM_ rm_f ["Issue117.hs", "Issue117.chs.h", "Issue117.chs.c", "Issue117.chi", "issue117_c.o", "Issue117.chs.o", "Issue117"] - cmd "c2hs" "Issue117.chs" - cmd cc "-c" "-o" "issue117_c.o" "issue117.c" - cmd cc "-c" "Issue117.chs.c" - cmd "ghc" "--make" "issue117_c.o" "Issue117.chs.o" "Issue117.hs" + _ <- cmd "c2hs" "Issue117.chs" + _ <- cmd cc "-c" "-o" "issue117_c.o" "issue117.c" + _ <- cmd cc "-c" "Issue117.chs.c" + _ <- cmd "ghc" "--make" "issue117_c.o" "Issue117.chs.o" "Issue117.hs" res <- absPath "./Issue117" >>= cmd let expected = ["5"] liftIO $ assertBool "" (T.lines res == expected) @@ -243,10 +243,10 @@ issue103 = c2hsShelly $ chdir "tests/bugs/issue-103" $ do mapM_ rm_f ["Issue103.hs", "Issue103.chs.h", "Issue103.chi", "Issue103A.hs", "Issue103A.chs.h", "Issue103A.chi", "issue103_c.o", "Issue103"] - cmd "c2hs" "Issue103A.chs" - cmd "c2hs" "Issue103.chs" - cmd cc "-c" "-o" "issue103_c.o" "issue103.c" - cmd "ghc" "--make" "issue103_c.o" "Issue103A.hs" "Issue103.hs" + _ <- cmd "c2hs" "Issue103A.chs" + _ <- cmd "c2hs" "Issue103.chs" + _ <- cmd cc "-c" "-o" "issue103_c.o" "issue103.c" + _ <- cmd "ghc" "--make" "issue103_c.o" "Issue103A.hs" "Issue103.hs" res <- absPath "./Issue103" >>= cmd let expected = ["1", "2", "3"] liftIO $ assertBool "" (T.lines res == expected) @@ -265,10 +265,10 @@ issue97 = c2hsShelly $ chdir "tests/bugs/issue-97" $ do mapM_ rm_f ["Issue97.hs", "Issue97.chs.h", "Issue97.chi", "Issue97A.hs", "Issue97A.chs.h", "Issue97A.chi", "issue97_c.o", "Issue97"] - cmd "c2hs" "Issue97A.chs" - cmd "c2hs" "Issue97.chs" - cmd cc "-c" "-o" "issue97_c.o" "issue97.c" - cmd "ghc" "--make" "issue97_c.o" "Issue97A.hs" "Issue97.hs" + _ <- cmd "c2hs" "Issue97A.chs" + _ <- cmd "c2hs" "Issue97.chs" + _ <- cmd cc "-c" "-o" "issue97_c.o" "issue97.c" + _ <- cmd "ghc" "--make" "issue97_c.o" "Issue97A.hs" "Issue97.hs" res <- absPath "./Issue97" >>= cmd let expected = ["42"] liftIO $ assertBool "" (T.lines res == expected) @@ -380,16 +380,16 @@ issue30 = c2hsShelly $ chdir "tests/bugs/issue-30" $ do "Issue30Aux1.hs", "Issue30Aux1.chs.h", "test 1/Issue30Aux1.chi", "Issue30Aux2.hs", "Issue30Aux2.chs.h", "test 2/Issue30Aux2.chi", "issue30_c.o", "issue30aux1_c.o", "issue30aux2_c.o", "Issue30"] - cmd "c2hs" "Issue30Aux1.chs" + _ <- cmd "c2hs" "Issue30Aux1.chs" mv "Issue30Aux1.chi" "test 1" - cmd "c2hs" "Issue30Aux2.chs" + _ <- cmd "c2hs" "Issue30Aux2.chs" mv "Issue30Aux2.chi" "test 2" let sp = T.pack $ "test 1" ++ [searchPathSeparator] ++ "test 2" - cmd "c2hs" "--include" sp "Issue30.chs" - cmd cc "-c" "-o" "issue30_c.o" "issue30.c" - cmd cc "-c" "-o" "issue30aux1_c.o" "issue30aux1.c" - cmd cc "-c" "-o" "issue30aux2_c.o" "issue30aux2.c" - cmd "ghc" "--make" "issue30_c.o" "issue30aux1_c.o" "issue30aux2_c.o" + _ <- cmd "c2hs" "--include" sp "Issue30.chs" + _ <- cmd cc "-c" "-o" "issue30_c.o" "issue30.c" + _ <- cmd cc "-c" "-o" "issue30aux1_c.o" "issue30aux1.c" + _ <- cmd cc "-c" "-o" "issue30aux2_c.o" "issue30aux2.c" + _ <- cmd "ghc" "--make" "issue30_c.o" "issue30aux1_c.o" "issue30aux2_c.o" "Issue30Aux1.hs" "Issue30Aux2.hs" "Issue30.hs" res <- absPath "./Issue30" >>= cmd let expected = ["3", "2", "4"] @@ -397,7 +397,7 @@ issue30 = c2hsShelly $ chdir "tests/bugs/issue-30" $ do issue29 :: Assertion issue29 = c2hsShelly $ do - errExit False $ do + _ <- errExit False $ do cd "tests/bugs/issue-29" mapM_ rm_f ["Issue29.hs", "Issue29.chs.h", "Issue29.chi"] run "c2hs" [toTextIgnore "Issue29.chs"] @@ -436,7 +436,7 @@ issue09 = expect_issue 9 $ archdep ++ ["(32,64)", "64", "OK"] issue07 :: Assertion issue07 = c2hsShelly $ do - errExit False $ do + _ <- errExit False $ do cd "tests/bugs/issue-7" mapM_ rm_f ["Issue7.hs", "Issue7.chs.h", "Issue7.chi"] setenv "LANG" "zh_CN.utf8" @@ -454,7 +454,7 @@ do_issue_build strict cbuild n suff ext c2hsargs = in do cd wdir mapM_ rm_f [uc <.> "hs", uc <.> "chs.h", uc <.> "chi", lcc <.> "o", uc] - run "c2hs" $ c2hsargs ++ [toTextIgnore $ uc <.> "chs"] + _ <- run "c2hs" $ c2hsargs ++ [toTextIgnore $ uc <.> "chs"] code <- lastExitCode when (code == 0) $ do when cbuild $ cmd cc "-c" "-o" (lcc <.> "o") (lc <.> "c") diff --git a/tests/test-system.hs b/tests/test-system.hs index 684de9b..c30238d 100644 --- a/tests/test-system.hs +++ b/tests/test-system.hs @@ -45,7 +45,7 @@ tests = run_test_exit_code :: Sh.FilePath -> [(Sh.FilePath, [Text])] -> Assertion run_test_exit_code dir cmds = c2hsShelly $ chdir dir $ do forM_ (init cmds) $ \(c, as) -> run c as - errExit False $ run (fst $ last cmds) (snd $ last cmds) + _ <- errExit False $ run (fst $ last cmds) (snd $ last cmds) code <- lastExitCode liftIO $ assertBool "" (code == 0) From e01d18bede9fbdecbcb612ef71d1ace8a15151b3 Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 18:50:39 +0300 Subject: [PATCH 14/26] fixing name shadowing --- c2hs.cabal | 4 ++-- tests/test-bugs.hs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/c2hs.cabal b/c2hs.cabal index 8a049e3..7de3c52 100644 --- a/c2hs.cabal +++ b/c2hs.cabal @@ -174,7 +174,7 @@ Test-Suite test-bugs shelly >= 1.0, text, transformers - ghc-options: -Wall -Wno-incomplete-patterns -Wno-name-shadowing + ghc-options: -Wall -Wno-incomplete-patterns default-language: Haskell2010 Test-Suite test-system @@ -189,7 +189,7 @@ Test-Suite test-system shelly >= 1.0, text, transformers - ghc-options: -Wall -Wno-incomplete-patterns -Wno-name-shadowing + ghc-options: -Wall -Wno-incomplete-patterns default-language: Haskell2010 Flag regression diff --git a/tests/test-bugs.hs b/tests/test-bugs.hs index f55f9c1..155416e 100644 --- a/tests/test-bugs.hs +++ b/tests/test-bugs.hs @@ -455,11 +455,11 @@ do_issue_build strict cbuild n suff ext c2hsargs = cd wdir mapM_ rm_f [uc <.> "hs", uc <.> "chs.h", uc <.> "chi", lcc <.> "o", uc] _ <- run "c2hs" $ c2hsargs ++ [toTextIgnore $ uc <.> "chs"] - code <- lastExitCode - when (code == 0) $ do + code1 <- lastExitCode + when (code1 == 0) $ do when cbuild $ cmd cc "-c" "-o" (lcc <.> "o") (lc <.> "c") - code <- lastExitCode - when (code == 0) $ case (strict, cbuild) of + code2 <- lastExitCode + when (code2 == 0) $ case (strict, cbuild) of (True, True) -> cmd "ghc" "-Wall" "-Werror" "--make" (lcc <.> "o") (uc <.> "hs") (False, True) -> From 3c4a951a951113a0fec5b705930f99f338ca73ba Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 18:57:17 +0300 Subject: [PATCH 15/26] nicer formating --- c2hs.cabal | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/c2hs.cabal b/c2hs.cabal index 7de3c52..3c1bd4e 100644 --- a/c2hs.cabal +++ b/c2hs.cabal @@ -156,10 +156,10 @@ Executable c2hs System.CIO Text.Lexers - default-extensions: ForeignFunctionInterface - c-sources: src/C2HS/config.c - ghc-options: -Wall -Wno-incomplete-patterns - default-language: Haskell2010 + default-extensions: ForeignFunctionInterface + c-sources: src/C2HS/config.c + ghc-options: -Wall -Wno-incomplete-patterns + default-language: Haskell2010 Test-Suite test-bugs type: exitcode-stdio-1.0 From fbba42275aaf17ec48f2c4b6ab04fc363a271c9a Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 19:25:27 +0300 Subject: [PATCH 16/26] reverted back to cabal 1.10 --- c2hs.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c2hs.cabal b/c2hs.cabal index 3c1bd4e..f49e7d2 100644 --- a/c2hs.cabal +++ b/c2hs.cabal @@ -19,7 +19,7 @@ Description: C->Haskell assists in the development of Haskell bindings to C correct Haskell types. Category: Development Tested-With: GHC==6.12.3, GHC==7.0.4, GHC==7.6.1, GHC==7.6.3, GHC==7.8.3, GHC==7.10.1 -Cabal-Version: >= 2.0 +Cabal-Version: >= 1.10 Build-Type: Simple --TODO: Cabal should allow 'Data-Files' in the executable stanza From de80dc5b98747a47db8f94214b73930457855021 Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 19:39:56 +0300 Subject: [PATCH 17/26] using fno-warn --- c2hs.cabal | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/c2hs.cabal b/c2hs.cabal index f49e7d2..8d613e2 100644 --- a/c2hs.cabal +++ b/c2hs.cabal @@ -174,7 +174,7 @@ Test-Suite test-bugs shelly >= 1.0, text, transformers - ghc-options: -Wall -Wno-incomplete-patterns + ghc-options: -Wall -fno-warn-incomplete-patterns default-language: Haskell2010 Test-Suite test-system @@ -189,7 +189,7 @@ Test-Suite test-system shelly >= 1.0, text, transformers - ghc-options: -Wall -Wno-incomplete-patterns + ghc-options: -Wall -fno-warn-incomplete-patterns default-language: Haskell2010 Flag regression @@ -207,5 +207,5 @@ Executable regression-suite yaml >= 0.8 else buildable: False - ghc-options: -Wall -Wno-deprecations + ghc-options: -Wall -fno-warn-deprecations default-language: Haskell2010 From d0ef28d6a45bc0f3b82ba8a034a669f7daa2bb4c Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 19:58:30 +0300 Subject: [PATCH 18/26] Added rergession test suite files to gitignore. --- .gitignore | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.gitignore b/.gitignore index e708ef3..aa581cd 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,16 @@ cabal.project.local~ /.shelly/*.txt /tests/bugs /tests/system +abcBridge* +alsa-mixer* +cuda* +cufft* +gnome-keyring* +gnuidn* +haskell-mpi* +hnetcdf* +hpuz* +hsndfile* +hsshellscript* +igraph* +libssh2* From f91bc4bcddee3c11b72b29bde23b4891092a3547 Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 19:59:16 +0300 Subject: [PATCH 19/26] reverted warnings to -fno-warn style --- c2hs.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c2hs.cabal b/c2hs.cabal index 8d613e2..55c9982 100644 --- a/c2hs.cabal +++ b/c2hs.cabal @@ -158,7 +158,7 @@ Executable c2hs default-extensions: ForeignFunctionInterface c-sources: src/C2HS/config.c - ghc-options: -Wall -Wno-incomplete-patterns + ghc-options: -Wall -fno-warn-incomplete-patterns default-language: Haskell2010 Test-Suite test-bugs From 6a54eb4d621aca59f3a8fdcfe44c316e30f7db4a Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 20:23:10 +0300 Subject: [PATCH 20/26] bumped cabal-2.4 and use a simpler travis file with build matrix similar to the hackage one. --- .travis.yml | 45 ++++++++++++++++++--------------------------- c2hs.cabal | 4 ++-- 2 files changed, 20 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4705184..b280773 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,30 +1,21 @@ -env: - global: - - AWS_ACCESS_KEY_ID=AKIAIKUEH2ETWTBS2CKQ - - secure: "Jzawnhgk3dX2INzbZIlnHCH+aKWqy96B9T1hzBh/Fqp4whglaZDO0mTLHQnhypqAt1rXO2o3yBNcKgGOcgfUuE71uBCzzaXieB0p8BhYn7cwYeANbuKNOGrsP6oDutS5F57FNWwgRp+2oanpgJNOs/6wvfElA7W6ibN8tZiLQrw=" - matrix: - - GHCVER=7.10.3 - +sudo: false +language: haskell +cabal: "2.4" +ghc: + - "7.0" + - "7.4" + - "7.6" + - "7.8" + - "7.10" + - "8.0" + - "8.2" + - "8.4" + - "8.6" before_install: - - travis_retry sudo add-apt-repository -y ppa:hvr/ghc - - travis_retry sudo apt-get update - - travis_retry sudo apt-get install libnetcdf-dev libgsl0-dev liblapack-dev - - travis_retry sudo apt-get install cabal-install-1.24 ghc-$GHCVER-prof ghc-$GHCVER-dyn happy - - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/1.24/bin:$PATH - -install: - - sudo apt-get update -qq - - sudo pip install awscli - - cabal update - - | - if [ $GHCVER = "head" ] || [ ${GHCVER%.*} = "7.8" ] || [ ${GHCVER%.*} = "7.10" ]; then - travis_retry sudo apt-get install happy-1.19.5 alex-3.1.7 - export PATH=/opt/alex/3.1.7/bin:/opt/happy/1.19.5/bin:$PATH - else - travis_retry sudo apt-get install happy alex - fi - - cabal install --only-dependencies --enable-tests -fregression + - sudo apt-get install libnetcdf-dev libgsl0-dev liblapack-dev script: - - cabal install && cabal configure --enable-tests -fregression && cabal build && cabal test - - ./dist/build/regression-suite/regression-suite + - cabal v2-configure --enable-tests -fregression + - cabal v2-build + - cabal v2-test + - cabal v2-run regression-suite diff --git a/c2hs.cabal b/c2hs.cabal index 55c9982..9cd414f 100644 --- a/c2hs.cabal +++ b/c2hs.cabal @@ -18,8 +18,8 @@ Description: C->Haskell assists in the development of Haskell bindings to C hsc2hs), this ensures that C functions are imported with the correct Haskell types. Category: Development -Tested-With: GHC==6.12.3, GHC==7.0.4, GHC==7.6.1, GHC==7.6.3, GHC==7.8.3, GHC==7.10.1 -Cabal-Version: >= 1.10 +Tested-With: GHC==7.0.4, GHC==7.4.2, GHC==7.6.3, GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2,GHC==8.4.4,GHC==8.6.5, +Cabal-Version: >= 2.4 Build-Type: Simple --TODO: Cabal should allow 'Data-Files' in the executable stanza From 9ab22517eafa43d378e9a331b90bb8674e419fd5 Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 20:34:43 +0300 Subject: [PATCH 21/26] removed language: haskell from travis. --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b280773..f296332 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ sudo: false -language: haskell cabal: "2.4" ghc: - "7.0" From a8ed07b062ad6287c9f032b7e1b192023da8abcc Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 20:36:25 +0300 Subject: [PATCH 22/26] removed tested with --- c2hs.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c2hs.cabal b/c2hs.cabal index 9cd414f..45f73ec 100644 --- a/c2hs.cabal +++ b/c2hs.cabal @@ -18,7 +18,7 @@ Description: C->Haskell assists in the development of Haskell bindings to C hsc2hs), this ensures that C functions are imported with the correct Haskell types. Category: Development -Tested-With: GHC==7.0.4, GHC==7.4.2, GHC==7.6.3, GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2,GHC==8.4.4,GHC==8.6.5, +Tested-With: Cabal-Version: >= 2.4 Build-Type: Simple From 1d04727248edda3ece4db32b9cebb47c326dd4b9 Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 20:47:52 +0300 Subject: [PATCH 23/26] Reverted back the travis and cabal files. Removed old ghc versions and added ghc-8.5.6 - the version I was using. --- .travis.yml | 44 +++++++++++++++++++++++++++----------------- c2hs.cabal | 4 ++-- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index f296332..b4cad6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,20 +1,30 @@ -sudo: false -cabal: "2.4" -ghc: - - "7.0" - - "7.4" - - "7.6" - - "7.8" - - "7.10" - - "8.0" - - "8.2" - - "8.4" - - "8.6" +env: + global: + - AWS_ACCESS_KEY_ID=AKIAIKUEH2ETWTBS2CKQ + - secure: "Jzawnhgk3dX2INzbZIlnHCH+aKWqy96B9T1hzBh/Fqp4whglaZDO0mTLHQnhypqAt1rXO2o3yBNcKgGOcgfUuE71uBCzzaXieB0p8BhYn7cwYeANbuKNOGrsP6oDutS5F57FNWwgRp+2oanpgJNOs/6wvfElA7W6ibN8tZiLQrw=" + matrix: + - GHCVER=7.10.3 + before_install: - - sudo apt-get install libnetcdf-dev libgsl0-dev liblapack-dev + - travis_retry sudo add-apt-repository -y ppa:hvr/ghc + - travis_retry sudo apt-get update + - travis_retry sudo apt-get install libnetcdf-dev libgsl0-dev liblapack-dev + - travis_retry sudo apt-get install cabal-install-1.24 ghc-$GHCVER-prof ghc-$GHCVER-dyn happy + - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/1.24/bin:$PATH + +install: + - sudo apt-get update -qq + - sudo pip install awscli + - cabal update + - | + if [ $GHCVER = "head" ] || [ ${GHCVER%.*} = "7.8" ] || [ ${GHCVER%.*} = "7.10" ]; then + travis_retry sudo apt-get install happy-1.19.5 alex-3.1.7 + export PATH=/opt/alex/3.1.7/bin:/opt/happy/1.19.5/bin:$PATH + else + travis_retry sudo apt-get install happy alex + fi + - cabal install --only-dependencies --enable-tests -fregression script: - - cabal v2-configure --enable-tests -fregression - - cabal v2-build - - cabal v2-test - - cabal v2-run regression-suite + - cabal install && cabal configure --enable-tests -fregression && cabal build && cabal test + - cabal run regression-suite diff --git a/c2hs.cabal b/c2hs.cabal index 45f73ec..430bd50 100644 --- a/c2hs.cabal +++ b/c2hs.cabal @@ -18,8 +18,8 @@ Description: C->Haskell assists in the development of Haskell bindings to C hsc2hs), this ensures that C functions are imported with the correct Haskell types. Category: Development -Tested-With: -Cabal-Version: >= 2.4 +Tested-With: GHC==7.0.4, GHC==7.6.1, GHC==7.6.3, GHC==7.8.3, GHC==7.10.3, GHC==8.5.6 +Cabal-Version: >= 1.10 Build-Type: Simple --TODO: Cabal should allow 'Data-Files' in the executable stanza From 7ff214b9407ce1a477f855d2b7d038d74fcc87e6 Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 20:51:40 +0300 Subject: [PATCH 24/26] Added back the todo message and fwarn-tabs. --- c2hs.cabal | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/c2hs.cabal b/c2hs.cabal index 430bd50..b2e9ef8 100644 --- a/c2hs.cabal +++ b/c2hs.cabal @@ -174,7 +174,8 @@ Test-Suite test-bugs shelly >= 1.0, text, transformers - ghc-options: -Wall -fno-warn-incomplete-patterns + --TODO: eliminate the need to suppress these warnings: + ghc-options: -Wall -fno-warn-incomplete-patterns -fwarn-tabs default-language: Haskell2010 Test-Suite test-system From e7a89ec224fa562bd30846c69144733f0e59b934 Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Tue, 6 Aug 2019 22:01:36 +0300 Subject: [PATCH 25/26] Added operator (<>) for ghc's before base-4.9.0 --- tests/regression-suite.hs | 4 ++++ tests/test-bugs.hs | 4 ++++ tests/test-system.hs | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/tests/regression-suite.hs b/tests/regression-suite.hs index b184b3b..6cca9b4 100644 --- a/tests/regression-suite.hs +++ b/tests/regression-suite.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ExtendedDefaultRules #-} {-# OPTIONS_GHC -fno-warn-type-defaults #-} @@ -9,6 +10,9 @@ import Shelly hiding (FilePath) import Data.Char import Data.List (nub) import Data.Text (Text) +#if __GLASGOW_HASKELL__ < 800 +import Data.Monoid ((<>)) +#endif import qualified Data.Text as T import Data.Yaml default (T.Text) diff --git a/tests/test-bugs.hs b/tests/test-bugs.hs index 155416e..3741d33 100644 --- a/tests/test-bugs.hs +++ b/tests/test-bugs.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ExtendedDefaultRules #-} {-# OPTIONS_GHC -fno-warn-type-defaults #-} @@ -12,6 +13,9 @@ import Control.Monad.IO.Class import Shelly import Data.List (sort) import Data.Text (Text) +#if __GLASGOW_HASKELL__ < 800 +import Data.Monoid ((<>)) +#endif import qualified Data.Text as T default (T.Text) diff --git a/tests/test-system.hs b/tests/test-system.hs index c30238d..08b38af 100644 --- a/tests/test-system.hs +++ b/tests/test-system.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ExtendedDefaultRules #-} {-# OPTIONS_GHC -fno-warn-type-defaults #-} @@ -11,6 +12,9 @@ import Prelude hiding (FilePath) import Control.Monad (forM_) import Data.Text (Text) import System.Info (os) +#if __GLASGOW_HASKELL__ < 800 +import Data.Monoid ((<>)) +#endif import qualified Data.Text as T default (T.Text) From 547c59a78cbdb79b25d500cdab96d3987ef40428 Mon Sep 17 00:00:00 2001 From: LinuxUser404 Date: Wed, 7 Aug 2019 15:07:58 +0300 Subject: [PATCH 26/26] Revert unnecessary changes. --- c2hs.cabal | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/c2hs.cabal b/c2hs.cabal index b2e9ef8..50684df 100644 --- a/c2hs.cabal +++ b/c2hs.cabal @@ -18,7 +18,7 @@ Description: C->Haskell assists in the development of Haskell bindings to C hsc2hs), this ensures that C functions are imported with the correct Haskell types. Category: Development -Tested-With: GHC==7.0.4, GHC==7.6.1, GHC==7.6.3, GHC==7.8.3, GHC==7.10.3, GHC==8.5.6 +Tested-With: GHC==6.12.3, GHC==7.0.4, GHC==7.6.1, GHC==7.6.3, GHC==7.8.3, GHC==7.10.1 Cabal-Version: >= 1.10 Build-Type: Simple @@ -156,10 +156,11 @@ Executable c2hs System.CIO Text.Lexers - default-extensions: ForeignFunctionInterface - c-sources: src/C2HS/config.c - ghc-options: -Wall -fno-warn-incomplete-patterns - default-language: Haskell2010 + default-extensions: ForeignFunctionInterface + c-sources: src/C2HS/config.c + --TODO: eliminate the need to suppress these warnings: + ghc-options: -Wall -fno-warn-incomplete-patterns -fwarn-tabs + default-language: Haskell2010 Test-Suite test-bugs type: exitcode-stdio-1.0 @@ -174,9 +175,8 @@ Test-Suite test-bugs shelly >= 1.0, text, transformers - --TODO: eliminate the need to suppress these warnings: ghc-options: -Wall -fno-warn-incomplete-patterns -fwarn-tabs - default-language: Haskell2010 + default-language: Haskell2010 Test-Suite test-system type: exitcode-stdio-1.0 @@ -190,8 +190,8 @@ Test-Suite test-system shelly >= 1.0, text, transformers - ghc-options: -Wall -fno-warn-incomplete-patterns - default-language: Haskell2010 + ghc-options: -Wall -fno-warn-incomplete-patterns -fwarn-tabs + default-language: Haskell2010 Flag regression description: Enable regression suite build. @@ -208,5 +208,5 @@ Executable regression-suite yaml >= 0.8 else buildable: False - ghc-options: -Wall -fno-warn-deprecations + ghc-options: -Wall -fno-warn-deprecations -fwarn-tabs default-language: Haskell2010