From 426e7b1855c466198fbaeb82f2d3825d601261a5 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Sun, 16 Aug 2015 15:51:05 +0200 Subject: [PATCH 1/6] Move dependency solver to library --- .travis.yml | 2 + .../Distribution/Client/Compat/FilePerms.hs | 0 .../Distribution/Client/Compat/Time.hs | 0 .../Distribution/Client/ComponentDeps.hs | 0 .../Distribution/Client/PackageIndex.hs | 0 .../Distribution/Client/PackageUtils.hs | 0 .../Distribution/Client/Types.hs | 0 .../Distribution/Client/Utils.hs | 0 .../Distribution/Client/Utils/LabeledGraph.hs | 0 cabal-install-lib/LICENSE | 30 ++++++++ cabal-install-lib/Setup.hs | 2 + cabal-install-lib/cabal-install-lib.cabal | 73 +++++++++++++++++++ .../Distribution/Client/Dependency/Modular.hs | 0 .../Client/Dependency/Modular/Assignment.hs | 0 .../Client/Dependency/Modular/Builder.hs | 0 .../Client/Dependency/Modular/Configured.hs | 0 .../Modular/ConfiguredConversion.hs | 0 .../Client/Dependency/Modular/Dependency.hs | 0 .../Client/Dependency/Modular/Explore.hs | 0 .../Client/Dependency/Modular/Flag.hs | 0 .../Client/Dependency/Modular/Index.hs | 0 .../Dependency/Modular/IndexConversion.hs | 0 .../Client/Dependency/Modular/Linking.hs | 0 .../Client/Dependency/Modular/Log.hs | 0 .../Client/Dependency/Modular/Message.hs | 0 .../Client/Dependency/Modular/PSQ.hs | 0 .../Client/Dependency/Modular/Package.hs | 0 .../Client/Dependency/Modular/Preference.hs | 0 .../Client/Dependency/Modular/Solver.hs | 0 .../Client/Dependency/Modular/Tree.hs | 0 .../Client/Dependency/Modular/Validate.hs | 0 .../Client/Dependency/Modular/Version.hs | 0 .../Distribution/Client/Dependency/TopDown.hs | 0 .../Client/Dependency/TopDown/Constraints.hs | 0 .../Client/Dependency/TopDown/Types.hs | 0 .../Distribution/Client/Dependency/Types.hs | 0 cabal-install-solver/LICENSE | 30 ++++++++ cabal-install-solver/Setup.hs | 2 + .../cabal-install-solver.cabal | 62 ++++++++++++++++ cabal-install/cabal-install.cabal | 60 ++++----------- 40 files changed, 216 insertions(+), 45 deletions(-) rename {cabal-install => cabal-install-lib}/Distribution/Client/Compat/FilePerms.hs (100%) rename {cabal-install => cabal-install-lib}/Distribution/Client/Compat/Time.hs (100%) rename {cabal-install => cabal-install-lib}/Distribution/Client/ComponentDeps.hs (100%) rename {cabal-install => cabal-install-lib}/Distribution/Client/PackageIndex.hs (100%) rename {cabal-install => cabal-install-lib}/Distribution/Client/PackageUtils.hs (100%) rename {cabal-install => cabal-install-lib}/Distribution/Client/Types.hs (100%) rename {cabal-install => cabal-install-lib}/Distribution/Client/Utils.hs (100%) rename {cabal-install => cabal-install-lib}/Distribution/Client/Utils/LabeledGraph.hs (100%) create mode 100644 cabal-install-lib/LICENSE create mode 100644 cabal-install-lib/Setup.hs create mode 100644 cabal-install-lib/cabal-install-lib.cabal rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Modular.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Modular/Assignment.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Modular/Builder.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Modular/Configured.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Modular/ConfiguredConversion.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Modular/Dependency.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Modular/Explore.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Modular/Flag.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Modular/Index.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Modular/IndexConversion.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Modular/Linking.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Modular/Log.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Modular/Message.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Modular/PSQ.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Modular/Package.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Modular/Preference.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Modular/Solver.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Modular/Tree.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Modular/Validate.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Modular/Version.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/TopDown.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/TopDown/Constraints.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/TopDown/Types.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency/Types.hs (100%) create mode 100644 cabal-install-solver/LICENSE create mode 100644 cabal-install-solver/Setup.hs create mode 100644 cabal-install-solver/cabal-install-solver.cabal diff --git a/.travis.yml b/.travis.yml index 5f5f3f69bad..811bf831085 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,6 +58,8 @@ script: - cd ../cabal-install - cabal sandbox init - cabal sandbox add-source ../Cabal + - cabal sandbox add-source ../cabal-install-lib + - cabal sandbox add-source ../cabal-install-solver - cabal install --dependencies-only --enable-tests - cabal configure --enable-tests --ghc-option=-Werror - cabal build diff --git a/cabal-install/Distribution/Client/Compat/FilePerms.hs b/cabal-install-lib/Distribution/Client/Compat/FilePerms.hs similarity index 100% rename from cabal-install/Distribution/Client/Compat/FilePerms.hs rename to cabal-install-lib/Distribution/Client/Compat/FilePerms.hs diff --git a/cabal-install/Distribution/Client/Compat/Time.hs b/cabal-install-lib/Distribution/Client/Compat/Time.hs similarity index 100% rename from cabal-install/Distribution/Client/Compat/Time.hs rename to cabal-install-lib/Distribution/Client/Compat/Time.hs diff --git a/cabal-install/Distribution/Client/ComponentDeps.hs b/cabal-install-lib/Distribution/Client/ComponentDeps.hs similarity index 100% rename from cabal-install/Distribution/Client/ComponentDeps.hs rename to cabal-install-lib/Distribution/Client/ComponentDeps.hs diff --git a/cabal-install/Distribution/Client/PackageIndex.hs b/cabal-install-lib/Distribution/Client/PackageIndex.hs similarity index 100% rename from cabal-install/Distribution/Client/PackageIndex.hs rename to cabal-install-lib/Distribution/Client/PackageIndex.hs diff --git a/cabal-install/Distribution/Client/PackageUtils.hs b/cabal-install-lib/Distribution/Client/PackageUtils.hs similarity index 100% rename from cabal-install/Distribution/Client/PackageUtils.hs rename to cabal-install-lib/Distribution/Client/PackageUtils.hs diff --git a/cabal-install/Distribution/Client/Types.hs b/cabal-install-lib/Distribution/Client/Types.hs similarity index 100% rename from cabal-install/Distribution/Client/Types.hs rename to cabal-install-lib/Distribution/Client/Types.hs diff --git a/cabal-install/Distribution/Client/Utils.hs b/cabal-install-lib/Distribution/Client/Utils.hs similarity index 100% rename from cabal-install/Distribution/Client/Utils.hs rename to cabal-install-lib/Distribution/Client/Utils.hs diff --git a/cabal-install/Distribution/Client/Utils/LabeledGraph.hs b/cabal-install-lib/Distribution/Client/Utils/LabeledGraph.hs similarity index 100% rename from cabal-install/Distribution/Client/Utils/LabeledGraph.hs rename to cabal-install-lib/Distribution/Client/Utils/LabeledGraph.hs diff --git a/cabal-install-lib/LICENSE b/cabal-install-lib/LICENSE new file mode 100644 index 00000000000..0407437e017 --- /dev/null +++ b/cabal-install-lib/LICENSE @@ -0,0 +1,30 @@ +Copyright (c) 2015, FIXME + +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 FIXME 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/cabal-install-lib/Setup.hs b/cabal-install-lib/Setup.hs new file mode 100644 index 00000000000..9a994af677b --- /dev/null +++ b/cabal-install-lib/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/cabal-install-lib/cabal-install-lib.cabal b/cabal-install-lib/cabal-install-lib.cabal new file mode 100644 index 00000000000..ea5f73f1231 --- /dev/null +++ b/cabal-install-lib/cabal-install-lib.cabal @@ -0,0 +1,73 @@ +name: cabal-install-lib +version: 1.23.0.0 +synopsis: Cabal-install client utility library +description: Various utilities needed by cabal-install +homepage: http://www.haskell.org/cabal/ +bug-reports: https://github.com/haskell/cabal/issues +license: BSD3 +license-file: LICENSE +author: Lemmih + Paolo Martini + Bjorn Bringert + Isaac Potoczny-Jones + Duncan Coutts +maintainer: FIXME +copyright: 2005 Lemmih + 2006 Paolo Martini + 2007 Bjorn Bringert + 2007 Isaac Potoczny-Jones + 2007-2012 Duncan Coutts +category: Distribution +build-type: Simple +cabal-version: >=1.10 + +Flag old-directory + description: Use directory < 1.2 and old-time + default: False + +Flag network-uri + description: Get Network.URI from the network-uri package + default: True + +library + ghc-options: -Wall -fwarn-tabs + exposed-modules: Distribution.Client.Utils, + Distribution.Client.Utils.LabeledGraph + Distribution.Client.Compat.FilePerms, + Distribution.Client.Compat.Time, + Distribution.Client.ComponentDeps, + Distribution.Client.PackageIndex, + Distribution.Client.PackageUtils, + Distribution.Client.Types + + other-extensions: ScopedTypeVariables + default-language: Haskell2010 + + -- NOTE: when updating build-depends, don't forget to update version regexps + -- in bootstrap.sh. + build-depends: array >= 0.1 && < 0.6, + base >= 4.3 && < 5, + bytestring >= 0.9 && < 1, + Cabal >= 1.23 && < 1.24, + containers >= 0.1 && < 0.6, + filepath >= 1.0 && < 1.5, + time >= 1.1 && < 1.6 + + if flag(old-directory) + build-depends: directory >= 1 && < 1.2, + old-time >= 1 && < 1.2, + process >= 1.0.1.1 && < 1.1.0.2 + else + build-depends: directory >= 1.2 && < 1.3, + process >= 1.1.0.2 && < 1.3 + + if flag(network-uri) + build-depends: network-uri >= 2.6, network >= 2.6 + else + build-depends: network-uri < 2.6, network < 2.6 + + if os(windows) + build-depends: Win32 >= 2 && < 3 + cpp-options: -DWIN32 + else + build-depends: unix >= 2.0 && < 2.8 diff --git a/cabal-install/Distribution/Client/Dependency/Modular.hs b/cabal-install-solver/Distribution/Client/Dependency/Modular.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Modular.hs rename to cabal-install-solver/Distribution/Client/Dependency/Modular.hs diff --git a/cabal-install/Distribution/Client/Dependency/Modular/Assignment.hs b/cabal-install-solver/Distribution/Client/Dependency/Modular/Assignment.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Modular/Assignment.hs rename to cabal-install-solver/Distribution/Client/Dependency/Modular/Assignment.hs diff --git a/cabal-install/Distribution/Client/Dependency/Modular/Builder.hs b/cabal-install-solver/Distribution/Client/Dependency/Modular/Builder.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Modular/Builder.hs rename to cabal-install-solver/Distribution/Client/Dependency/Modular/Builder.hs diff --git a/cabal-install/Distribution/Client/Dependency/Modular/Configured.hs b/cabal-install-solver/Distribution/Client/Dependency/Modular/Configured.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Modular/Configured.hs rename to cabal-install-solver/Distribution/Client/Dependency/Modular/Configured.hs diff --git a/cabal-install/Distribution/Client/Dependency/Modular/ConfiguredConversion.hs b/cabal-install-solver/Distribution/Client/Dependency/Modular/ConfiguredConversion.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Modular/ConfiguredConversion.hs rename to cabal-install-solver/Distribution/Client/Dependency/Modular/ConfiguredConversion.hs diff --git a/cabal-install/Distribution/Client/Dependency/Modular/Dependency.hs b/cabal-install-solver/Distribution/Client/Dependency/Modular/Dependency.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Modular/Dependency.hs rename to cabal-install-solver/Distribution/Client/Dependency/Modular/Dependency.hs diff --git a/cabal-install/Distribution/Client/Dependency/Modular/Explore.hs b/cabal-install-solver/Distribution/Client/Dependency/Modular/Explore.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Modular/Explore.hs rename to cabal-install-solver/Distribution/Client/Dependency/Modular/Explore.hs diff --git a/cabal-install/Distribution/Client/Dependency/Modular/Flag.hs b/cabal-install-solver/Distribution/Client/Dependency/Modular/Flag.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Modular/Flag.hs rename to cabal-install-solver/Distribution/Client/Dependency/Modular/Flag.hs diff --git a/cabal-install/Distribution/Client/Dependency/Modular/Index.hs b/cabal-install-solver/Distribution/Client/Dependency/Modular/Index.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Modular/Index.hs rename to cabal-install-solver/Distribution/Client/Dependency/Modular/Index.hs diff --git a/cabal-install/Distribution/Client/Dependency/Modular/IndexConversion.hs b/cabal-install-solver/Distribution/Client/Dependency/Modular/IndexConversion.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Modular/IndexConversion.hs rename to cabal-install-solver/Distribution/Client/Dependency/Modular/IndexConversion.hs diff --git a/cabal-install/Distribution/Client/Dependency/Modular/Linking.hs b/cabal-install-solver/Distribution/Client/Dependency/Modular/Linking.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Modular/Linking.hs rename to cabal-install-solver/Distribution/Client/Dependency/Modular/Linking.hs diff --git a/cabal-install/Distribution/Client/Dependency/Modular/Log.hs b/cabal-install-solver/Distribution/Client/Dependency/Modular/Log.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Modular/Log.hs rename to cabal-install-solver/Distribution/Client/Dependency/Modular/Log.hs diff --git a/cabal-install/Distribution/Client/Dependency/Modular/Message.hs b/cabal-install-solver/Distribution/Client/Dependency/Modular/Message.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Modular/Message.hs rename to cabal-install-solver/Distribution/Client/Dependency/Modular/Message.hs diff --git a/cabal-install/Distribution/Client/Dependency/Modular/PSQ.hs b/cabal-install-solver/Distribution/Client/Dependency/Modular/PSQ.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Modular/PSQ.hs rename to cabal-install-solver/Distribution/Client/Dependency/Modular/PSQ.hs diff --git a/cabal-install/Distribution/Client/Dependency/Modular/Package.hs b/cabal-install-solver/Distribution/Client/Dependency/Modular/Package.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Modular/Package.hs rename to cabal-install-solver/Distribution/Client/Dependency/Modular/Package.hs diff --git a/cabal-install/Distribution/Client/Dependency/Modular/Preference.hs b/cabal-install-solver/Distribution/Client/Dependency/Modular/Preference.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Modular/Preference.hs rename to cabal-install-solver/Distribution/Client/Dependency/Modular/Preference.hs diff --git a/cabal-install/Distribution/Client/Dependency/Modular/Solver.hs b/cabal-install-solver/Distribution/Client/Dependency/Modular/Solver.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Modular/Solver.hs rename to cabal-install-solver/Distribution/Client/Dependency/Modular/Solver.hs diff --git a/cabal-install/Distribution/Client/Dependency/Modular/Tree.hs b/cabal-install-solver/Distribution/Client/Dependency/Modular/Tree.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Modular/Tree.hs rename to cabal-install-solver/Distribution/Client/Dependency/Modular/Tree.hs diff --git a/cabal-install/Distribution/Client/Dependency/Modular/Validate.hs b/cabal-install-solver/Distribution/Client/Dependency/Modular/Validate.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Modular/Validate.hs rename to cabal-install-solver/Distribution/Client/Dependency/Modular/Validate.hs diff --git a/cabal-install/Distribution/Client/Dependency/Modular/Version.hs b/cabal-install-solver/Distribution/Client/Dependency/Modular/Version.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Modular/Version.hs rename to cabal-install-solver/Distribution/Client/Dependency/Modular/Version.hs diff --git a/cabal-install/Distribution/Client/Dependency/TopDown.hs b/cabal-install-solver/Distribution/Client/Dependency/TopDown.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/TopDown.hs rename to cabal-install-solver/Distribution/Client/Dependency/TopDown.hs diff --git a/cabal-install/Distribution/Client/Dependency/TopDown/Constraints.hs b/cabal-install-solver/Distribution/Client/Dependency/TopDown/Constraints.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/TopDown/Constraints.hs rename to cabal-install-solver/Distribution/Client/Dependency/TopDown/Constraints.hs diff --git a/cabal-install/Distribution/Client/Dependency/TopDown/Types.hs b/cabal-install-solver/Distribution/Client/Dependency/TopDown/Types.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/TopDown/Types.hs rename to cabal-install-solver/Distribution/Client/Dependency/TopDown/Types.hs diff --git a/cabal-install/Distribution/Client/Dependency/Types.hs b/cabal-install-solver/Distribution/Client/Dependency/Types.hs similarity index 100% rename from cabal-install/Distribution/Client/Dependency/Types.hs rename to cabal-install-solver/Distribution/Client/Dependency/Types.hs diff --git a/cabal-install-solver/LICENSE b/cabal-install-solver/LICENSE new file mode 100644 index 00000000000..0407437e017 --- /dev/null +++ b/cabal-install-solver/LICENSE @@ -0,0 +1,30 @@ +Copyright (c) 2015, FIXME + +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 FIXME 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/cabal-install-solver/Setup.hs b/cabal-install-solver/Setup.hs new file mode 100644 index 00000000000..9a994af677b --- /dev/null +++ b/cabal-install-solver/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/cabal-install-solver/cabal-install-solver.cabal b/cabal-install-solver/cabal-install-solver.cabal new file mode 100644 index 00000000000..23813f2f7d0 --- /dev/null +++ b/cabal-install-solver/cabal-install-solver.cabal @@ -0,0 +1,62 @@ +name: cabal-install-solver +version: 1.23.0.0 +synopsis: Dependency solvers for cabal-install +description: Dependency solvers for cabal-install +homepage: http://www.haskell.org/cabal/ +license: BSD3 +license-file: LICENSE +author: Lemmih + Paolo Martini + Bjorn Bringert + Isaac Potoczny-Jones + Duncan Coutts +maintainer: cabal-devel@haskell.org +copyright: 2005 Lemmih + 2006 Paolo Martini + 2007 Bjorn Bringert + 2007 Isaac Potoczny-Jones + 2007-2012 Duncan Coutts +category: Distribution +build-type: Simple +cabal-version: >=1.10 + +library + ghc-options: -Wall -fwarn-tabs + exposed-modules: Distribution.Client.Dependency.Types, + Distribution.Client.Dependency.TopDown, + Distribution.Client.Dependency.Modular + + other-modules: Distribution.Client.Dependency.TopDown.Types, + Distribution.Client.Dependency.TopDown.Constraints, + Distribution.Client.Dependency.Modular.IndexConversion, + Distribution.Client.Dependency.Modular.Configured, + Distribution.Client.Dependency.Modular.Builder, + Distribution.Client.Dependency.Modular.Dependency, + Distribution.Client.Dependency.Modular.Solver, + Distribution.Client.Dependency.Modular.Explore, + Distribution.Client.Dependency.Modular.Assignment, + Distribution.Client.Dependency.Modular.Flag, + Distribution.Client.Dependency.Modular.Version, + Distribution.Client.Dependency.Modular.Tree, + Distribution.Client.Dependency.Modular.Linking, + Distribution.Client.Dependency.Modular.ConfiguredConversion, + Distribution.Client.Dependency.Modular.PSQ, + Distribution.Client.Dependency.Modular.Message, + Distribution.Client.Dependency.Modular.Log, + Distribution.Client.Dependency.Modular.Package, + Distribution.Client.Dependency.Modular.Index, + Distribution.Client.Dependency.Modular.Preference, + Distribution.Client.Dependency.Modular.Validate + + -- NOTE: when updating build-depends, don't forget to update version regexps + -- in bootstrap.sh. + build-depends: base >= 4.3 && <5, + Cabal >= 1.22 && <1.24, + cabal-install-lib >= 1.22 && <1.24, + pretty >= 1.1 && <1.2, + containers >= 0.5 && <0.6, + array >= 0.5 && <0.6, + mtl >= 2.2 && <2.3 + + default-language: Haskell2010 + other-extensions: CPP, DeriveFunctor, RecordWildCards, DeriveFoldable, DeriveTraversable, GeneralizedNewtypeDeriving diff --git a/cabal-install/cabal-install.cabal b/cabal-install/cabal-install.cabal index 1f14522403f..cba7b4d30f8 100644 --- a/cabal-install/cabal-install.cabal +++ b/cabal-install/cabal-install.cabal @@ -51,34 +51,9 @@ executable cabal Distribution.Client.BuildReports.Types Distribution.Client.BuildReports.Upload Distribution.Client.Check - Distribution.Client.ComponentDeps Distribution.Client.Config Distribution.Client.Configure Distribution.Client.Dependency - Distribution.Client.Dependency.TopDown - Distribution.Client.Dependency.TopDown.Constraints - Distribution.Client.Dependency.TopDown.Types - Distribution.Client.Dependency.Types - Distribution.Client.Dependency.Modular - Distribution.Client.Dependency.Modular.Assignment - Distribution.Client.Dependency.Modular.Builder - Distribution.Client.Dependency.Modular.Configured - Distribution.Client.Dependency.Modular.ConfiguredConversion - Distribution.Client.Dependency.Modular.Dependency - Distribution.Client.Dependency.Modular.Explore - Distribution.Client.Dependency.Modular.Flag - Distribution.Client.Dependency.Modular.Index - Distribution.Client.Dependency.Modular.IndexConversion - Distribution.Client.Dependency.Modular.Linking - Distribution.Client.Dependency.Modular.Log - Distribution.Client.Dependency.Modular.Message - Distribution.Client.Dependency.Modular.Package - Distribution.Client.Dependency.Modular.Preference - Distribution.Client.Dependency.Modular.PSQ - Distribution.Client.Dependency.Modular.Solver - Distribution.Client.Dependency.Modular.Tree - Distribution.Client.Dependency.Modular.Validate - Distribution.Client.Dependency.Modular.Version Distribution.Client.Exec Distribution.Client.Fetch Distribution.Client.FetchUtils @@ -97,8 +72,6 @@ executable cabal Distribution.Client.InstallSymlink Distribution.Client.JobControl Distribution.Client.List - Distribution.Client.PackageIndex - Distribution.Client.PackageUtils Distribution.Client.ParseUtils Distribution.Client.PlanIndex Distribution.Client.Run @@ -112,36 +85,33 @@ executable cabal Distribution.Client.SrcDist Distribution.Client.Tar Distribution.Client.Targets - Distribution.Client.Types Distribution.Client.Update Distribution.Client.Upload - Distribution.Client.Utils - Distribution.Client.Utils.LabeledGraph Distribution.Client.World Distribution.Client.Win32SelfUpgrade Distribution.Client.Compat.ExecutablePath - Distribution.Client.Compat.FilePerms Distribution.Client.Compat.Process Distribution.Client.Compat.Semaphore - Distribution.Client.Compat.Time Paths_cabal_install -- NOTE: when updating build-depends, don't forget to update version regexps -- in bootstrap.sh. build-depends: - array >= 0.1 && < 0.6, - base >= 4.3 && < 5, - bytestring >= 0.9 && < 1, - Cabal >= 1.23 && < 1.24, - containers >= 0.1 && < 0.6, - filepath >= 1.0 && < 1.5, - HTTP >= 4000.1.5 && < 4000.3, - mtl >= 2.0 && < 3, - pretty >= 1 && < 1.2, - random >= 1 && < 1.2, - stm >= 2.0 && < 3, - time >= 1.1 && < 1.6, - zlib >= 0.5.3 && < 0.7 + array >= 0.1 && < 0.6, + base >= 4.3 && < 5, + bytestring >= 0.9 && < 1, + Cabal >= 1.23 && < 1.24, + cabal-install-lib >= 1.23 && < 1.24, + cabal-install-solver >= 1.23 && < 1.24, + containers >= 0.1 && < 0.6, + filepath >= 1.0 && < 1.5, + HTTP >= 4000.1.5 && < 4000.3, + mtl >= 2.0 && < 3, + pretty >= 1 && < 1.2, + random >= 1 && < 1.2, + stm >= 2.0 && < 3, + time >= 1.1 && < 1.6, + zlib >= 0.5.3 && < 0.7 if flag(old-directory) build-depends: directory >= 1 && < 1.2, old-time >= 1 && < 1.2, From 18c5fe9e469d4fc66a4758f1a1ad273db3b06117 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Sun, 16 Aug 2015 17:36:22 +0200 Subject: [PATCH 2/6] Move Distribution.Client.Dependency to cabal-install-solver This involves doing some surgery to factor out the sandbox bits. --- .../Distribution/Client/Dependency.hs | 87 +-------------- .../Distribution/Client/InstallPlan.hs | 0 .../Distribution/Client/PlanIndex.hs | 0 .../cabal-install-solver.cabal | 7 +- .../Distribution/Client/Configure.hs | 1 + .../Client/Dependency/Policies.hs | 105 ++++++++++++++++++ cabal-install/Distribution/Client/Fetch.hs | 1 + cabal-install/Distribution/Client/Freeze.hs | 1 + cabal-install/Distribution/Client/Get.hs | 1 + cabal-install/Distribution/Client/Install.hs | 1 + cabal-install/cabal-install.cabal | 4 +- 11 files changed, 122 insertions(+), 86 deletions(-) rename {cabal-install => cabal-install-solver}/Distribution/Client/Dependency.hs (92%) rename {cabal-install => cabal-install-solver}/Distribution/Client/InstallPlan.hs (100%) rename {cabal-install => cabal-install-solver}/Distribution/Client/PlanIndex.hs (100%) create mode 100644 cabal-install/Distribution/Client/Dependency/Policies.hs diff --git a/cabal-install/Distribution/Client/Dependency.hs b/cabal-install-solver/Distribution/Client/Dependency.hs similarity index 92% rename from cabal-install/Distribution/Client/Dependency.hs rename to cabal-install-solver/Distribution/Client/Dependency.hs index 36142ded385..2c50b823b29 100644 --- a/cabal-install/Distribution/Client/Dependency.hs +++ b/cabal-install-solver/Distribution/Client/Dependency.hs @@ -29,13 +29,6 @@ module Distribution.Client.Dependency ( PackagePreference(..), InstalledPreference(..), - -- ** Standard policy - standardInstallPolicy, - PackageSpecifier(..), - - -- ** Sandbox policy - applySandboxInstallPolicy, - -- ** Extra policy options dontUpgradeNonUpgradeablePackages, hideBrokenInstalledPackages, @@ -44,6 +37,7 @@ module Distribution.Client.Dependency ( -- ** Policy utils addConstraints, + addTargets, addPreferences, setPreferenceDefault, setReorderGoals, @@ -56,7 +50,8 @@ module Distribution.Client.Dependency ( hideInstalledPackagesSpecificByInstalledPackageId, hideInstalledPackagesSpecificBySourcePackageId, hideInstalledPackagesAllVersions, - removeUpperBounds + removeUpperBounds, + basicDepResolverParams ) where import Distribution.Client.Dependency.TopDown @@ -69,8 +64,8 @@ import qualified Distribution.Simple.PackageIndex as InstalledPackageIndex import qualified Distribution.Client.InstallPlan as InstallPlan import Distribution.Client.InstallPlan (InstallPlan) import Distribution.Client.Types - ( SourcePackageDb(SourcePackageDb), SourcePackage(..) - , ConfiguredPackage(..), ConfiguredId(..), enableStanzas ) + ( SourcePackage(..), ConfiguredPackage(..), ConfiguredId(..) + , enableStanzas ) import Distribution.Client.Dependency.Types ( PreSolver(..), Solver(..), DependencyResolver, ResolverPackage(..) , PackageConstraint(..), showPackageConstraint @@ -79,9 +74,6 @@ import Distribution.Client.Dependency.Types , AllowNewer(..), PackagePreferences(..), InstalledPreference(..) , PackagesPreferenceDefault(..) , Progress(..), foldProgress ) -import Distribution.Client.Sandbox.Types - ( SandboxPackageInfo(..) ) -import Distribution.Client.Targets import Distribution.Client.ComponentDeps (ComponentDeps) import qualified Distribution.Client.ComponentDeps as CD import qualified Distribution.InstalledPackageInfo as Installed @@ -100,7 +92,7 @@ import Distribution.PackageDescription.Configuration import Distribution.Client.PackageUtils ( externalBuildDepends ) import Distribution.Version - ( VersionRange, anyVersion, thisVersion, withinRange + ( VersionRange, anyVersion, withinRange , removeUpperBound, simplifyVersionRange ) import Distribution.Compiler ( CompilerInfo(..) ) @@ -438,73 +430,6 @@ reinstallTargets params = hideInstalledPackagesAllVersions (depResolverTargets params) params -standardInstallPolicy :: InstalledPackageIndex - -> SourcePackageDb - -> [PackageSpecifier SourcePackage] - -> DepResolverParams -standardInstallPolicy - installedPkgIndex (SourcePackageDb sourcePkgIndex sourcePkgPrefs) - pkgSpecifiers - - = addPreferences - [ PackageVersionPreference name ver - | (name, ver) <- Map.toList sourcePkgPrefs ] - - . addConstraints - (concatMap pkgSpecifierConstraints pkgSpecifiers) - - . addTargets - (map pkgSpecifierTarget pkgSpecifiers) - - . hideInstalledPackagesSpecificBySourcePackageId - [ packageId pkg | SpecificSourcePackage pkg <- pkgSpecifiers ] - - . addSourcePackages - [ pkg | SpecificSourcePackage pkg <- pkgSpecifiers ] - - $ basicDepResolverParams - installedPkgIndex sourcePkgIndex - -applySandboxInstallPolicy :: SandboxPackageInfo - -> DepResolverParams - -> DepResolverParams -applySandboxInstallPolicy - (SandboxPackageInfo modifiedDeps otherDeps allSandboxPkgs _allDeps) - params - - = addPreferences [ PackageInstalledPreference n PreferInstalled - | n <- installedNotModified ] - - . addTargets installedNotModified - - . addPreferences - [ PackageVersionPreference (packageName pkg) - (thisVersion (packageVersion pkg)) | pkg <- otherDeps ] - - . addConstraints - [ let pc = PackageConstraintVersion (packageName pkg) - (thisVersion (packageVersion pkg)) - in LabeledPackageConstraint pc ConstraintSourceModifiedAddSourceDep - | pkg <- modifiedDeps ] - - . addTargets [ packageName pkg | pkg <- modifiedDeps ] - - . hideInstalledPackagesSpecificBySourcePackageId - [ packageId pkg | pkg <- modifiedDeps ] - - -- We don't need to add source packages for add-source deps to the - -- 'installedPkgIndex' since 'getSourcePackages' did that for us. - - $ params - - where - installedPkgIds = - map fst . InstalledPackageIndex.allPackagesBySourcePackageId - $ allSandboxPkgs - modifiedPkgIds = map packageId modifiedDeps - installedNotModified = [ packageName pkg | pkg <- installedPkgIds, - pkg `notElem` modifiedPkgIds ] - -- ------------------------------------------------------------ -- * Interface to the standard resolver -- ------------------------------------------------------------ diff --git a/cabal-install/Distribution/Client/InstallPlan.hs b/cabal-install-solver/Distribution/Client/InstallPlan.hs similarity index 100% rename from cabal-install/Distribution/Client/InstallPlan.hs rename to cabal-install-solver/Distribution/Client/InstallPlan.hs diff --git a/cabal-install/Distribution/Client/PlanIndex.hs b/cabal-install-solver/Distribution/Client/PlanIndex.hs similarity index 100% rename from cabal-install/Distribution/Client/PlanIndex.hs rename to cabal-install-solver/Distribution/Client/PlanIndex.hs diff --git a/cabal-install-solver/cabal-install-solver.cabal b/cabal-install-solver/cabal-install-solver.cabal index 23813f2f7d0..4c1b07f0ee0 100644 --- a/cabal-install-solver/cabal-install-solver.cabal +++ b/cabal-install-solver/cabal-install-solver.cabal @@ -22,9 +22,12 @@ cabal-version: >=1.10 library ghc-options: -Wall -fwarn-tabs - exposed-modules: Distribution.Client.Dependency.Types, + exposed-modules: Distribution.Client.Dependency + Distribution.Client.Dependency.Types, Distribution.Client.Dependency.TopDown, - Distribution.Client.Dependency.Modular + Distribution.Client.Dependency.Modular, + Distribution.Client.InstallPlan, + Distribution.Client.PlanIndex other-modules: Distribution.Client.Dependency.TopDown.Types, Distribution.Client.Dependency.TopDown.Constraints, diff --git a/cabal-install/Distribution/Client/Configure.hs b/cabal-install/Distribution/Client/Configure.hs index ba416492c06..3e27faf7046 100644 --- a/cabal-install/Distribution/Client/Configure.hs +++ b/cabal-install/Distribution/Client/Configure.hs @@ -18,6 +18,7 @@ module Distribution.Client.Configure ( ) where import Distribution.Client.Dependency +import Distribution.Client.Dependency.Policies import Distribution.Client.Dependency.Types ( AllowNewer(..), isAllowNewer, ConstraintSource(..) , LabeledPackageConstraint(..) ) diff --git a/cabal-install/Distribution/Client/Dependency/Policies.hs b/cabal-install/Distribution/Client/Dependency/Policies.hs new file mode 100644 index 00000000000..12eeeaab463 --- /dev/null +++ b/cabal-install/Distribution/Client/Dependency/Policies.hs @@ -0,0 +1,105 @@ +----------------------------------------------------------------------------- +-- | +-- Module : Distribution.Client.Dependency.Policies +-- Copyright : (c) David Himmelstrup 2005, +-- Bjorn Bringert 2007 +-- Duncan Coutts 2008 +-- License : BSD-like +-- +-- Maintainer : cabal-devel@gmail.com +-- Stability : provisional +-- Portability : portable +-- +-- Dependency resolution policies +----------------------------------------------------------------------------- + +module Distribution.Client.Dependency.Policies ( + -- ** Standard policy + standardInstallPolicy, + PackageSpecifier(..), + + -- ** Sandbox policy + applySandboxInstallPolicy, + ) where + +import Distribution.Simple.PackageIndex (InstalledPackageIndex) +import Distribution.Package +import Distribution.Version +import Distribution.Client.Dependency +import Distribution.Client.Dependency.Types + ( LabeledPackageConstraint(..), ConstraintSource(..) ) +import qualified Distribution.Simple.PackageIndex as InstalledPackageIndex +import Distribution.Client.Targets +import Distribution.Client.Sandbox.Types + ( SandboxPackageInfo(..) ) +import Distribution.Client.Types + ( SourcePackageDb(SourcePackageDb), SourcePackage(..) ) + +import qualified Data.Map as Map + +standardInstallPolicy :: InstalledPackageIndex + -> SourcePackageDb + -> [PackageSpecifier SourcePackage] + -> DepResolverParams +standardInstallPolicy + installedPkgIndex (SourcePackageDb sourcePkgIndex sourcePkgPrefs) + pkgSpecifiers + + = addPreferences + [ PackageVersionPreference name ver + | (name, ver) <- Map.toList sourcePkgPrefs ] + + . addConstraints + (concatMap pkgSpecifierConstraints pkgSpecifiers) + + . addTargets + (map pkgSpecifierTarget pkgSpecifiers) + + . hideInstalledPackagesSpecificBySourcePackageId + [ packageId pkg | SpecificSourcePackage pkg <- pkgSpecifiers ] + + . addSourcePackages + [ pkg | SpecificSourcePackage pkg <- pkgSpecifiers ] + + $ basicDepResolverParams + installedPkgIndex sourcePkgIndex + +applySandboxInstallPolicy :: SandboxPackageInfo + -> DepResolverParams + -> DepResolverParams +applySandboxInstallPolicy + (SandboxPackageInfo modifiedDeps otherDeps allSandboxPkgs _allDeps) + params + + = addPreferences [ PackageInstalledPreference n PreferInstalled + | n <- installedNotModified ] + + . addTargets installedNotModified + + . addPreferences + [ PackageVersionPreference (packageName pkg) + (thisVersion (packageVersion pkg)) | pkg <- otherDeps ] + + . addConstraints + [ let pc = PackageConstraintVersion (packageName pkg) + (thisVersion (packageVersion pkg)) + in LabeledPackageConstraint pc ConstraintSourceModifiedAddSourceDep + | pkg <- modifiedDeps ] + + . addTargets [ packageName pkg | pkg <- modifiedDeps ] + + . hideInstalledPackagesSpecificBySourcePackageId + [ packageId pkg | pkg <- modifiedDeps ] + + -- We don't need to add source packages for add-source deps to the + -- 'installedPkgIndex' since 'getSourcePackages' did that for us. + + $ params + + where + installedPkgIds = + map fst . InstalledPackageIndex.allPackagesBySourcePackageId + $ allSandboxPkgs + modifiedPkgIds = map packageId modifiedDeps + installedNotModified = [ packageName pkg | pkg <- installedPkgIds, + pkg `notElem` modifiedPkgIds ] diff --git a/cabal-install/Distribution/Client/Fetch.hs b/cabal-install/Distribution/Client/Fetch.hs index 541e33d60ba..de4ae31179c 100644 --- a/cabal-install/Distribution/Client/Fetch.hs +++ b/cabal-install/Distribution/Client/Fetch.hs @@ -19,6 +19,7 @@ import Distribution.Client.Types import Distribution.Client.Targets import Distribution.Client.FetchUtils hiding (fetchPackage) import Distribution.Client.Dependency +import Distribution.Client.Dependency.Policies import Distribution.Client.IndexUtils as IndexUtils ( getSourcePackages, getInstalledPackages ) import Distribution.Client.HttpUtils diff --git a/cabal-install/Distribution/Client/Freeze.hs b/cabal-install/Distribution/Client/Freeze.hs index 04820e8af6b..b41b943880e 100644 --- a/cabal-install/Distribution/Client/Freeze.hs +++ b/cabal-install/Distribution/Client/Freeze.hs @@ -20,6 +20,7 @@ import Distribution.Client.Config ( SavedConfig(..) ) import Distribution.Client.Types import Distribution.Client.Targets import Distribution.Client.Dependency +import Distribution.Client.Dependency.Policies import Distribution.Client.Dependency.Types ( ConstraintSource(..), LabeledPackageConstraint(..) ) import Distribution.Client.IndexUtils as IndexUtils diff --git a/cabal-install/Distribution/Client/Get.hs b/cabal-install/Distribution/Client/Get.hs index a2b882f2884..897167cd5cd 100644 --- a/cabal-install/Distribution/Client/Get.hs +++ b/cabal-install/Distribution/Client/Get.hs @@ -34,6 +34,7 @@ import Distribution.Client.Setup import Distribution.Client.Types import Distribution.Client.Targets import Distribution.Client.Dependency +import Distribution.Client.Dependency.Policies import Distribution.Client.FetchUtils import Distribution.Client.HttpUtils ( configureTransport, HttpTransport(..) ) diff --git a/cabal-install/Distribution/Client/Install.hs b/cabal-install/Distribution/Client/Install.hs index 009627f7ef7..fc0a10dbc8f 100644 --- a/cabal-install/Distribution/Client/Install.hs +++ b/cabal-install/Distribution/Client/Install.hs @@ -69,6 +69,7 @@ import Distribution.Client.Targets import Distribution.Client.Configure ( chooseCabalVersion, configureSetupScript ) import Distribution.Client.Dependency +import Distribution.Client.Dependency.Policies import Distribution.Client.Dependency.Types ( Solver(..), ConstraintSource(..), LabeledPackageConstraint(..) ) import Distribution.Client.FetchUtils diff --git a/cabal-install/cabal-install.cabal b/cabal-install/cabal-install.cabal index cba7b4d30f8..888de1e20bb 100644 --- a/cabal-install/cabal-install.cabal +++ b/cabal-install/cabal-install.cabal @@ -53,7 +53,7 @@ executable cabal Distribution.Client.Check Distribution.Client.Config Distribution.Client.Configure - Distribution.Client.Dependency + Distribution.Client.Dependency.Policies Distribution.Client.Exec Distribution.Client.Fetch Distribution.Client.FetchUtils @@ -68,12 +68,10 @@ executable cabal Distribution.Client.Init.Licenses Distribution.Client.Init.Types Distribution.Client.Install - Distribution.Client.InstallPlan Distribution.Client.InstallSymlink Distribution.Client.JobControl Distribution.Client.List Distribution.Client.ParseUtils - Distribution.Client.PlanIndex Distribution.Client.Run Distribution.Client.Sandbox Distribution.Client.Sandbox.Index From 30b1cf678d560799ac4a7b5e32928114f2f99bfa Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Sun, 16 Aug 2015 18:21:06 +0200 Subject: [PATCH 3/6] bootstrap: Add support for cabal-install-* packages --- cabal-install/bootstrap.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cabal-install/bootstrap.sh b/cabal-install/bootstrap.sh index 7c9ba72709a..94c266c46d9 100755 --- a/cabal-install/bootstrap.sh +++ b/cabal-install/bootstrap.sh @@ -209,6 +209,10 @@ OLD_TIME_VER="1.1.0.3"; OLD_TIME_VER_REGEXP="1\.[01]\.?" # >=1.0.0.0 && <1.2 OLD_LOCALE_VER="1.0.0.7"; OLD_LOCALE_VER_REGEXP="1\.0\.?" # >=1.0.0.0 && <1.1 +CABAL_INSTALL_LIB_VER="1.23.0.0"; CABAL_INSTALL_LIB_VER_REGEXP="1\.23\.?" + # >= 1.23 && < 1.24 +CABAL_INSTALL_SOLVER_VER="1.23.0.0"; CABAL_INSTALL_SOLVER_VER_REGEXP="1\.23\.?" + # >= 1.23 && < 1.24 HACKAGE_URL="https://hackage.haskell.org/package" @@ -378,6 +382,8 @@ info_pkg "HTTP" ${HTTP_VER} ${HTTP_VER_REGEXP} info_pkg "zlib" ${ZLIB_VER} ${ZLIB_VER_REGEXP} info_pkg "random" ${RANDOM_VER} ${RANDOM_VER_REGEXP} info_pkg "stm" ${STM_VER} ${STM_VER_REGEXP} +info_pkg "cabal-install-lib" ${CABAL_INSTALL_LIB_VER} ${CABAL_INSTALL_LIB_VER_REGEXP} +info_pkg "cabal-install-solve" ${CABAL_INSTALL_SOLVE_VER} ${CABAL_INSTALL_SOLVE_VER_REGEXP} do_pkg "deepseq" ${DEEPSEQ_VER} ${DEEPSEQ_VER_REGEXP} do_pkg "binary" ${BINARY_VER} ${BINARY_VER_REGEXP} @@ -398,6 +404,8 @@ do_pkg "HTTP" ${HTTP_VER} ${HTTP_VER_REGEXP} do_pkg "zlib" ${ZLIB_VER} ${ZLIB_VER_REGEXP} do_pkg "random" ${RANDOM_VER} ${RANDOM_VER_REGEXP} do_pkg "stm" ${STM_VER} ${STM_VER_REGEXP} +do_pkg "cabal-install-lib" ${CABAL_INSTALL_LIB_VER} ${CABAL_INSTALL_LIB_VER_REGEXP} +do_pkg "cabal-install-solve" ${CABAL_INSTALL_SOLVE_VER} ${CABAL_INSTALL_SOLVE_VER_REGEXP} install_pkg "cabal-install" From a82456495b52df538d6cd6c855ff35aa890569c3 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Sun, 16 Aug 2015 19:53:29 +0200 Subject: [PATCH 4/6] Fix cabal bounds --- cabal-install-lib/cabal-install-lib.cabal | 2 +- cabal-install-solver/cabal-install-solver.cabal | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cabal-install-lib/cabal-install-lib.cabal b/cabal-install-lib/cabal-install-lib.cabal index ea5f73f1231..493251151c7 100644 --- a/cabal-install-lib/cabal-install-lib.cabal +++ b/cabal-install-lib/cabal-install-lib.cabal @@ -48,7 +48,7 @@ library build-depends: array >= 0.1 && < 0.6, base >= 4.3 && < 5, bytestring >= 0.9 && < 1, - Cabal >= 1.23 && < 1.24, + Cabal >= 1.22 && < 1.24, containers >= 0.1 && < 0.6, filepath >= 1.0 && < 1.5, time >= 1.1 && < 1.6 diff --git a/cabal-install-solver/cabal-install-solver.cabal b/cabal-install-solver/cabal-install-solver.cabal index 4c1b07f0ee0..bc5df18ea27 100644 --- a/cabal-install-solver/cabal-install-solver.cabal +++ b/cabal-install-solver/cabal-install-solver.cabal @@ -53,13 +53,13 @@ library -- NOTE: when updating build-depends, don't forget to update version regexps -- in bootstrap.sh. - build-depends: base >= 4.3 && <5, + build-depends: array >= 0.1 && <0.6, + base >= 4.3 && <5, Cabal >= 1.22 && <1.24, cabal-install-lib >= 1.22 && <1.24, - pretty >= 1.1 && <1.2, - containers >= 0.5 && <0.6, - array >= 0.5 && <0.6, - mtl >= 2.2 && <2.3 + containers >= 0.1 && <0.6, + mtl >= 2.0 && <2.3, + pretty >= 1 && <1.2 default-language: Haskell2010 other-extensions: CPP, DeriveFunctor, RecordWildCards, DeriveFoldable, DeriveTraversable, GeneralizedNewtypeDeriving From ade3d4c39a1764901a6e468becde53672f249226 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Mon, 17 Aug 2015 00:12:13 +0200 Subject: [PATCH 5/6] cabal-install: Add missing imports to unit tests --- cabal-install/cabal-install.cabal | 2 ++ cabal-install/tests/UnitTests.hs | 1 + .../UnitTests/Distribution/Client/Dependency/Modular/DSL.hs | 1 + 3 files changed, 4 insertions(+) diff --git a/cabal-install/cabal-install.cabal b/cabal-install/cabal-install.cabal index 888de1e20bb..e49b1a86742 100644 --- a/cabal-install/cabal-install.cabal +++ b/cabal-install/cabal-install.cabal @@ -160,6 +160,8 @@ Test-Suite unit-tests array, bytestring, Cabal, + cabal-install-lib, + cabal-install-solver, containers, mtl, pretty, diff --git a/cabal-install/tests/UnitTests.hs b/cabal-install/tests/UnitTests.hs index 05783ec84f7..7787a7c06e5 100644 --- a/cabal-install/tests/UnitTests.hs +++ b/cabal-install/tests/UnitTests.hs @@ -23,6 +23,7 @@ tests = testGroup "Unit Tests" [ UnitTests.Distribution.Client.GZipUtils.tests ,testGroup "UnitTests.Distribution.Client.Dependency.Modular.PSQ" UnitTests.Distribution.Client.Dependency.Modular.PSQ.tests + -- TODO: Move this to cabal-install-solver once policies are moved elsewhere ,testGroup "UnitTests.Distribution.Client.Dependency.Modular.Solver" UnitTests.Distribution.Client.Dependency.Modular.Solver.tests ] diff --git a/cabal-install/tests/UnitTests/Distribution/Client/Dependency/Modular/DSL.hs b/cabal-install/tests/UnitTests/Distribution/Client/Dependency/Modular/DSL.hs index d76270f8ea4..ff659b41fa1 100644 --- a/cabal-install/tests/UnitTests/Distribution/Client/Dependency/Modular/DSL.hs +++ b/cabal-install/tests/UnitTests/Distribution/Client/Dependency/Modular/DSL.hs @@ -30,6 +30,7 @@ import qualified Distribution.Version as C -- cabal-install import Distribution.Client.ComponentDeps (ComponentDeps) import Distribution.Client.Dependency +import Distribution.Client.Dependency.Policies import Distribution.Client.Dependency.Types import Distribution.Client.Types import qualified Distribution.Client.InstallPlan as CI.InstallPlan From ec38e9afdb5983b08aa1e4239cb0a75f653f0b85 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Mon, 17 Aug 2015 00:27:01 +0200 Subject: [PATCH 6/6] Move Modular.PSQ test to cabal-install-solver --- .../cabal-install-solver.cabal | 21 +++++++++++++++++++ cabal-install-solver/tests/UnitTests.hs | 15 +++++++++++++ .../Client/Dependency/Modular/PSQ.hs | 0 cabal-install/cabal-install.cabal | 1 - cabal-install/tests/UnitTests.hs | 3 --- 5 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 cabal-install-solver/tests/UnitTests.hs rename {cabal-install => cabal-install-solver}/tests/UnitTests/Distribution/Client/Dependency/Modular/PSQ.hs (100%) diff --git a/cabal-install-solver/cabal-install-solver.cabal b/cabal-install-solver/cabal-install-solver.cabal index bc5df18ea27..b6a4c1d1b0a 100644 --- a/cabal-install-solver/cabal-install-solver.cabal +++ b/cabal-install-solver/cabal-install-solver.cabal @@ -63,3 +63,24 @@ library default-language: Haskell2010 other-extensions: CPP, DeriveFunctor, RecordWildCards, DeriveFoldable, DeriveTraversable, GeneralizedNewtypeDeriving + +Test-Suite unit-tests + type: exitcode-stdio-1.0 + main-is: UnitTests.hs + hs-source-dirs: tests, . + ghc-options: -Wall -fwarn-tabs + other-modules: + UnitTests.Distribution.Client.Dependency.Modular.PSQ + build-depends: + base, + array, + Cabal, + cabal-install-lib, + containers, + mtl, + pretty, + tasty, + tasty-hunit, + tasty-quickcheck, + tagged, + QuickCheck >= 2.5 \ No newline at end of file diff --git a/cabal-install-solver/tests/UnitTests.hs b/cabal-install-solver/tests/UnitTests.hs new file mode 100644 index 00000000000..50e6ba2658d --- /dev/null +++ b/cabal-install-solver/tests/UnitTests.hs @@ -0,0 +1,15 @@ +module Main + where + +import Test.Tasty + +import qualified UnitTests.Distribution.Client.Dependency.Modular.PSQ + +tests :: TestTree +tests = testGroup "Unit Tests" [ + testGroup "UnitTests.Distribution.Client.Dependency.Modular.PSQ" + UnitTests.Distribution.Client.Dependency.Modular.PSQ.tests + ] + +main :: IO () +main = defaultMainWithIngredients defaultIngredients tests diff --git a/cabal-install/tests/UnitTests/Distribution/Client/Dependency/Modular/PSQ.hs b/cabal-install-solver/tests/UnitTests/Distribution/Client/Dependency/Modular/PSQ.hs similarity index 100% rename from cabal-install/tests/UnitTests/Distribution/Client/Dependency/Modular/PSQ.hs rename to cabal-install-solver/tests/UnitTests/Distribution/Client/Dependency/Modular/PSQ.hs diff --git a/cabal-install/cabal-install.cabal b/cabal-install/cabal-install.cabal index e49b1a86742..a39a05114a3 100644 --- a/cabal-install/cabal-install.cabal +++ b/cabal-install/cabal-install.cabal @@ -149,7 +149,6 @@ Test-Suite unit-tests ghc-options: -Wall -fwarn-tabs other-modules: UnitTests.Distribution.Client.Targets - UnitTests.Distribution.Client.Dependency.Modular.PSQ UnitTests.Distribution.Client.Dependency.Modular.Solver UnitTests.Distribution.Client.Dependency.Modular.DSL UnitTests.Distribution.Client.GZipUtils diff --git a/cabal-install/tests/UnitTests.hs b/cabal-install/tests/UnitTests.hs index 7787a7c06e5..341fb61ae21 100644 --- a/cabal-install/tests/UnitTests.hs +++ b/cabal-install/tests/UnitTests.hs @@ -8,7 +8,6 @@ import qualified UnitTests.Distribution.Client.Sandbox import qualified UnitTests.Distribution.Client.UserConfig import qualified UnitTests.Distribution.Client.Targets import qualified UnitTests.Distribution.Client.GZipUtils -import qualified UnitTests.Distribution.Client.Dependency.Modular.PSQ import qualified UnitTests.Distribution.Client.Dependency.Modular.Solver tests :: TestTree @@ -21,8 +20,6 @@ tests = testGroup "Unit Tests" [ UnitTests.Distribution.Client.Targets.tests ,testGroup "Distribution.Client.GZipUtils" UnitTests.Distribution.Client.GZipUtils.tests - ,testGroup "UnitTests.Distribution.Client.Dependency.Modular.PSQ" - UnitTests.Distribution.Client.Dependency.Modular.PSQ.tests -- TODO: Move this to cabal-install-solver once policies are moved elsewhere ,testGroup "UnitTests.Distribution.Client.Dependency.Modular.Solver" UnitTests.Distribution.Client.Dependency.Modular.Solver.tests