From ab99f01944d7dc740dd6f2e5a6aa19a6cdaff82d Mon Sep 17 00:00:00 2001 From: quasicomputational Date: Wed, 23 May 2018 19:24:21 +0100 Subject: [PATCH] Test and changelog note for check warning on -j. --- Cabal/Cabal.cabal | 2 ++ Cabal/ChangeLog.md | 2 ++ Cabal/tests/CheckTests.hs | 1 + .../ParserTests/regressions/ghc-option-j.cabal | 18 ++++++++++++++++++ .../ParserTests/regressions/ghc-option-j.check | 2 ++ 5 files changed, 25 insertions(+) create mode 100644 Cabal/tests/ParserTests/regressions/ghc-option-j.cabal create mode 100644 Cabal/tests/ParserTests/regressions/ghc-option-j.check diff --git a/Cabal/Cabal.cabal b/Cabal/Cabal.cabal index 930cc6f0933..fbd722cb577 100644 --- a/Cabal/Cabal.cabal +++ b/Cabal/Cabal.cabal @@ -99,6 +99,8 @@ extra-source-files: tests/ParserTests/regressions/generics-sop.cabal tests/ParserTests/regressions/generics-sop.expr tests/ParserTests/regressions/generics-sop.format + tests/ParserTests/regressions/ghc-option-j.cabal + tests/ParserTests/regressions/ghc-option-j.check tests/ParserTests/regressions/haddock-api-2.18.1-check.cabal tests/ParserTests/regressions/haddock-api-2.18.1-check.check tests/ParserTests/regressions/issue-5055.cabal diff --git a/Cabal/ChangeLog.md b/Cabal/ChangeLog.md index 783ffb6fd1d..268d5473334 100644 --- a/Cabal/ChangeLog.md +++ b/Cabal/ChangeLog.md @@ -25,6 +25,8 @@ non-library components (#5309). * Reduced warnings generated by hsc2hs and c2hs when `cxx-options` field is present in a component. + * `cabal check` now warns if `-j` is used in `ghc-options` in a Cabal + file. (#5277) ---- diff --git a/Cabal/tests/CheckTests.hs b/Cabal/tests/CheckTests.hs index a4dabd5f847..aa952a9961d 100644 --- a/Cabal/tests/CheckTests.hs +++ b/Cabal/tests/CheckTests.hs @@ -35,6 +35,7 @@ checkTests = testGroup "regressions" , checkTest "bad-glob-syntax.cabal" , checkTest "cc-options-with-optimization.cabal" , checkTest "cxx-options-with-optimization.cabal" + , checkTest "ghc-option-j.cabal" ] checkTest :: FilePath -> TestTree diff --git a/Cabal/tests/ParserTests/regressions/ghc-option-j.cabal b/Cabal/tests/ParserTests/regressions/ghc-option-j.cabal new file mode 100644 index 00000000000..fc46239fc5c --- /dev/null +++ b/Cabal/tests/ParserTests/regressions/ghc-option-j.cabal @@ -0,0 +1,18 @@ +cabal-version: 2.2 +name: ghc-option-j +version: 0 +license: BSD-2-Clause +synopsis: Test +description: Testy test. +maintainer: none +category: none + +library + exposed-modules: Foo + ghc-options: -Wall -j -Wno-all + default-language: Haskell2010 + +executable foo + main-is: Main.hs + ghc-shared-options: -Wall -j2 -Wno-all + default-language: Haskell2010 diff --git a/Cabal/tests/ParserTests/regressions/ghc-option-j.check b/Cabal/tests/ParserTests/regressions/ghc-option-j.check new file mode 100644 index 00000000000..9e5813887c4 --- /dev/null +++ b/Cabal/tests/ParserTests/regressions/ghc-option-j.check @@ -0,0 +1,2 @@ +'ghc-options: -j[N]' can make sense for specific user's setup, but it is not appropriate for a distributed package. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development. +'ghc-options: -j[N]' can make sense for specific user's setup, but it is not appropriate for a distributed package. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development.