diff --git a/.github/workflows/changelogs.yml b/.github/workflows/changelogs.yml index 0ee8da9fda3378dd5a0f616700f8d156826d7c4a..425e5117188e50f030b9354efe22ac04ccb270ba 100644 --- a/.github/workflows/changelogs.yml +++ b/.github/workflows/changelogs.yml @@ -29,7 +29,7 @@ jobs: # 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 - - uses: actions/cache@v1 + - uses: actions/cache@v3 with: path: ~/.cabal/store key: linux-store-changelogs diff --git a/.github/workflows/quick-jobs.yml b/.github/workflows/quick-jobs.yml index 633c9842fe85e13771b41bc994b5c5d5c906554e..c36db9bd68951749ad885b250fac02581f9fbada 100644 --- a/.github/workflows/quick-jobs.yml +++ b/.github/workflows/quick-jobs.yml @@ -24,7 +24,7 @@ jobs: # 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 - - uses: actions/cache@v1 + - uses: actions/cache@v3 with: path: ~/.cabal/store key: linux-store-meta @@ -65,7 +65,7 @@ jobs: - name: Set PATH run: | echo "$HOME/.cabal/bin" >> $GITHUB_PATH - - uses: actions/cache@v1 + - uses: actions/cache@v3 with: path: ~/.cabal/store key: linux-store-doctest diff --git a/.github/workflows/users-guide.yml b/.github/workflows/users-guide.yml index 5b56c25266bfc257cb5b915dce2cf8beb0968f7d..cd8137fbc38338ab0e8960f985dca95913566e5a 100644 --- a/.github/workflows/users-guide.yml +++ b/.github/workflows/users-guide.yml @@ -46,7 +46,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7] + python-version: ['3.10'] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 317870c0fd13b097f2f5b572afa81059e08346d7..48f10d09e91ccf14735a784bfce44d9d6b120dab 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -78,7 +78,7 @@ jobs: # # See https://github.com/haskell/cabal/pull/8739 for why Windows is excluded - if: ${{ runner.os != 'Windows' }} - uses: actions/cache@v2 + uses: actions/cache@v3 with: # validate.sh uses a special build dir path: | @@ -187,6 +187,134 @@ jobs: if: matrix.cli != 'false' run: sh validate.sh $FLAGS -s cli-suite + # The job below is a copy-paste of validate with the necessary tweaks + # to make all work with an upcoming GHC. Those tweaks include: + # - ghcup needs the prerelease channel activated + # - allow-newer for base libraries and Cabal* libraries + # - (sometimes) disabling some parts on Windows because it's hard to figure + # out why they fail + validate-prerelease: + name: Validate ${{ matrix.os }} ghc-prerelease + runs-on: ${{ matrix.os }} + outputs: + GHC_FOR_RELEASE: ${{ format('["{0}"]', env.GHC_FOR_RELEASE) }} + strategy: + matrix: + os: ["ubuntu-20.04", "macos-latest", "windows-latest"] + + steps: + + - uses: actions/checkout@v3 + + # See https://github.com/haskell/cabal/pull/8739 + - name: Sudo chmod to permit ghcup to update its cache + run: | + if [[ "${{ runner.os }}" == "Linux" ]]; then + sudo ls -lah /usr/local/.ghcup/cache + sudo mkdir -p /usr/local/.ghcup/cache + sudo ls -lah /usr/local/.ghcup/cache + sudo chown -R $USER /usr/local/.ghcup + sudo chmod -R 777 /usr/local/.ghcup + fi + + - name: ghcup + run: | + ghcup --version + ghcup config set cache true + ghcup config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml + ghcup install ghc --set 9.6.0.20230210 + ghcup install cabal --set latest + ghc --version + cabal update + + # See the following link for a breakdown of the following step + # https://github.com/haskell/actions/issues/7#issuecomment-745697160 + # + # See https://github.com/haskell/cabal/pull/8739 for why Windows is excluded + - if: ${{ runner.os != 'Windows' }} + uses: actions/cache@v3 + with: + # validate.sh uses a special build dir + path: | + ${{ steps.setup-haskell.outputs.cabal-store }} + dist-* + key: ${{ runner.os }}-${{ matrix.ghc }}-20220419-${{ github.sha }} + restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-20220419- + + - name: Work around git problem https://bugs.launchpad.net/ubuntu/+source/git/+bug/1993586 (cabal PR #8546) + run: | + git config --global protocol.file.allow always + + # The '+exe' constraint below is important, otherwise cabal-install + # might decide to build the library but not the executable which is + # what we need. + - name: Install cabal-plan + run: | + cd $(mktemp -d) + cabal install cabal-plan --constraint='cabal-plan +exe' --allow-newer + echo "$HOME/.cabal/bin" >> $GITHUB_PATH + + # The tool is not essential to the rest of the test suite. If + # hackage-repo-tool is not present, any test that requires it will + # be skipped. + # We want to keep this in the loop but we don't want to fail if + # hackage-repo-tool breaks or fails to support a newer GHC version. + - name: Install hackage-repo-tool + continue-on-error: true + run: | + cd $(mktemp -d) + cabal install hackage-repo-tool + + # Needed by cabal-testsuite/PackageTests/Configure/setup.test.hs + - name: Install Autotools + if: runner.os == 'macOS' + run: | + brew install automake + + - name: Allow newer boot libraries + run: | + echo "allow-newer: base, template-haskell, ghc-prim, Cabal-syntax, Cabal-described, Cabal, cabal-install-solver, cabal-install" >> cabal.project.validate + + - name: Set validate inputs + run: | + FLAGS="${{ env.COMMON_FLAGS }}" + if [[ "${{ matrix.cli }}" == "false" ]]; then + FLAGS="$FLAGS --lib-only" + fi + echo "FLAGS=$FLAGS" >> $GITHUB_ENV + + - name: Validate print-config + run: sh validate.sh $FLAGS -s print-config + + - name: Validate print-tool-versions + run: sh validate.sh $FLAGS -s print-tool-versions + + - name: Validate build + run: sh validate.sh $FLAGS -s build + + - name: Validate lib-tests + env: + # `rawSystemStdInOut reports text decoding errors` + # test does not find ghc without the full path in windows + GHCPATH: ${{ steps.setup-haskell.outputs.ghc-exe }} + run: sh validate.sh $FLAGS -s lib-tests + + - name: Validate lib-suite + # see https://github.com/haskell/cabal/pull/8754#issuecomment-1435025848 + # for discussion about the trouble on Windows + if: ${{ runner.os != 'Windows' }} + run: sh validate.sh $FLAGS -s lib-suite + + - name: Validate cli-tests + if: matrix.cli != 'false' + run: sh validate.sh $FLAGS -s cli-tests + + - name: Validate cli-suite + # see https://github.com/haskell/cabal/pull/8754#issuecomment-1435025848 + # for discussion about the trouble on Windows + if: ( runner.os != 'Windows' ) && ( matrix.cli != 'false' ) + run: sh validate.sh $FLAGS -s cli-suite + validate-old-ghcs: name: Validate old ghcs ${{ matrix.extra-ghc }} runs-on: ubuntu-20.04 @@ -234,7 +362,7 @@ jobs: # As we are reusing the cached build dir from the previous step # the generated artifacts are available here, # including the cabal executable and the test suite - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: path: | ${{ steps.setup-haskell.outputs.cabal-store }} diff --git a/Cabal-syntax/Cabal-syntax.cabal b/Cabal-syntax/Cabal-syntax.cabal index 8bc06f8080ceda626b3b3f535710b79561a4edb9..644d77c8eef356cf7d29f2cd3cbc522ed2f12809 100644 --- a/Cabal-syntax/Cabal-syntax.cabal +++ b/Cabal-syntax/Cabal-syntax.cabal @@ -29,7 +29,7 @@ library build-depends: array >= 0.4.0.1 && < 0.6, - base >= 4.6 && < 5, + base >= 4.9 && < 5, binary >= 0.7 && < 0.9, bytestring >= 0.10.0.0 && < 0.12, containers >= 0.5.0.0 && < 0.7, diff --git a/Cabal-syntax/src/Distribution/Utils/Structured.hs b/Cabal-syntax/src/Distribution/Utils/Structured.hs index 5327ed6a4270b363c317cf46529248bab1727268..ca3147710c8a8551de1e3f7b88bfaaf899fffada 100644 --- a/Cabal-syntax/src/Distribution/Utils/Structured.hs +++ b/Cabal-syntax/src/Distribution/Utils/Structured.hs @@ -7,7 +7,6 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE PatternSynonyms #-} -{-# LANGUAGE TypeInType #-} -- | -- -- Copyright: (c) 2019 Oleg Grenrus diff --git a/Cabal-tests/Cabal-tests.cabal b/Cabal-tests/Cabal-tests.cabal index 2ae09c0928ee23c396a3b2a7ad5634b33ac35079..ce49eab8eb4cd400b9e4b72e61da5470aa4f0fb2 100644 --- a/Cabal-tests/Cabal-tests.cabal +++ b/Cabal-tests/Cabal-tests.cabal @@ -51,7 +51,7 @@ test-suite unit-tests build-depends: array , async >=2.2.2 && <2.3 - , base >=0 && <5 + , base >=4.9 && <5 , binary , bytestring , Cabal diff --git a/Cabal/Cabal.cabal b/Cabal/Cabal.cabal index 3ad7d51753596238fbd7eadfefc443adbf6f0b54..74ff94ca4c2fb19629df543c945d5f813aa28ddb 100644 --- a/Cabal/Cabal.cabal +++ b/Cabal/Cabal.cabal @@ -36,7 +36,7 @@ library build-depends: Cabal-syntax ^>= 3.9, array >= 0.4.0.1 && < 0.6, - base >= 4.6 && < 5, + base >= 4.9 && < 5, bytestring >= 0.10.0.0 && < 0.12, containers >= 0.5.0.0 && < 0.7, deepseq >= 1.3.0.1 && < 1.5, diff --git a/cabal-install-solver/cabal-install-solver.cabal b/cabal-install-solver/cabal-install-solver.cabal index 28d962ad2e1eac0873812ffa3fef33ea71190b6e..eacf70a2a7703cc1aa8320f956a5b9178184e78c 100644 --- a/cabal-install-solver/cabal-install-solver.cabal +++ b/cabal-install-solver/cabal-install-solver.cabal @@ -121,7 +121,7 @@ library if flag(debug-conflict-sets) cpp-options: -DDEBUG_CONFLICT_SETS - build-depends: base >=4.8 + build-depends: base >=4.9 if flag(debug-tracetree) cpp-options: -DDEBUG_TRACETREE diff --git a/cabal-install/src/Distribution/Client/CmdInstall.hs b/cabal-install/src/Distribution/Client/CmdInstall.hs index cd1254b5fe11f1268c9a474e940bd1b3848697ee..94a4737a24d9751fb3a070e6b9a5f383ed2aa851 100644 --- a/cabal-install/src/Distribution/Client/CmdInstall.hs +++ b/cabal-install/src/Distribution/Client/CmdInstall.hs @@ -39,7 +39,7 @@ import Distribution.Client.Types , SourcePackageDb(..) ) import qualified Distribution.Client.InstallPlan as InstallPlan import Distribution.Package - ( Package(..), PackageName, unPackageName ) + ( Package(..), PackageName, mkPackageName, unPackageName ) import Distribution.Types.PackageId ( PackageIdentifier(..) ) import Distribution.Client.ProjectConfig @@ -53,6 +53,7 @@ import Distribution.Client.ProjectFlags (ProjectFlags (..)) import Distribution.Client.ProjectConfig.Types ( ProjectConfig(..), ProjectConfigShared(..) , ProjectConfigBuildOnly(..), PackageConfig(..) + , MapMappend(..) , getMapLast, getMapMappend, projectConfigLogsDir , projectConfigStoreDir, projectConfigBuildOnly , projectConfigConfigFile ) @@ -430,12 +431,24 @@ installAction flags@NixStyleFlags { extraFlags = clientInstallFlags', .. } targe configFlags' = disableTestsBenchsByDefault configFlags verbosity = fromFlagOrDefault normal (configVerbosity configFlags') ignoreProject = flagIgnoreProject projectFlags - cliConfig = commandLineFlagsToProjectConfig - globalFlags - flags { configFlags = configFlags' } - clientInstallFlags' + baseCliConfig = commandLineFlagsToProjectConfig + globalFlags + flags { configFlags = configFlags' } + clientInstallFlags' + cliConfig = addLocalConfigToTargets baseCliConfig targetStrings globalConfigFlag = projectConfigConfigFile (projectConfigShared cliConfig) +-- | Treat all direct targets of install command as local packages: #8637 +addLocalConfigToTargets :: ProjectConfig -> [String] -> ProjectConfig +addLocalConfigToTargets config targetStrings + = config { + projectConfigSpecificPackage = projectConfigSpecificPackage config + <> MapMappend (Map.fromList targetPackageConfigs) + } + where + localConfig = projectConfigLocalPackages config + targetPackageConfigs = map (\x -> (mkPackageName x, localConfig)) targetStrings + -- | Verify that invalid config options were not passed to the install command. -- -- If an invalid configuration is found the command will @die'@. diff --git a/cabal-install/src/Distribution/Client/VCS.hs b/cabal-install/src/Distribution/Client/VCS.hs index 8b0a95462dada0c6be16de48879e0f9478935f95..aca3f4b109f4023d7815ebb0bbfdf7fd395e7977 100644 --- a/cabal-install/src/Distribution/Client/VCS.hs +++ b/cabal-install/src/Distribution/Client/VCS.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE NamedFieldPuns, RecordWildCards, RankNTypes #-} @@ -53,8 +54,11 @@ import Distribution.Version ( mkVersion ) import qualified Distribution.PackageDescription as PD +#if !MIN_VERSION_base(4,18,0) import Control.Applicative ( liftA2 ) +#endif + import Control.Exception ( throw, try ) import Control.Monad.Trans diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.test.hs index fb6843f5a526ea6176181f7bf0e25a3ca0cf8069..3e4577aecfa62d01254bbd0efb13f8a4c1c69170 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.test.hs @@ -1,7 +1,7 @@ import Test.Cabal.Prelude main = setupAndCabalTest $ do skipUnlessGhcVersion ">= 8.1" - ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.*" + ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.* || == 9.6.*" expectBrokenIf ghc 7987 $ do withPackageDb $ do withDirectory "mylib" $ setup_install_with_docs ["--ipid", "mylib-0.1.0.0"] diff --git a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs index 1f01eff1efa03ae21ea1cc7ec26d5b3f8e53f8b7..5196d404f658643c1bf87591938738b1421c80db 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.test.hs @@ -2,7 +2,7 @@ import Test.Cabal.Prelude main = setupTest $ do -- No cabal test because per-component is broken with it skipUnlessGhcVersion ">= 8.1" - ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.*" + ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.* || == 9.6.*" expectBrokenIf ghc 7987 $ withPackageDb $ do let setup_install' args = setup_install_with_docs (["--cabal-file", "Includes2.cabal"] ++ args) diff --git a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.test.hs b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.test.hs index bea7f9a089dcece1cd2d4098ea25022eba3072ce..d7ae9a1921d19c0c3a9fce1c6ac4e62708ac4dee 100644 --- a/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.test.hs @@ -3,7 +3,7 @@ import Data.List import qualified Data.Char as Char main = setupAndCabalTest $ do skipUnlessGhcVersion ">= 8.1" - ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.*" + ghc <- isGhcVersion "== 9.0.2 || == 9.2.* || == 9.4.* || == 9.6.*" expectBrokenIf ghc 7987 $ withPackageDb $ do containers_id <- getIPID "containers" diff --git a/cabal-testsuite/PackageTests/JS/JsSources/js-arch.test.hs b/cabal-testsuite/PackageTests/JS/JsSources/js-arch.test.hs index 612c9829cde9e46cf60249490b6fd4957bc17215..1fed749bdb8eadf820ce3868cf5f97eb787a5498 100644 --- a/cabal-testsuite/PackageTests/JS/JsSources/js-arch.test.hs +++ b/cabal-testsuite/PackageTests/JS/JsSources/js-arch.test.hs @@ -3,6 +3,7 @@ import Test.Cabal.Prelude main = setupAndCabalTest $ do skipUnlessGhcVersion ">= 9.6" skipUnlessJavaScript + skipIfWindows res <- cabal' "v2-run" ["demo"] assertOutputContains "Hello JS!" res diff --git a/cabal-testsuite/PackageTests/LinkerOptions/NonignoredConfigs/cabal.test.hs b/cabal-testsuite/PackageTests/LinkerOptions/NonignoredConfigs/cabal.test.hs index 2e8dac23a20c84314ba4a4b42bffe342ff79f1dc..9da924366f4b97d4c3c073c9807bc1ad6c9058ba 100644 --- a/cabal-testsuite/PackageTests/LinkerOptions/NonignoredConfigs/cabal.test.hs +++ b/cabal-testsuite/PackageTests/LinkerOptions/NonignoredConfigs/cabal.test.hs @@ -50,7 +50,7 @@ linkConfigFlags Dynamic = lrun :: [Linking] lrun = [Static, Dynamic, Static, Dynamic] -main = cabalTest . expectBroken 8744 $ do +main = cabalTest $ do -- Skip if on Windows, since my default Chocolatey Windows setup (and the CI -- server setup at the time, presumably) lacks support for dynamic builds -- since the base package appears to be static only, lacking e.g. ‘.dyn_o’ diff --git a/cabal-testsuite/cabal-testsuite.cabal b/cabal-testsuite/cabal-testsuite.cabal index 849ca565d6a27a81538e3a63d4f0f8986b572ec7..1d918b6bbdf4eff6333f9470c2367d84e0e36080 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.18 + , base >= 4.9 && <4.18 -- this needs to match the in-tree lib:Cabal version , Cabal ^>= 3.9.0.0 , Cabal-syntax ^>= 3.9.0.0 diff --git a/changelog.d/issue-8637 b/changelog.d/issue-8637 new file mode 100644 index 0000000000000000000000000000000000000000..b584e187761693e8acbb40dea4fda1cf94ebf2b1 --- /dev/null +++ b/changelog.d/issue-8637 @@ -0,0 +1,13 @@ +synopsis: Apply command line flags to install packages +packages: cabal-install +prs: #8779 +issues: #8637 + +description: { + +- Command line flags usually only apply to "local" packages (packages specified + in the cabal.project). This change causes the v2-install command to ignore + that distinction to better match the expected behavior for packages specified + directly in the command. + +} diff --git a/changelog.d/pr-8794 b/changelog.d/pr-8794 new file mode 100644 index 0000000000000000000000000000000000000000..10babd5d4202b62c6033226d0e0138bee026d16f --- /dev/null +++ b/changelog.d/pr-8794 @@ -0,0 +1,10 @@ +synopsis: Disallow GHC <8.0 for +packages: Cabal Cabal-syntax cabal-install-solver +prs: #8794 +issues: #8715 #7531 + +description: { + +Disallow GHC <8.0 by restricting the version of base that can be used to at least 4.9 + +} diff --git a/doc/Makefile b/doc/Makefile index 4e12ab8e87a9f1ac31e7b5c153ab7df098e8ed54..5ef45877223c775ac85dcb94b4a9c4011b65f64c 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -23,6 +23,7 @@ build-and-check-requirements: requirements.txt check-requirements # See https://modelpredict.com/wht-requirements-txt-is-not-enough requirements.txt: requirements.in . ../.python-sphinx-virtualenv/bin/activate \ + && pip install --upgrade pip \ && pip install pip-tools \ && pip-compile requirements.in diff --git a/doc/requirements.in b/doc/requirements.in index 3638f36e09a6a8b93aa8652b90fa597cce5df9c1..df0b2f34d80069562fc4697491033a76cc039ee4 100644 --- a/doc/requirements.in +++ b/doc/requirements.in @@ -1,6 +1,8 @@ -sphinx >= 5 -sphinx_rtd_theme >= 1 +sphinx == 5.3.0 +sphinx_rtd_theme >= 1.2 sphinx-jsonschema sphinxnotes-strike # Pygments>=2.7.4 suggested by CVE-2021-20270 CVE-2021-27291 Pygments >= 2.7.4 +# Suggested by dependabot in https://github.com/haskell/cabal/pull/8807 +certifi >= 2022.12.7 diff --git a/doc/requirements.txt b/doc/requirements.txt index 256b6bf407d1d0a0be8b59490f618fe716e5e76d..d65e0d37e158b7eaea764649e26aaa79048b16bb 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,6 +1,6 @@ # -# This file is autogenerated by pip-compile with python 3.9 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.10 +# by the following command: # # pip-compile requirements.in # @@ -8,35 +8,33 @@ alabaster==0.7.12 # via sphinx babel==2.9.1 # via sphinx -certifi==2021.10.8 - # via requests +certifi==2022.12.7 + # via + # -r requirements.in + # requests charset-normalizer==2.0.7 # via requests -docutils==0.17.1 +docutils==0.18.1 # via # sphinx # sphinx-jsonschema # sphinx-rtd-theme idna==2.10 # via requests -imagesize==1.2.0 - # via sphinx -importlib-metadata==4.11.4 +imagesize==1.4.1 # via sphinx -jinja2==2.11.3 +jinja2==3.1.2 # via sphinx jsonpointer==2.1 # via sphinx-jsonschema -markupsafe==1.1.1 +markupsafe==2.1.2 # via jinja2 -packaging==20.9 +packaging==23.0 # via sphinx -pygments==2.10.0 +pygments==2.14.0 # via # -r requirements.in # sphinx -pyparsing==2.4.7 - # via packaging pytz==2021.3 # via babel pyyaml==5.4.1 @@ -47,14 +45,14 @@ requests==2.26.0 # sphinx-jsonschema snowballstemmer==2.1.0 # via sphinx -sphinx==5.0.1 +sphinx==5.3.0 # via # -r requirements.in # sphinx-rtd-theme # sphinxnotes-strike sphinx-jsonschema==1.16.11 # via -r requirements.in -sphinx-rtd-theme==1.0.0 +sphinx-rtd-theme==1.2.0 # via -r requirements.in sphinxcontrib-applehelp==1.0.2 # via sphinx @@ -62,6 +60,8 @@ sphinxcontrib-devhelp==1.0.2 # via sphinx sphinxcontrib-htmlhelp==2.0.0 # via sphinx +sphinxcontrib-jquery==2.0.0 + # via sphinx-rtd-theme sphinxcontrib-jsmath==1.0.1 # via sphinx sphinxcontrib-qthelp==1.0.3 @@ -72,5 +72,6 @@ sphinxnotes-strike==1.1 # via -r requirements.in urllib3==1.26.7 # via requests -zipp==3.8.0 - # via importlib-metadata + +# The following packages are considered to be unsafe in a requirements file: +# setuptools diff --git a/doc/setup-commands.rst b/doc/setup-commands.rst index 12af7db7fd6d87abeb81a5a8854ddd45cec26dca..988d431e693240ef360aa051c9440ba50e8ef8ac 100644 --- a/doc/setup-commands.rst +++ b/doc/setup-commands.rst @@ -880,37 +880,29 @@ Miscellaneous options .. option:: --constraint=constraint Restrict solutions involving a package to given version - bounds, flag settings, and other properties. For example, to - consider only install plans that use version 2.1 of ``bar`` - or do not use ``bar`` at all, write: + bounds, flag settings, and other properties. + + The following considers only install plans where ``bar``, + if used, is restricted to version 2.1: :: $ cabal install --constraint="bar == 2.1" - Version bounds have the same syntax as :pkg-field:`build-depends`. - As a special case, the following prevents ``bar`` from being - used at all: + The following prevents ``bar`` from being used at all: :: - # Note: this is just syntax sugar for '> 1 && < 1', and is - # supported by build-depends. - $ cabal install --constraint="bar -none" - - You can also specify flag assignments: + $ cabal install --constraint="bar <0" - :: - - # Require bar to be installed with the foo flag turned on and - # the baz flag turned off. - $ cabal install --constraint="bar +foo -baz" + Version bounds have the same syntax as :pkg-field:`build-depends`. + Yet extra pseudo version bounds are available here in addition: - To specify multiple constraints, you may pass the - ``constraint`` option multiple times. + - ``installed`` to fix a package to the already installed version. + Often useful for GHC-supplied packages in combination with :cfg-field:`allow-newer`, + e.g., ``--allow-newer='*:base' --constraint='base installed'``. - There are also some more specialized constraints, which most people - don't generally need: + - ``source`` to fix a package to the local source copy. :: @@ -924,9 +916,21 @@ Miscellaneous options # specify this.) $ cabal install --constraint="bar source" + Further, we can specify flag assignments with ``+FLAG`` and ``-FLAG`` + or enable test (``test``) and benchmark (``bench``) suites: + + :: + + # Require bar to be installed with the foo flag turned on and + # the baz flag turned off. + $ cabal install --constraint="bar +foo -baz" + # Require that bar have test suites and benchmarks enabled. $ cabal install --constraint="bar test" --constraint="bar bench" + To specify multiple constraints, you may pass the + ``constraint`` option multiple times. + By default, constraints only apply to build dependencies (:pkg-field:`build-depends`), build dependencies of build dependencies, and so on. Constraints normally do not apply to @@ -934,8 +938,8 @@ Miscellaneous options (:pkg-field:`custom-setup:setup-depends`) nor do they apply to build tools (:pkg-field:`build-tool-depends`) or the dependencies of build tools. To explicitly apply a constraint to a setup or build - tool dependency, you can add a qualifier to the constraint as - follows: + tool dependency, you can add a qualifier ``setup`` or ``any`` + to the constraint as follows: ::