From 3cd9b481a83e1ad7466981beedd690586678597b Mon Sep 17 00:00:00 2001 From: Gershom Bazerman Date: Thu, 13 Jan 2022 14:49:55 -0500 Subject: [PATCH 1/7] build with 9.2 --- cabal-install-solver/cabal-install-solver.cabal | 4 ++-- cabal-install/cabal-install.cabal | 6 +++--- cabal-install/tests/IntegrationTests2.hs | 6 +++--- cabal-testsuite/cabal-testsuite.cabal | 4 ++-- cabal.project | 9 +++------ 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/cabal-install-solver/cabal-install-solver.cabal b/cabal-install-solver/cabal-install-solver.cabal index bfbc10731ca..745a55fc3c7 100644 --- a/cabal-install-solver/cabal-install-solver.cabal +++ b/cabal-install-solver/cabal-install-solver.cabal @@ -103,7 +103,7 @@ library build-depends: , array >=0.4 && <0.6 - , base >=4.10 && <4.15 + , base >=4.10 && <4.17 , binary >=0.7.3 && <0.9 , bytestring >=0.10.6.0 && <0.12 , Cabal ^>=3.7 @@ -136,7 +136,7 @@ Test-Suite unit-tests UnitTests.Distribution.Solver.Modular.MessageUtils build-depends: - , base >= 4.10 && <4.15 + , base >= 4.10 && <4.17 , Cabal , cabal-install-solver , tasty >= 1.2.3 && <1.5 diff --git a/cabal-install/cabal-install.cabal b/cabal-install/cabal-install.cabal index 552e70f70f1..c6adcbcb726 100644 --- a/cabal-install/cabal-install.cabal +++ b/cabal-install/cabal-install.cabal @@ -46,7 +46,7 @@ common warnings ghc-options: -Wunused-packages common base-dep - build-depends: base >=4.10 && <4.16 + build-depends: base >=4.10 && <4.17 common cabal-dep build-depends: Cabal ^>=3.7 @@ -316,7 +316,7 @@ Test-Suite unit-tests directory, filepath, mtl, - network-uri >= 2.6.2.0 && <2.6.4.0, + network-uri >= 2.6.2.0 && <2.7, random, tar, time, @@ -403,7 +403,7 @@ test-suite long-tests filepath, hashable, mtl, - network-uri >= 2.6.2.0 && <2.6.4.0, + network-uri >= 2.6.2.0 && <2.7, random, tagged, tasty >= 1.2.3 && <1.5, diff --git a/cabal-install/tests/IntegrationTests2.hs b/cabal-install/tests/IntegrationTests2.hs index a2879a6f2be..cb7b7ddfeb1 100644 --- a/cabal-install/tests/IntegrationTests2.hs +++ b/cabal-install/tests/IntegrationTests2.hs @@ -509,7 +509,7 @@ mkTargetAllPackages = TargetAllPackages Nothing instance IsString PackageIdentifier where fromString pkgidstr = pkgid - where pkgid = fromMaybe (error $"fromString @PackageIdentifier " ++ show pkgidstr) $ simpleParse pkgidstr + where pkgid = fromMaybe (error $ "fromString @PackageIdentifier " ++ show pkgidstr) $ simpleParse pkgidstr testTargetSelectorNoCurrentPackage :: Assertion @@ -1611,8 +1611,8 @@ type PlanDetails = (ProjDetails, planProject :: FilePath -> ProjectConfig -> IO PlanDetails planProject testdir cliConfig = do - projDetails@ - (distDirLayout, + projDetails@( + distDirLayout, cabalDirLayout, projectConfig, localPackages, diff --git a/cabal-testsuite/cabal-testsuite.cabal b/cabal-testsuite/cabal-testsuite.cabal index b2a2e094459..a1ba391927f 100644 --- a/cabal-testsuite/cabal-testsuite.cabal +++ b/cabal-testsuite/cabal-testsuite.cabal @@ -26,7 +26,7 @@ common shared default-language: Haskell2010 build-depends: - , base >= 4.6 && <4.16 + , base >= 4.6 && <4.17 -- this needs to match the in-tree lib:Cabal version , Cabal == 3.7.0.0 @@ -56,7 +56,7 @@ library Test.Cabal.ScriptEnv0 build-depends: - , aeson ^>= 1.4.2.0 || ^>=1.5.0.0 + , aeson ^>= 1.4.2.0 || ^>=1.5.0.0 || ^>= 2.0.0.0 , async ^>= 2.2.1 , attoparsec ^>= 0.13.2.2 || ^>=0.14.1 , base16-bytestring ^>= 0.1.1.6 || ^>= 1.0.0.0 diff --git a/cabal.project b/cabal.project index 8fce413e7f4..98da7dc46f0 100644 --- a/cabal.project +++ b/cabal.project @@ -11,20 +11,17 @@ packages: Cabal-described packages: Cabal-tests/ packages: cabal-benchmarks/ -packages: vendor/cabal-doctest-1.0.8 +-- packages: vendor/cabal-doctest-1.0.8 optional-packages: ./vendored/*/*.cabal -- Remove after hackage-repo-tool release -allow-newer: - hackage-repo-tool:optparse-applicative +-- allow-newer: +-- hackage-repo-tool:optparse-applicative allow-newer: hackage-security:Cabal --- https://github.com/haskell-hvr/windns/pull/2 -allow-newer: windns-0.1.0.1:base - -- avoiding extra dependencies constraints: rere -rere-cfg constraints: these -assoc From ca4c68a9e621a744b6fe5626a5782ff5d7bbe5d6 Mon Sep 17 00:00:00 2001 From: Gershom Bazerman Date: Thu, 13 Jan 2022 14:53:51 -0500 Subject: [PATCH 2/7] more cleanup --- cabal.project | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cabal.project b/cabal.project index 98da7dc46f0..e6be3164751 100644 --- a/cabal.project +++ b/cabal.project @@ -11,14 +11,8 @@ packages: Cabal-described packages: Cabal-tests/ packages: cabal-benchmarks/ --- packages: vendor/cabal-doctest-1.0.8 - optional-packages: ./vendored/*/*.cabal --- Remove after hackage-repo-tool release --- allow-newer: --- hackage-repo-tool:optparse-applicative - allow-newer: hackage-security:Cabal From b5a121f3c66e6c72bc4b104bedda7caeccc86a32 Mon Sep 17 00:00:00 2001 From: Gershom Bazerman Date: Fri, 14 Jan 2022 09:54:14 -0500 Subject: [PATCH 3/7] rm vendored doctest entirely --- vendor/cabal-doctest-1.0.8/ChangeLog.md | 50 -- vendor/cabal-doctest-1.0.8/LICENSE | 30 - vendor/cabal-doctest-1.0.8/README.md | 255 -------- vendor/cabal-doctest-1.0.8/Setup.hs | 2 - .../cabal-doctest-1.0.8/cabal-doctest.cabal | 47 -- .../src/Distribution/Extra/Doctest.hs | 552 ------------------ 6 files changed, 936 deletions(-) delete mode 100644 vendor/cabal-doctest-1.0.8/ChangeLog.md delete mode 100644 vendor/cabal-doctest-1.0.8/LICENSE delete mode 100644 vendor/cabal-doctest-1.0.8/README.md delete mode 100644 vendor/cabal-doctest-1.0.8/Setup.hs delete mode 100644 vendor/cabal-doctest-1.0.8/cabal-doctest.cabal delete mode 100644 vendor/cabal-doctest-1.0.8/src/Distribution/Extra/Doctest.hs diff --git a/vendor/cabal-doctest-1.0.8/ChangeLog.md b/vendor/cabal-doctest-1.0.8/ChangeLog.md deleted file mode 100644 index d165583d753..00000000000 --- a/vendor/cabal-doctest-1.0.8/ChangeLog.md +++ /dev/null @@ -1,50 +0,0 @@ -# 1.0.8 -- 2019-10-02 - -* Pass `-package-env=-` when compiler supports it -* Amend examples to `unsetEnv "GHC_ENVIRONMENT"` - -# 1.0.7 -- 2019-08-26 - -* Make `Distribution.Extra.Doctest` `-Wall`-clean -* Support GHC-8.8, base-4.13, and Cabal-3.0 - -# 1.0.6 -- 2018-01-28 - -* Hook `haddock` build too. Fixes issue when `haddock` fails, as - `Build_doctests` isn't generated. - -# 1.0.5 -- 2018-01-26 - -* Add a hack so `Build_doctests` module is automatically added to - to `other-modules` and `autogen-modules` when compiled with Cabal-2.0. - Thanks to that, we don't get warnings because of `-Wmissing-home-modules`. - -# 1.0.4 -- 2017-12-05 - -* Add support for doctests in executables and (with `Cabal-2.0` or later) - internal libraries. Refer to the `README` for more details. - -# 1.0.3 -- 2017-11-02 - -* Add an explicit `Prelude` import to `Build_doctests` - -# 1.0.2 -- 2017-05-16 - -* Add `defaultMainAutoconfWithDoctests` and `addDoctestsUserHook`. - -* Add support for `.hsc` and other preprocessed files - ([#8](https://github.com/phadej/cabal-doctest/issues/8)) - -* Add support for `x-doctest-source-dirs` and `x-doctest-modules`. - -# 1.0.1 -- 2017-05-05 - -* Add support for `x-doctest-options` cabal-file field - -* Proper support for GHC-8.2.1 & Cabal-2.0.0.0 - -* Add support to `default-extensions` in library. - -# 1 -- 2017-01-31 - -* First version. Released on an unsuspecting world. diff --git a/vendor/cabal-doctest-1.0.8/LICENSE b/vendor/cabal-doctest-1.0.8/LICENSE deleted file mode 100644 index 96445e5484d..00000000000 --- a/vendor/cabal-doctest-1.0.8/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -Copyright (c) 2017, Oleg Grenrus - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * 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. - - * Neither the name of Oleg Grenrus nor the names of other - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT -OWNER 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. diff --git a/vendor/cabal-doctest-1.0.8/README.md b/vendor/cabal-doctest-1.0.8/README.md deleted file mode 100644 index 46810865525..00000000000 --- a/vendor/cabal-doctest-1.0.8/README.md +++ /dev/null @@ -1,255 +0,0 @@ -cabal-doctest -============= - -[![Hackage](https://img.shields.io/hackage/v/cabal-doctest.svg)](https://hackage.haskell.org/package/cabal-doctest) [![Build Status](https://travis-ci.org/phadej/cabal-doctest.svg?branch=master)](https://travis-ci.org/phadej/cabal-doctest) - -A `Setup.hs` helper for running `doctests`. - -Simple example --------------- - -For most use cases—a `.cabal` file with a single library containing -doctests—adapting the simple example located -[here](https://github.com/phadej/cabal-doctest/tree/master/simple-example) -will be sufficient. (Note that this example requires `Cabal-1.24` or later, but -you can relax this bound safely, although running doctests won't be supported -on versions of `Cabal` older than 1.24.) - -To use this library in your `Setup.hs`, you should specify a `custom-setup` -section in your `.cabal` file. For example: - -``` -custom-setup - setup-depends: - base >= 4 && <5, - Cabal, - cabal-doctest >= 1 && <1.1 -``` - -/Note:/ `Cabal` dependency is needed because of -[Cabal/GH-4288](https://github.com/haskell/cabal/issues/4288) bug. - -You'll also need to specify `build-type: Custom` at the top of the `.cabal` -file. Now put this into your `Setup.hs` file: - -```haskell -module Main where - -import Distribution.Extra.Doctest (defaultMainWithDoctests) - -main :: IO () -main = defaultMainWithDoctests "doctests" -``` - -When you build your project, this `Setup` will generate a `Build_doctests` -module. To use it in a testsuite, simply do this: - -```haskell -module Main where - -import Build_doctests (flags, pkgs, module_sources) -import Data.Foldable (traverse_) -import System.Environment.Compat (unsetEnv) -import Test.DocTest (doctest) - -main :: IO () -main = do - traverse_ putStrLn args -- optionally print arguments - unsetEnv "GHC_ENVIRONMENT" -- see 'Notes'; you may not need this - doctest args - where - args = flags ++ pkgs ++ module_sources -``` - -(The `System.Environment.Compat` module is from the `base-compat` -package. That's already in the transitive closure of `doctest`'s -dependencies. `System.Environment.unsetEnv` was added with GHC 7.8 so, -if you don't need to support versions of GHC older than 7.8, you can -use `System.Environment` from `base` instead.) - -Example with multiple .cabal components ---------------------------------------- - -`cabal-doctest` also supports more exotic use cases where a `.cabal` file -contains more components with doctests than just the main library, including: - -* Doctests in executables -* Doctests in Internal libraries (if using `Cabal-2.0` or later) - -Unlike the simple example shown above, these examples involve _named_ -components. You don't need to change the `Setup.hs` script to support -this use case. However, in this scenario `Build_doctests` will generate extra -copies of the `flags`, `pkgs`, and `module_sources` values for each additional -named component. - -Simplest approach is to use `x-doctest-components` field, for example -``` -x-doctest-components: lib lib:internal exe:example -``` - -In that case, the testdrive is general: - -```haskell -module Main where - -import Build_doctests (Component (..), components) -import Data.Foldable (for_) -import System.Environment.Compat (unsetEnv) -import Test.DocTest (doctest) - -main :: IO () -main = for_ components $ \(Component name flags pkgs sources) -> do - print name - putStrLn "----------------------------------------" - let args = flags ++ pkgs ++ sources - for_ args putStrLn - unsetEnv "GHC_ENVIRONMENT" - doctest args -``` - -There's also a more explicit approach: if you have an executable named `foo`, -then separate values named `flags_exe_foo`, `pkgs_exe_foo`, and `module_sources_exe_foo` will -be generated in `Build_doctests`. If the name has hyphens in it -(e.g., `my-exe`), then `cabal-doctest` will convert those hyphens to -underscores (e.g., you'd get `flags_my_exe`, `pkgs_my_exe`, and -`module_sources_my_exe`). -Internal library `bar` values will have a `_lib_bar` suffix. - -An example testsuite driver for this use case might look like this: - -```haskell -module Main where - -import Build_doctests - (flags, pkgs, module_sources, - flags_exe_my_exe, pkgs_exe_my_exe, module_sources_exe_my_exe) -import Data.Foldable (traverse_) -import System.Environment.Compat (unsetEnv) -import Test.DocTest - -main :: IO () -main = do - unsetEnv "GHC_ENVRIONMENT" - -- doctests for library - traverse_ putStrLn libArgs - doctest libArgs - - -- doctests for executable - traverse_ putStrLn exeArgs - doctest exeArgs - where - libArgs = flags ++ pkgs ++ module_sources - exeArgs = flags_exe_my_exe ++ pkgs_exe_my_exe ++ module_sources_exe_my_exe -``` - -See -[this example](https://github.com/phadej/cabal-doctest/tree/master/multiple-components-example) -for more details. - -Additional configuration ------------------------- - -The `cabal-doctest` based `Setup.hs` supports few extensions fields -in `pkg.cabal` files to customise the `doctest` runner behaviour, without -customising the default `doctest.hs`. - -``` -test-suite doctests: - if impl(ghc >= 8.0) - x-doctest-options: -fdiagnostics-color=never - x-doctest-source-dirs: test - x-doctest-modules: Servant.Utils.LinksSpec - - ... -``` - -* `x-doctest-options` Additional arguments passed into `doctest` command. -* `x-doctest-modules` Additional modules to `doctest`. May be useful if you - have `doctest` in test or executables (i.e not default library complonent). -* `x-doctest-src-dirs` Additional source directories to look for the modules. - -Notes ------ - -* Recent versions of `Cabal` (for instance, 2.0) can choose to build a - package's `doctest` test suite _before_ the library. However, in order for - `cabal-doctest` to work correctly, the library _must_ be built first, as - `doctest` relies on the presence of generated files that are only created - when the library is built. See - [#19](https://github.com/phadej/cabal-doctest/issues/19). - - A hacky workaround for this problem is to depend on the library itself in a - `doctests` test suite. See - [the simple example's .cabal file](https://github.com/phadej/cabal-doctest/blob/master/simple-example/simple-example.cabal) - for a demonstration. (This assumes that the test suite has the ability to - read build artifacts from the library, a separate build component. In - practice, this assumption holds, which is why this library works at all.) - -* `custom-setup` section is supported starting from `cabal-install-1.24`. - For older `cabal-install's` you have to install custom setup dependencies - manually. - -* `stack` respects `custom-setup` starting from version 1.3.3. Before that - you have to use `explicit-setup-deps` setting in your `stack.yaml`. - ([stack/GH-2094](https://github.com/commercialhaskell/stack/issues/2094)) - -* There is [an issue in the Cabal issue tracker](https://github.com/haskell/cabal/issues/2327) - about adding `cabal doctest` command. After that command is implemented, - this library will be deprecated. - -* You can use `x-doctest-options` field in `test-suite doctests` to - pass additional flags to the `doctest`. - -* For `build-type: Configure` packages, you can use - `defaultMainAutoconfWithDoctests` function to make custom `Setup.hs` script. - -* If you use the default `.` in `hs-source-dirs`, then running `doctests` - might fail with weird errors (ambiguous module errors). Workaround is - to move sources under `src/` or some non-top-level directory. - -* `extensions:` field isn't supported. Upgrade your `.cabal` file to use at least - `cabal-version: >= 1.10` and use `default-extensions` or `other-extensions`. - -* If you use QuickCheck properties (`prop>`) in your doctests, - the `test-suite doctest` should depend on `QuickCheck` and `template-haskell`. - This is a little HACK: These dependencies aren't needed to build the - `doctests` test-suite executable. However, as we let `Cabal` resolve - dependencies, we can pass the resolved (and installed!) package identifiers to - to the `doctest` command. This way, `QuickCheck` and `template-haskell` are - available to `doctest`, otherwise you'll get errors like: - -``` - Variable not in scope: - mkName - :: [Char] - -> template-haskell-2.11.1.0:Language.Haskell.TH.Syntax.Name -``` - -or - -``` - Variable not in scope: - polyQuickCheck - :: Language.Haskell.TH.Syntax.Name -> Language.Haskell.TH.Lib.ExpQ -``` - -* From version 2, Stack sets the `GHC_ENVRIONMENT` variable, and GHC - (as invoked by `doctest`) will pick that up. This is undesirable: - `cabal-doctest` passes all the necessary information on the command - line already, and can lead to ambiguous module errors as GHC will - load the environment in addition to what `cabal-doctest` instructs - it to. - - Hence, `cabal-doctest` tells GHC to ignore package environments - altogether on the command line. However, this is only possible since - GHC 8.2. If you are using `cabal-doctest` with Stack 2 and GHC 8.0 - or earlier and seeing ambiguous module errors or other mysterious - failures, try manually unsetting `GHC_ENVIRONMENT` before invoking - `doctest`. - -Copyright ---------- - -Copyright 2017 Oleg Grenrus. - -Available under the BSD 3-clause license. diff --git a/vendor/cabal-doctest-1.0.8/Setup.hs b/vendor/cabal-doctest-1.0.8/Setup.hs deleted file mode 100644 index 9a994af677b..00000000000 --- a/vendor/cabal-doctest-1.0.8/Setup.hs +++ /dev/null @@ -1,2 +0,0 @@ -import Distribution.Simple -main = defaultMain diff --git a/vendor/cabal-doctest-1.0.8/cabal-doctest.cabal b/vendor/cabal-doctest-1.0.8/cabal-doctest.cabal deleted file mode 100644 index 11602c9b5a7..00000000000 --- a/vendor/cabal-doctest-1.0.8/cabal-doctest.cabal +++ /dev/null @@ -1,47 +0,0 @@ -name: cabal-doctest -version: 1.0.8 -x-revision: 2 -synopsis: A Setup.hs helper for doctests running -description: - Currently (beginning of 2017), there isn't @cabal doctest@ - command. Yet, to properly work doctest needs plenty of configuration. - This library provides the common bits for writing custom Setup.hs - See for the progress - of @cabal doctest@, i.e. whether this library is obsolete. - -homepage: https://github.com/phadej/cabal-doctest -license: BSD3 -license-file: LICENSE -author: Oleg Grenrus -maintainer: Oleg Grenrus -copyright: (c) 2017 Oleg Grenrus -category: Distribution -build-type: Simple -cabal-version: >=1.10 -extra-source-files: - ChangeLog.md - README.md - -tested-with: GHC ==8.10.1 || >=7.4 && <8.10 || ==7.2.2 || ==7.0.4 - -source-repository head - type: git - location: https://github.com/phadej/cabal-doctest - -library - exposed-modules: Distribution.Extra.Doctest - other-modules: - other-extensions: - build-depends: - base >=4.3 && <4.16 - , Cabal >=1.10 && <3.8 - , directory - , filepath - - hs-source-dirs: src - default-language: Haskell2010 - ghc-options: -Wall - - if !impl(ghc >=7.2) - -- Work around a pattern-match coverage checking bug in GHC 7.0 - ghc-options: -fno-warn-overlapping-patterns diff --git a/vendor/cabal-doctest-1.0.8/src/Distribution/Extra/Doctest.hs b/vendor/cabal-doctest-1.0.8/src/Distribution/Extra/Doctest.hs deleted file mode 100644 index 3552b70e6c5..00000000000 --- a/vendor/cabal-doctest-1.0.8/src/Distribution/Extra/Doctest.hs +++ /dev/null @@ -1,552 +0,0 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE OverloadedStrings #-} --- | The provided 'generateBuildModule' generates 'Build_doctests' module. --- That module exports enough configuration, so your doctests could be simply --- --- @ --- module Main where --- --- import Build_doctests (flags, pkgs, module_sources) --- import Data.Foldable (traverse_) --- import Test.Doctest (doctest) --- --- main :: IO () --- main = do --- traverse_ putStrLn args -- optionally print arguments --- doctest args --- where --- args = flags ++ pkgs ++ module_sources --- @ --- --- To use this library in the @Setup.hs@, you should specify a @custom-setup@ --- section in the cabal file, for example: --- --- @ --- custom-setup --- setup-depends: --- base >= 4 && <5, --- cabal-doctest >= 1 && <1.1 --- @ --- --- /Note:/ you don't need to depend on @Cabal@ if you use only --- 'defaultMainWithDoctests' in the @Setup.hs@. --- -module Distribution.Extra.Doctest ( - defaultMainWithDoctests, - defaultMainAutoconfWithDoctests, - addDoctestsUserHook, - doctestsUserHooks, - generateBuildModule, - ) where - --- Hacky way to suppress few deprecation warnings. -#if MIN_VERSION_Cabal(1,24,0) -#define InstalledPackageId UnitId -#endif - -import Control.Monad - (when) -import Data.IORef - (modifyIORef, newIORef, readIORef) -import Data.List - (nub) -import Data.Maybe - (mapMaybe, maybeToList) -import Data.String - (fromString) -import Distribution.Package - (InstalledPackageId, Package (..)) -import Distribution.PackageDescription - (BuildInfo (..), Executable (..), GenericPackageDescription, - Library (..), PackageDescription, TestSuite (..)) -import Distribution.Simple - (UserHooks (..), autoconfUserHooks, defaultMainWithHooks, - simpleUserHooks) -import Distribution.Simple.Compiler - (CompilerFlavor (GHC), CompilerId (..), PackageDB (..), compilerId) -import Distribution.Simple.LocalBuildInfo - (ComponentLocalBuildInfo (componentPackageDeps), LocalBuildInfo, - compiler, withExeLBI, withLibLBI, withPackageDB, withTestLBI) -import Distribution.Simple.Setup - (BuildFlags (buildDistPref, buildVerbosity), - HaddockFlags (haddockDistPref, haddockVerbosity), emptyBuildFlags, - fromFlag) -import Distribution.Simple.Utils - (createDirectoryIfMissingVerbose, info) -import Distribution.Text - (display) -import System.FilePath - (()) - -import qualified Data.Foldable as F - (for_) -import qualified Data.Traversable as T - (traverse) - -#if MIN_VERSION_Cabal(1,25,0) -import Distribution.Simple.BuildPaths - (autogenComponentModulesDir) -#else -import Distribution.Simple.BuildPaths - (autogenModulesDir) -#endif - -#if MIN_VERSION_Cabal(2,0,0) -import Distribution.Types.MungedPackageId - (MungedPackageId) -import Distribution.Types.UnqualComponentName - (unUnqualComponentName) - --- For amendGPD -import Distribution.PackageDescription - (CondTree (..)) -import Distribution.Types.GenericPackageDescription - (GenericPackageDescription (condTestSuites)) - -import Distribution.Version - (mkVersion) -#else -import Data.Version - (Version (..)) -import Distribution.Package - (PackageId) -#endif - -#if MIN_VERSION_Cabal(3,0,0) -import Distribution.Simple.Utils - (findFileEx) -#else -import Distribution.Simple.Utils - (findFile) -#endif - -#if MIN_VERSION_Cabal(3,0,0) -import Distribution.Types.LibraryName - (libraryNameString) -#endif - -#if MIN_VERSION_Cabal(3,5,0) -import Distribution.Utils.Path - (getSymbolicPath) -#endif - -#if MIN_VERSION_directory(1,2,2) -import System.Directory - (makeAbsolute) -#else -import System.Directory - (getCurrentDirectory) -import System.FilePath - (isAbsolute) - -makeAbsolute :: FilePath -> IO FilePath -makeAbsolute p | isAbsolute p = return p - | otherwise = do - cwd <- getCurrentDirectory - return $ cwd p -#endif - -#if !MIN_VERSION_Cabal(3,0,0) -findFileEx :: verbosity -> [FilePath] -> FilePath -> IO FilePath -findFileEx _ = findFile -#endif - -#if !MIN_VERSION_Cabal(2,0,0) -mkVersion :: [Int] -> Version -mkVersion ds = Version ds [] -#endif - -#if !MIN_VERSION_Cabal(3,5,0) -getSymbolicPath :: FilePath -> FilePath -getSymbolicPath = id -#endif - -------------------------------------------------------------------------------- --- Mains -------------------------------------------------------------------------------- - --- | A default main with doctests: --- --- @ --- import Distribution.Extra.Doctest --- (defaultMainWithDoctests) --- --- main :: IO () --- main = defaultMainWithDoctests "doctests" --- @ -defaultMainWithDoctests - :: String -- ^ doctests test-suite name - -> IO () -defaultMainWithDoctests = defaultMainWithHooks . doctestsUserHooks - --- | Like 'defaultMainWithDoctests', for 'build-type: Configure' packages. --- --- @since 1.0.2 -defaultMainAutoconfWithDoctests - :: String -- ^ doctests test-suite name - -> IO () -defaultMainAutoconfWithDoctests n = - defaultMainWithHooks (addDoctestsUserHook n autoconfUserHooks) - --- | 'simpleUserHooks' with 'generateBuildModule' prepended to the 'buildHook'. -doctestsUserHooks - :: String -- ^ doctests test-suite name - -> UserHooks -doctestsUserHooks testsuiteName = - addDoctestsUserHook testsuiteName simpleUserHooks - --- | --- --- @since 1.0.2 -addDoctestsUserHook :: String -> UserHooks -> UserHooks -addDoctestsUserHook testsuiteName uh = uh - { buildHook = \pkg lbi hooks flags -> do - generateBuildModule testsuiteName flags pkg lbi - buildHook uh pkg lbi hooks flags - -- We use confHook to add "Build_Doctests" to otherModules and autogenModules. - -- - -- We cannot use HookedBuildInfo as it let's alter only the library and executables. - , confHook = \(gpd, hbi) flags -> - confHook uh (amendGPD testsuiteName gpd, hbi) flags - , haddockHook = \pkg lbi hooks flags -> do - generateBuildModule testsuiteName (haddockToBuildFlags flags) pkg lbi - haddockHook uh pkg lbi hooks flags - } - --- | Convert only flags used by 'generateBuildModule'. -haddockToBuildFlags :: HaddockFlags -> BuildFlags -haddockToBuildFlags f = emptyBuildFlags - { buildVerbosity = haddockVerbosity f - , buildDistPref = haddockDistPref f - } - -data Name = NameLib (Maybe String) | NameExe String deriving (Eq, Show) - -nameToString :: Name -> String -nameToString n = case n of - NameLib x -> maybe "" (("_lib_" ++) . map fixchar) x - NameExe x -> "_exe_" ++ map fixchar x - where - -- Taken from Cabal: - -- https://github.com/haskell/cabal/blob/20de0bfea72145ba1c37e3f500cee5258cc18e51/Cabal/Distribution/Simple/Build/Macros.hs#L156-L158 - -- - -- Needed to fix component names with hyphens in them, as hyphens aren't - -- allowed in Haskell identifier names. - fixchar :: Char -> Char - fixchar '-' = '_' - fixchar c = c - -data Component = Component Name [String] [String] [String] - deriving Show - --- | Generate a build module for the test suite. --- --- @ --- import Distribution.Simple --- (defaultMainWithHooks, UserHooks(..), simpleUserHooks) --- import Distribution.Extra.Doctest --- (generateBuildModule) --- --- main :: IO () --- main = defaultMainWithHooks simpleUserHooks --- { buildHook = \pkg lbi hooks flags -> do --- generateBuildModule "doctests" flags pkg lbi --- buildHook simpleUserHooks pkg lbi hooks flags --- } --- @ -generateBuildModule - :: String -- ^ doctests test-suite name - -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO () -generateBuildModule testSuiteName flags pkg lbi = do - let verbosity = fromFlag (buildVerbosity flags) - let distPref = fromFlag (buildDistPref flags) - - -- Package DBs & environments - let dbStack = withPackageDB lbi ++ [ SpecificPackageDB $ distPref "package.conf.inplace" ] - let dbFlags = "-hide-all-packages" : packageDbArgs dbStack - let envFlags - | ghcCanBeToldToIgnorePkgEnvs = [ "-package-env=-" ] - | otherwise = [] - - withTestLBI pkg lbi $ \suite suitecfg -> when (testName suite == fromString testSuiteName) $ do -#if MIN_VERSION_Cabal(1,25,0) - let testAutogenDir = autogenComponentModulesDir lbi suitecfg -#else - let testAutogenDir = autogenModulesDir lbi -#endif - - createDirectoryIfMissingVerbose verbosity True testAutogenDir - - let buildDoctestsFile = testAutogenDir "Build_doctests.hs" - - -- First, we create the autogen'd module Build_doctests. - -- Initially populate Build_doctests with a simple preamble. - info verbosity $ "cabal-doctest: writing Build_doctests to " ++ buildDoctestsFile - writeFile buildDoctestsFile $ unlines - [ "module Build_doctests where" - , "" - , "import Prelude" - , "" - , "data Name = NameLib (Maybe String) | NameExe String deriving (Eq, Show)" - , "data Component = Component Name [String] [String] [String] deriving (Eq, Show)" - , "" - ] - - -- we cannot traverse, only traverse_ - -- so we use IORef to collect components - componentsRef <- newIORef [] - - let testBI = testBuildInfo suite - - -- TODO: `words` is not proper parser (no support for quotes) - let additionalFlags = maybe [] words - $ lookup "x-doctest-options" - $ customFieldsBI testBI - - let additionalModules = maybe [] words - $ lookup "x-doctest-modules" - $ customFieldsBI testBI - - let additionalDirs' = maybe [] words - $ lookup "x-doctest-source-dirs" - $ customFieldsBI testBI - - additionalDirs <- mapM (fmap ("-i" ++) . makeAbsolute) additionalDirs' - - -- Next, for each component (library or executable), we get to Build_doctests - -- the sets of flags needed to run doctest on that component. - let getBuildDoctests withCompLBI mbCompName compExposedModules compMainIs compBuildInfo = - withCompLBI pkg lbi $ \comp compCfg -> do - let compBI = compBuildInfo comp - - -- modules - let modules = compExposedModules comp ++ otherModules compBI - -- it seems that doctest is happy to take in module names, not actual files! - let module_sources = modules - - -- We need the directory with the component's cabal_macros.h! -#if MIN_VERSION_Cabal(1,25,0) - let compAutogenDir = autogenComponentModulesDir lbi compCfg -#else - let compAutogenDir = autogenModulesDir lbi -#endif - - -- Lib sources and includes - iArgsNoPrefix - <- mapM makeAbsolute - $ compAutogenDir -- autogenerated files - : (distPref ++ "/build") -- preprocessed files (.hsc -> .hs); "build" is hardcoded in Cabal. - : map getSymbolicPath (hsSourceDirs compBI) - includeArgs <- mapM (fmap ("-I"++) . makeAbsolute) $ includeDirs compBI - -- We clear all includes, so the CWD isn't used. - let iArgs' = map ("-i"++) iArgsNoPrefix - iArgs = "-i" : iArgs' - - -- default-extensions - let extensionArgs = map (("-X"++) . display) $ defaultExtensions compBI - - -- CPP includes, i.e. include cabal_macros.h - let cppFlags = map ("-optP"++) $ - [ "-include", compAutogenDir ++ "/cabal_macros.h" ] - ++ cppOptions compBI - - -- Unlike other modules, the main-is module of an executable is not - -- guaranteed to share a module name with its filepath name. That is, - -- even though the main-is module is named Main, its filepath might - -- actually be Something.hs. To account for this possibility, we simply - -- pass the full path to the main-is module instead. - mainIsPath <- T.traverse (findFileEx verbosity iArgsNoPrefix) (compMainIs comp) - - let all_sources = map display module_sources - ++ additionalModules - ++ maybeToList mainIsPath - - let component = Component - (mbCompName comp) - (formatDeps $ testDeps compCfg suitecfg) - (concat - [ iArgs - , additionalDirs - , includeArgs - , envFlags - , dbFlags - , cppFlags - , extensionArgs - , additionalFlags - ]) - all_sources - - -- modify IORef, append component - modifyIORef componentsRef (\cs -> cs ++ [component]) - - -- For now, we only check for doctests in libraries and executables. - getBuildDoctests withLibLBI mbLibraryName exposedModules (const Nothing) libBuildInfo - getBuildDoctests withExeLBI (NameExe . executableName) (const []) (Just . modulePath) buildInfo - - components <- readIORef componentsRef - F.for_ components $ \(Component cmpName cmpPkgs cmpFlags cmpSources) -> do - let compSuffix = nameToString cmpName - pkgs_comp = "pkgs" ++ compSuffix - flags_comp = "flags" ++ compSuffix - module_sources_comp = "module_sources" ++ compSuffix - - -- write autogen'd file - appendFile buildDoctestsFile $ unlines - [ -- -package-id etc. flags - pkgs_comp ++ " :: [String]" - , pkgs_comp ++ " = " ++ show cmpPkgs - , "" - , flags_comp ++ " :: [String]" - , flags_comp ++ " = " ++ show cmpFlags - , "" - , module_sources_comp ++ " :: [String]" - , module_sources_comp ++ " = " ++ show cmpSources - , "" - ] - - -- write enabled components, i.e. x-doctest-components - -- if none enabled, pick library - let enabledComponents = maybe [NameLib Nothing] (mapMaybe parseComponentName . words) - $ lookup "x-doctest-components" - $ customFieldsBI testBI - - let components' = - filter (\(Component n _ _ _) -> n `elem` enabledComponents) components - appendFile buildDoctestsFile $ unlines - [ "-- " ++ show enabledComponents - , "components :: [Component]" - , "components = " ++ show components' - ] - - where - parseComponentName :: String -> Maybe Name - parseComponentName "lib" = Just (NameLib Nothing) - parseComponentName ('l' : 'i' : 'b' : ':' : x) = Just (NameLib (Just x)) - parseComponentName ('e' : 'x' : 'e' : ':' : x) = Just (NameExe x) - parseComponentName _ = Nothing - - -- we do this check in Setup, as then doctests don't need to depend on Cabal - isNewCompiler = case compilerId $ compiler lbi of - CompilerId GHC v -> v >= mkVersion [7,6] - _ -> False - - ghcCanBeToldToIgnorePkgEnvs :: Bool - ghcCanBeToldToIgnorePkgEnvs = case compilerId $ compiler lbi of - CompilerId GHC v -> v >= mkVersion [8,4,4] - _ -> False - - formatDeps = map formatOne - formatOne (installedPkgId, pkgId) - -- The problem is how different cabal executables handle package databases - -- when doctests depend on the library - -- - -- If the pkgId is current package, we don't output the full package-id - -- but only the name - -- - -- Because of MungedPackageId we compare display version of identifiers - -- not the identifiers themfselves. - | display (packageId pkg) == display pkgId = "-package=" ++ display pkgId - | otherwise = "-package-id=" ++ display installedPkgId - - -- From Distribution.Simple.Program.GHC - packageDbArgs :: [PackageDB] -> [String] - packageDbArgs | isNewCompiler = packageDbArgsDb - | otherwise = packageDbArgsConf - - -- GHC <7.6 uses '-package-conf' instead of '-package-db'. - packageDbArgsConf :: [PackageDB] -> [String] - packageDbArgsConf dbstack = case dbstack of - (GlobalPackageDB:UserPackageDB:dbs) -> concatMap specific dbs - (GlobalPackageDB:dbs) -> ("-no-user-package-conf") - : concatMap specific dbs - _ -> ierror - where - specific (SpecificPackageDB db) = [ "-package-conf=" ++ db ] - specific _ = ierror - ierror = error $ "internal error: unexpected package db stack: " - ++ show dbstack - - -- GHC >= 7.6 uses the '-package-db' flag. See - -- https://ghc.haskell.org/trac/ghc/ticket/5977. - packageDbArgsDb :: [PackageDB] -> [String] - -- special cases to make arguments prettier in common scenarios - packageDbArgsDb dbstack = case dbstack of - (GlobalPackageDB:UserPackageDB:dbs) - | all isSpecific dbs -> concatMap single dbs - (GlobalPackageDB:dbs) - | all isSpecific dbs -> "-no-user-package-db" - : concatMap single dbs - dbs -> "-clear-package-db" - : concatMap single dbs - where - single (SpecificPackageDB db) = [ "-package-db=" ++ db ] - single GlobalPackageDB = [ "-global-package-db" ] - single UserPackageDB = [ "-user-package-db" ] - isSpecific (SpecificPackageDB _) = True - isSpecific _ = False - - mbLibraryName :: Library -> Name -#if MIN_VERSION_Cabal(3,0,0) - mbLibraryName = NameLib . fmap unUnqualComponentName . libraryNameString . libName -#elif MIN_VERSION_Cabal(2,0,0) - -- Cabal-2.0 introduced internal libraries, which are named. - mbLibraryName = NameLib . fmap unUnqualComponentName . libName -#else - -- Before that, there was only ever at most one library per - -- .cabal file, which has no name. - mbLibraryName _ = NameLib Nothing -#endif - - executableName :: Executable -> String -#if MIN_VERSION_Cabal(2,0,0) - executableName = unUnqualComponentName . exeName -#else - executableName = exeName -#endif - --- | In compat settings it's better to omit the type-signature -testDeps :: ComponentLocalBuildInfo -> ComponentLocalBuildInfo -#if MIN_VERSION_Cabal(2,0,0) - -> [(InstalledPackageId, MungedPackageId)] -#else - -> [(InstalledPackageId, PackageId)] -#endif -testDeps xs ys = nub $ componentPackageDeps xs ++ componentPackageDeps ys - -amendGPD - :: String -- ^ doctests test-suite name - -> GenericPackageDescription - -> GenericPackageDescription -#if !(MIN_VERSION_Cabal(2,0,0)) -amendGPD _ gpd = gpd -#else -amendGPD testSuiteName gpd = gpd - { condTestSuites = map f (condTestSuites gpd) - } - where - f (name, condTree) - | name == fromString testSuiteName = (name, condTree') - | otherwise = (name, condTree) - where - -- I miss 'lens' - testSuite = condTreeData condTree - bi = testBuildInfo testSuite - om = otherModules bi - am = autogenModules bi - - -- Cons the module to both other-modules and autogen-modules. - -- At the moment, cabal-spec-2.0 and cabal-spec-2.2 don't have - -- "all autogen-modules are other-modules if they aren't exposed-modules" - -- rule. Hopefully cabal-spec-3.0 will have. - -- - -- Note: we `nub`, because it's unclear if that's ok to have duplicate - -- modules in the lists. - om' = nub $ mn : om - am' = nub $ mn : am - - mn = fromString "Build_doctests" - - bi' = bi { otherModules = om', autogenModules = am' } - testSuite' = testSuite { testBuildInfo = bi' } - condTree' = condTree { condTreeData = testSuite' } -#endif From b64b7710afe0d4fc2a2b281eaa8a19b58d88f926 Mon Sep 17 00:00:00 2001 From: Gershom Bazerman Date: Fri, 14 Jan 2022 10:15:48 -0500 Subject: [PATCH 4/7] fix validate --- cabal.project.validate | 2 -- 1 file changed, 2 deletions(-) diff --git a/cabal.project.validate b/cabal.project.validate index 0fcbe2cede7..b4dd0bf089a 100644 --- a/cabal.project.validate +++ b/cabal.project.validate @@ -10,8 +10,6 @@ packages: Cabal-described packages: Cabal-tests packages: cabal-benchmarks -packages: vendor/cabal-doctest-1.0.8 - tests: True -- avoiding extra dependencies From 7ccdcd9b664d7d3e91f3d4b7a20b5b01582106e5 Mon Sep 17 00:00:00 2001 From: Gershom Bazerman Date: Fri, 14 Jan 2022 14:29:27 -0500 Subject: [PATCH 5/7] more fixup --- cabal.project.coverage | 2 -- cabal.project.libonly | 2 -- cabal.project.validate.libonly | 2 -- 3 files changed, 6 deletions(-) diff --git a/cabal.project.coverage b/cabal.project.coverage index cd643351779..4288aa0447f 100644 --- a/cabal.project.coverage +++ b/cabal.project.coverage @@ -11,8 +11,6 @@ packages: Cabal-described packages: Cabal-tests/ packages: cabal-benchmarks/ -packages: vendor/cabal-doctest-1.0.8 - -- Uncomment to allow picking up extra local unpacked deps: --optional-packages: */ diff --git a/cabal.project.libonly b/cabal.project.libonly index 0a69952e852..1a77192fdf8 100644 --- a/cabal.project.libonly +++ b/cabal.project.libonly @@ -5,8 +5,6 @@ packages: Cabal-tree-diff packages: Cabal-described packages: Cabal-tests -packages: vendor/cabal-doctest-1.0.8 - tests: True -- Uncomment to allow picking up extra local unpacked deps: diff --git a/cabal.project.validate.libonly b/cabal.project.validate.libonly index 625f8f4e739..3b4d60c1eb2 100644 --- a/cabal.project.validate.libonly +++ b/cabal.project.validate.libonly @@ -5,8 +5,6 @@ packages: Cabal-tree-diff packages: Cabal-described packages: Cabal-tests -packages: vendor/cabal-doctest-1.0.8 - tests: True write-ghc-environment-files: never From 3ea1bdfa6298ec765c682a0957ce879950935820 Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Thu, 27 Jan 2022 19:52:51 +0100 Subject: [PATCH 6/7] Add 9.2 CI job and update older ones --- .github/workflows/linux.yml | 94 ++++++++++++++++++++++------ cabal-dev-scripts/src/GenValidate.hs | 5 +- 2 files changed, 79 insertions(+), 20 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index fc6aaab4337..4524f869ada 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -15,12 +15,12 @@ on: - created jobs: - validate-9_0_1: - name: validate.sh ghc-9.0.1 + validate-9_2_1: + name: validate.sh ghc-9.2.1 runs-on: ubuntu-18.04 needs: validate-8_8_4 container: - image: phadej/ghc:9.0.1-bionic + image: phadej/ghc:9.2.1-bionic steps: - name: System info run: | @@ -37,6 +37,60 @@ jobs: xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan rm -f cabal-plan.xz chmod a+x $HOME/.cabal/bin/cabal-plan + - name: apt-get update + run: apt-get update + - name: Install `nroff` for `cabal man` + run: apt-get install -y groff-base + - name: Update Hackage index + run: cabal v2-update + # https://github.com/actions/checkout/issues/170 + # - uses: actions/checkout@v2 + - name: Checkout + run: | + echo $GITHUB_REF $GITHUB_SHA + git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git . + git fetch origin $GITHUB_SHA:temporary-ci-branch + git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) + - name: Validate print-config + run: sh validate.sh -j 2 -w ghc-9.2.1 -v -s print-config + - name: Validate print-tool-versions + run: sh validate.sh -j 2 -w ghc-9.2.1 -v -s print-tool-versions + - name: Validate build + run: sh validate.sh -j 2 -w ghc-9.2.1 -v -s build + - name: Validate lib-tests + run: sh validate.sh -j 2 -w ghc-9.2.1 -v -s lib-tests + - name: Validate lib-suite + run: sh validate.sh -j 2 -w ghc-9.2.1 -v -s lib-suite + - name: Validate cli-tests + run: sh validate.sh -j 2 -w ghc-9.2.1 -v -s cli-tests + - name: Validate cli-suite + run: sh validate.sh -j 2 -w ghc-9.2.1 -v -s cli-suite + validate-9_0_2: + name: validate.sh ghc-9.0.2 + runs-on: ubuntu-18.04 + needs: validate-8_8_4 + container: + image: phadej/ghc:9.0.2-bionic + steps: + - name: System info + run: | + uname -a + - name: Set PATH + # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path + run: | + echo "$HOME/.cabal/bin" >> $GITHUB_PATH + - name: Install cabal-plan + run: | + mkdir -p $HOME/.cabal/bin + curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz + echo "de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz" | sha256sum -c - + xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan + rm -f cabal-plan.xz + chmod a+x $HOME/.cabal/bin/cabal-plan + - name: apt-get update + run: apt-get update + - name: Install `nroff` for `cabal man` + run: apt-get install -y groff-base - name: Update Hackage index run: cabal v2-update # https://github.com/actions/checkout/issues/170 @@ -48,21 +102,25 @@ jobs: git fetch origin $GITHUB_SHA:temporary-ci-branch git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) - name: Validate print-config - run: sh validate.sh -j 2 -w ghc-9.0.1 -v --lib-only -s print-config + run: sh validate.sh -j 2 -w ghc-9.0.2 -v -s print-config - name: Validate print-tool-versions - run: sh validate.sh -j 2 -w ghc-9.0.1 -v --lib-only -s print-tool-versions + run: sh validate.sh -j 2 -w ghc-9.0.2 -v -s print-tool-versions - name: Validate build - run: sh validate.sh -j 2 -w ghc-9.0.1 -v --lib-only -s build + run: sh validate.sh -j 2 -w ghc-9.0.2 -v -s build - name: Validate lib-tests - run: sh validate.sh -j 2 -w ghc-9.0.1 -v --lib-only -s lib-tests + run: sh validate.sh -j 2 -w ghc-9.0.2 -v -s lib-tests - name: Validate lib-suite - run: sh validate.sh -j 2 -w ghc-9.0.1 -v --lib-only -s lib-suite - validate-8_10_4: - name: validate.sh ghc-8.10.4 + run: sh validate.sh -j 2 -w ghc-9.0.2 -v -s lib-suite + - name: Validate cli-tests + run: sh validate.sh -j 2 -w ghc-9.0.2 -v -s cli-tests + - name: Validate cli-suite + run: sh validate.sh -j 2 -w ghc-9.0.2 -v -s cli-suite + validate-8_10_7: + name: validate.sh ghc-8.10.7 runs-on: ubuntu-18.04 needs: validate-8_8_4 container: - image: phadej/ghc:8.10.4-bionic + image: phadej/ghc:8.10.7-bionic steps: - name: System info run: | @@ -94,19 +152,19 @@ jobs: git fetch origin $GITHUB_SHA:temporary-ci-branch git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA) - name: Validate print-config - run: sh validate.sh -j 2 -w ghc-8.10.4 -v -s print-config + run: sh validate.sh -j 2 -w ghc-8.10.7 -v -s print-config - name: Validate print-tool-versions - run: sh validate.sh -j 2 -w ghc-8.10.4 -v -s print-tool-versions + run: sh validate.sh -j 2 -w ghc-8.10.7 -v -s print-tool-versions - name: Validate build - run: sh validate.sh -j 2 -w ghc-8.10.4 -v -s build + run: sh validate.sh -j 2 -w ghc-8.10.7 -v -s build - name: Validate lib-tests - run: sh validate.sh -j 2 -w ghc-8.10.4 -v -s lib-tests + run: sh validate.sh -j 2 -w ghc-8.10.7 -v -s lib-tests - name: Validate lib-suite - run: sh validate.sh -j 2 -w ghc-8.10.4 -v -s lib-suite + run: sh validate.sh -j 2 -w ghc-8.10.7 -v -s lib-suite - name: Validate cli-tests - run: sh validate.sh -j 2 -w ghc-8.10.4 -v -s cli-tests + run: sh validate.sh -j 2 -w ghc-8.10.7 -v -s cli-tests - name: Validate cli-suite - run: sh validate.sh -j 2 -w ghc-8.10.4 -v -s cli-suite + run: sh validate.sh -j 2 -w ghc-8.10.7 -v -s cli-suite validate-8_8_4: name: validate.sh ghc-8.8.4 runs-on: ubuntu-18.04 diff --git a/cabal-dev-scripts/src/GenValidate.hs b/cabal-dev-scripts/src/GenValidate.hs index 8203eb4f934..999e9018ebd 100644 --- a/cabal-dev-scripts/src/GenValidate.hs +++ b/cabal-dev-scripts/src/GenValidate.hs @@ -23,8 +23,9 @@ main = do w <- run Z { zJobs = -- version xenial flags old needs steps ------------------------------------------------------------------- - [ GhcJob "9.0.1" False "--lib-only" False ["8.8.4"] libSteps - , GhcJob "8.10.4" False "" False ["8.8.4"] defSteps + [ GhcJob "9.2.1" False "" False ["8.8.4"] defSteps + , GhcJob "9.0.2" False "" False ["8.8.4"] defSteps + , GhcJob "8.10.7" False "" False ["8.8.4"] defSteps , GhcJob "8.8.4" False "--solver-benchmarks" False [] defSteps , GhcJob "8.6.5" False "--complete-hackage-tests" False ["8.8.4"] defSteps , GhcJob "8.4.4" False "" False ["8.8.4"] defSteps From 106c99aac1c06261125290141ce109eefbd0a8a8 Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Wed, 2 Feb 2022 14:30:36 +0100 Subject: [PATCH 7/7] Switch to official docker images for CI phadej's images use hvr's ppa, which stops at ghc 9.0 --- .github/workflows/linux.yml | 24 ++++++++++++------------ templates/ci-linux.template.yml | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 4524f869ada..2ba9d954488 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-18.04 needs: validate-8_8_4 container: - image: phadej/ghc:9.2.1-bionic + image: haskell:9.2.1 steps: - name: System info run: | @@ -70,7 +70,7 @@ jobs: runs-on: ubuntu-18.04 needs: validate-8_8_4 container: - image: phadej/ghc:9.0.2-bionic + image: haskell:9.0.2 steps: - name: System info run: | @@ -120,7 +120,7 @@ jobs: runs-on: ubuntu-18.04 needs: validate-8_8_4 container: - image: phadej/ghc:8.10.7-bionic + image: haskell:8.10.7 steps: - name: System info run: | @@ -169,7 +169,7 @@ jobs: name: validate.sh ghc-8.8.4 runs-on: ubuntu-18.04 container: - image: phadej/ghc:8.8.4-bionic + image: haskell:8.8.4 steps: - name: System info run: | @@ -219,7 +219,7 @@ jobs: runs-on: ubuntu-18.04 needs: validate-8_8_4 container: - image: phadej/ghc:8.6.5-bionic + image: haskell:8.6.5 steps: - name: System info run: | @@ -269,7 +269,7 @@ jobs: runs-on: ubuntu-18.04 needs: validate-8_8_4 container: - image: phadej/ghc:8.4.4-bionic + image: haskell:8.4.4 steps: - name: System info run: | @@ -319,7 +319,7 @@ jobs: runs-on: ubuntu-18.04 needs: validate-8_8_4 container: - image: phadej/ghc:8.2.2-bionic + image: haskell:8.2.2 steps: - name: System info run: | @@ -369,7 +369,7 @@ jobs: runs-on: ubuntu-18.04 needs: validate-8_8_4 container: - image: phadej/ghc:8.0.2-bionic + image: haskell:8.0.2 steps: - name: System info run: | @@ -411,7 +411,7 @@ jobs: runs-on: ubuntu-18.04 needs: validate-8_8_4 container: - image: phadej/ghc:7.10.3-bionic + image: haskell:7.10.3 steps: - name: System info run: | @@ -453,7 +453,7 @@ jobs: runs-on: ubuntu-18.04 needs: validate-8_8_4 container: - image: phadej/ghc:7.8.4-bionic + image: haskell:7.8.4 steps: - name: System info run: | @@ -495,7 +495,7 @@ jobs: runs-on: ubuntu-18.04 needs: validate-8_8_4 container: - image: phadej/ghc:7.6.3-xenial + image: haskell:7.6.3 steps: - name: System info run: | @@ -541,7 +541,7 @@ jobs: runs-on: ubuntu-18.04 needs: validate-8_8_4 container: - image: phadej/ghc:8.8.4-xenial + image: haskell:8.8.4 steps: - name: System info run: | diff --git a/templates/ci-linux.template.yml b/templates/ci-linux.template.yml index 63ea43da6d0..c9898220e1b 100644 --- a/templates/ci-linux.template.yml +++ b/templates/ci-linux.template.yml @@ -23,7 +23,7 @@ jobs: needs: validate-{{ mangleVersion needs }} {% endfor %} container: - image: phadej/ghc:{{job.version}}-{% if job.xenial %}xenial{% else %}bionic{% endif %} + image: haskell:{{job.version}} steps: - name: System info run: |