Skip to content

Commit 350003d

Browse files
committed
Merge branch 'master' of github.com:haskell/cabal into mattp/reuse-glob-information
2 parents f5ff776 + d4d92e9 commit 350003d

File tree

326 files changed

+3848
-1043
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

326 files changed

+3848
-1043
lines changed

.git-blame-ignore-revs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 2025
2+
########################################
3+
# make *.cabal build-depends consistently formatted
4+
7d791b9da10b5034e7a997a0044ded5575fe123f
5+
16
# 2023
27
########################################
38

.github/workflows/validate.yml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,11 @@ jobs:
336336
apk add bash curl sudo jq pkgconfig \
337337
zlib-dev zlib-static binutils-gold curl \
338338
gcc g++ gmp-dev libc-dev libffi-dev make \
339-
musl-dev ncurses-dev perl tar xz
339+
musl-dev ncurses-dev perl tar xz git
340+
341+
# Apparently there's some permissions thing inside vs. outside the container
342+
# that Alpine's git doesn't like. Hack around it.
343+
- run: git config --global --add safe.directory $(pwd)
340344

341345
- uses: actions/checkout@v4
342346

@@ -465,24 +469,21 @@ jobs:
465469
needs: [validate, validate-old-ghcs, build-alpine, dogfooding]
466470

467471
steps:
468-
- uses: liudonghua123/delete-release-action@v1
469-
env:
470-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
471-
with:
472-
release_name: 'cabal-head'
473-
474472
- uses: actions/download-artifact@v4
475473
with:
476474
pattern: cabal-*
477475
path: binaries
478476
merge-multiple: true
479477

480-
- name: Create GitHub prerelease
481-
uses: softprops/action-gh-release@v2
478+
- name: (Re)Create GitHub prerelease
479+
uses: andelf/nightly-release@main
480+
env:
481+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
482482
with:
483483
tag_name: cabal-head
484+
name: cabal-head
484485
prerelease: true
485-
files: binaries/cabal-*
486+
files: "binaries/cabal-*"
486487

487488
prerelease-lts:
488489
name: Create a GitHub LTS prerelease with the binary artifacts
@@ -496,12 +497,6 @@ jobs:
496497
needs: [validate, validate-old-ghcs, build-alpine, dogfooding]
497498

498499
steps:
499-
- uses: liudonghua123/delete-release-action@v1
500-
env:
501-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
502-
with:
503-
release_name: 'cabal-lts-head'
504-
505500
- uses: actions/download-artifact@v4
506501
with:
507502
pattern: cabal-*
@@ -515,12 +510,15 @@ jobs:
515510
mv "$f" "cabal-lts-${f##cabal-}"
516511
done
517512
518-
- name: Create GitHub prerelease
519-
uses: softprops/action-gh-release@v2
513+
- name: (Re)Create GitHub prerelease
514+
uses: andelf/nightly-release@main
515+
env:
516+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
520517
with:
521518
tag_name: cabal-lts-head
519+
name: cabal-lts-head
522520
prerelease: true
523-
files: binaries/cabal-*
521+
files: "binaries/cabal-*"
524522

525523
# We use this job as a summary of the workflow
526524
# It will fail if any of the previous jobs does

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ register.sh
1515
./cabal.config
1616
cabal-tests.log
1717
bootstrap/*.plan.json
18+
haddocks
1819

1920
/Cabal/dist/
2021
/Cabal/tests/Setup

.hlint.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Warnings currently triggered by your code
22
- ignore: {name: "Avoid NonEmpty.unzip"} # 1 hint
33
- ignore: {name: "Avoid lambda"} # 47 hints
4-
- ignore: {name: "Avoid lambda using `infix`"} # 22 hints
4+
- ignore: {name: "Avoid lambda using `infix`"} # 23 hints
55
- ignore: {name: "Eta reduce"} # 124 hints
66
- ignore: {name: "Evaluate"} # 10 hints
77
- ignore: {name: "Functor law"} # 10 hints
@@ -16,11 +16,11 @@
1616
- ignore: {name: "Monoid law, right identity"} # 3 hints
1717
- ignore: {name: "Move filter"} # 4 hints
1818
- ignore: {name: "Move guards forward"} # 4 hints
19-
- ignore: {name: "Redundant $"} # 179 hints
19+
- ignore: {name: "Redundant $"} # 178 hints
2020
- ignore: {name: "Redundant $!"} # 1 hint
2121
- ignore: {name: "Redundant <$>"} # 16 hints
2222
- ignore: {name: "Redundant =="} # 1 hint
23-
- ignore: {name: "Redundant bracket"} # 239 hints
23+
- ignore: {name: "Redundant bracket"} # 240 hints
2424
- ignore: {name: "Redundant fmap"} # 1 hint
2525
- ignore: {name: "Redundant guard"} # 2 hints
2626
- ignore: {name: "Redundant if"} # 6 hints
@@ -48,9 +48,8 @@
4848
- ignore: {name: "Use concatMap"} # 2 hints
4949
- ignore: {name: "Use const"} # 36 hints
5050
- ignore: {name: "Use elem"} # 2 hints
51-
- ignore: {name: "Use fewer imports"} # 13 hints
5251
- ignore: {name: "Use first"} # 4 hints
53-
- ignore: {name: "Use fmap"} # 26 hints
52+
- ignore: {name: "Use fmap"} # 25 hints
5453
- ignore: {name: "Use fold"} # 1 hint
5554
- ignore: {name: "Use for"} # 1 hint
5655
- ignore: {name: "Use forM_"} # 1 hint
@@ -66,7 +65,7 @@
6665
- ignore: {name: "Use isNothing"} # 1 hint
6766
- ignore: {name: "Use lambda-case"} # 55 hints
6867
- ignore: {name: "Use lefts"} # 1 hint
69-
- ignore: {name: "Use list comprehension"} # 18 hints
68+
- ignore: {name: "Use list comprehension"} # 19 hints
7069
- ignore: {name: "Use list literal"} # 3 hints
7170
- ignore: {name: "Use list literal pattern"} # 11 hints
7271
- ignore: {name: "Use map once"} # 7 hints
@@ -95,6 +94,8 @@
9594

9695
- arguments:
9796
- --ignore-glob=Cabal-syntax/src/Distribution/Fields/Lexer.hs
97+
- --ignore-glob=Cabal-tests/tests/custom-setup/CabalDoctestSetup.hs
98+
- --ignore-glob=Cabal-tests/tests/custom-setup/IdrisSetup.hs
9899
- --ignore-glob=cabal-testsuite/PackageTests/BuildWays/q/app/Main.hs
99100
- --ignore-glob=cabal-testsuite/PackageTests/CmmSources/src/Demo.hs
100101
- --ignore-glob=cabal-testsuite/PackageTests/CmmSourcesDyn/src/Demo.hs

.typos.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
[default]
22
extend-ignore-re = ["(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on"]
3+
4+
[default.extend-words]
5+
# Extinguish false positive in cabal-package-description-file.rst. 'Nd' is a
6+
# Unicode category, not a misspelling of 'And'.
7+
nd = "nd"

CONTRIBUTING.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,23 @@ If your PR is trivial you can omit this process (but explain in the PR why you
360360
think it does not warrant an issue). Feel free to open a new issue (or new
361361
issues) when appropriate.
362362
363+
### Pull request size
364+
365+
Keep your pull requests small, write one pull request per feature, let
366+
the content of the pull request match the title of the pull request.
367+
368+
To get merged, your pull request needs to be reviewed by two other
369+
contributors. Large pull requests are daunting to inspect, and the
370+
back-and-forth between the author and reviewer can get frustrating and
371+
difficult to follow.
372+
373+
Split your pull requests in multiple ones if possible (e.g. a refactor
374+
and a feature implementation should go in two different pull requests).
375+
This is *especially* important when we decide to backport a pull request
376+
(be it fix or a feature).
377+
378+
Thorough reviews mean less regressions, keeping your pull requests small
379+
will improve Cabal codebase quality.
363380
364381
## Changelog
365382
@@ -395,9 +412,12 @@ description: {
395412
}
396413
```
397414

398-
Changelogs may also be written in "markdown-frontmatter" format. This is useful if your
399-
description contains braces, which must be escaped with backslashes in `.cabal` file
400-
format. The front matter is in YAML syntax, not `.cabal` file syntax, and the file
415+
Changelogs may also be written in "markdown-frontmatter" format. This is useful
416+
if your description contains braces, which must be escaped with backslashes in
417+
`.cabal` file format. Another benefit of using an `.md` extension with your
418+
changelog is that it will be checked for typos.
419+
420+
The front matter is in YAML syntax, not `.cabal` file syntax, and the file
401421
_must_ begin with a line containing only hyphens.
402422

403423
```markdown

Cabal-QuickCheck/src/Test/QuickCheck/GenericArbitrary.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE CPP #-}
21
{-# LANGUAGE FlexibleContexts #-}
32
{-# LANGUAGE GADTs #-}
43
{-# LANGUAGE TypeOperators #-}

Cabal-QuickCheck/src/Test/QuickCheck/Instances/Cabal.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{-# LANGUAGE CPP #-}
22
{-# LANGUAGE FlexibleInstances #-}
3-
{-# OPTIONS_GHC -fno-warn-orphans #-}
3+
{-# OPTIONS_GHC -Wno-orphans #-}
44
module Test.QuickCheck.Instances.Cabal () where
55

66
#if !MIN_VERSION_base(4,18,0)

Cabal-described/src/Distribution/Described.hs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ reUnqualComponent = RENamed "unqual-name" $
168168
-- currently the parser accepts "csAlphaNum `difference` "0123456789"
169169
-- which is larger set than CS.alpha
170170
--
171-
-- Hackage rejects non ANSI names, so it's not so relevant.
172-
<> RECharSet CS.alpha
171+
-- Hackage, however, rejects non ANSI names.
172+
<> RECharSet csAlphaNumNotDigit
173173
<> REMunch reEps (RECharSet csAlphaNum)
174174

175175
reDot :: GrammarRegex a
@@ -194,6 +194,9 @@ csAlpha = CS.alpha
194194
csAlphaNum :: CS.CharSet
195195
csAlphaNum = CS.alphanum
196196

197+
csAlphaNumNotDigit :: CS.CharSet
198+
csAlphaNumNotDigit = CS.alphanumNotDigit
199+
197200
csUpper :: CS.CharSet
198201
csUpper = CS.upper
199202

Cabal-described/src/Distribution/Utils/CharSet.hs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,17 @@ module Distribution.Utils.CharSet (
2727
-- * Special lists
2828
alpha,
2929
alphanum,
30+
alphanumNotDigit,
3031
upper,
3132
) where
3233

33-
import Data.Char (chr, isAlpha, isAlphaNum, isUpper, ord)
34+
import Data.Char (chr, isAlpha, isAlphaNum, isDigit, isUpper, ord)
3435
import Data.List (foldl', sortBy)
3536
import Data.Monoid (Monoid (..))
3637
import Data.String (IsString (..))
3738
import Distribution.Compat.Semigroup (Semigroup (..))
3839
import Prelude
39-
(Bool (..), Bounded (..), Char, Enum (..), Eq (..), Int, Maybe (..), Num (..), Ord (..), Show (..), String, concatMap, flip, fst, otherwise, showParen,
40+
(Bool (..), Bounded (..), Char, Enum (..), Eq (..), Int, Maybe (..), Num (..), Ord (..), Show (..), String, (&&), concatMap, flip, fst, not, otherwise, showParen,
4041
showString, uncurry, ($), (.))
4142

4243
#if MIN_VERSION_containers(0,5,0)
@@ -113,7 +114,9 @@ member c (CS m) = go (IM.toList m)
113114
i = ord c
114115

115116
-- | Insert 'Char' into 'CharSet'.
117+
{- FOURMOLU_DISABLE -}
116118
insert :: Char -> CharSet -> CharSet
119+
{- FOURMOLU_ENABLE -}
117120
insert c (CS m) = normalise (IM.insert (ord c) (ord c) m)
118121

119122
-- | Union of two 'CharSet's.
@@ -229,10 +232,16 @@ alpha :: CharSet
229232
alpha = foldl' (flip insert) empty [ c | c <- [ minBound .. maxBound ], isAlpha c ]
230233
{-# NOINLINE alpha #-}
231234

235+
-- | Note: this set varies depending on @base@ version.
236+
--
237+
alphanumNotDigit :: CharSet
238+
alphanumNotDigit = foldl' (flip insert) empty [ c | c <- [ minBound .. maxBound ], isAlphaNum c && not (isDigit c) ]
239+
{-# NOINLINE alphanumNotDigit #-}
240+
232241
-- | Note: this set varies depending on @base@ version.
233242
--
234243
alphanum :: CharSet
235-
alphanum = foldl' (flip insert) empty [ c | c <- [ minBound .. maxBound ], isAlphaNum c ]
244+
alphanum = foldl' (flip insert) alphanumNotDigit ['0' .. '9' ]
236245
{-# NOINLINE alphanum #-}
237246

238247
-- | Note: this set varies depending on @base@ version.

Cabal-described/src/Distribution/Utils/GrammarRegex.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,10 @@ mathtt d = "\\mathtt{" <<>> d <<>> "}"
194194

195195
charsetDoc :: CS.CharSet -> PP.Doc
196196
charsetDoc acs
197-
| acs == CS.alpha = terminalDoc "alpha"
198-
| acs == CS.alphanum = terminalDoc "alpha-num"
199-
| acs == CS.upper = terminalDoc "upper"
197+
| acs == CS.alpha = terminalDoc "alpha"
198+
| acs == CS.alphanum = terminalDoc "alpha-num"
199+
| acs == CS.alphanumNotDigit = terminalDoc "alpha-num-not-digit"
200+
| acs == CS.upper = terminalDoc "upper"
200201
charsetDoc acs = case CS.toIntervalList acs of
201202
[] -> "\\emptyset"
202203
[(x,y)] | x == y -> inquotes $ mathtt $ charDoc x
File renamed without changes.

Cabal-hooks/Cabal-hooks.cabal

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ category: Distribution
1515
build-type: Simple
1616

1717
extra-source-files:
18-
readme.md changelog.md
18+
README.md CHANGELOG.md
1919

2020
source-repository head
2121
type: git
@@ -27,13 +27,13 @@ library
2727
hs-source-dirs: src
2828

2929
build-depends:
30-
Cabal-syntax >= 3.15 && < 3.17,
31-
Cabal >= 3.15 && < 3.17,
32-
base >= 4.13 && < 5,
33-
containers >= 0.5.0.0 && < 0.8,
34-
transformers >= 0.5.6.0 && < 0.7
30+
, Cabal-syntax >= 3.15 && < 3.17
31+
, Cabal >= 3.15 && < 3.17
32+
, base >= 4.13 && < 5
33+
, containers >= 0.5.0.0 && < 0.9
34+
, transformers >= 0.5.6.0 && < 0.7
3535

36-
ghc-options: -Wall -fno-ignore-asserts -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates
36+
ghc-options: -Wall -fno-ignore-asserts -Wtabs -Wincomplete-uni-patterns -Wincomplete-record-updates
3737

3838
exposed-modules:
3939
Distribution.Simple.SetupHooks
File renamed without changes.

Cabal-syntax/Cabal-syntax.cabal

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,30 @@ library
2828
hs-source-dirs: src
2929

3030
build-depends:
31-
array >= 0.4.0.1 && < 0.6,
32-
base >= 4.13 && < 5,
33-
binary >= 0.7 && < 0.9,
34-
bytestring >= 0.10.0.0 && < 0.13,
35-
containers >= 0.5.0.0 && < 0.8,
36-
deepseq >= 1.3.0.1 && < 1.7,
37-
directory >= 1.2 && < 1.4,
38-
filepath >= 1.3.0.1 && < 1.6,
39-
mtl >= 2.1 && < 2.4,
40-
parsec >= 3.1.13.0 && < 3.2,
41-
pretty >= 1.1.1 && < 1.2,
42-
text (>= 1.2.3.0 && < 1.3) || (>= 2.0 && < 2.2),
43-
time >= 1.4.0.1 && < 1.15,
31+
, array >= 0.4.0.1 && < 0.6
32+
, base >= 4.13 && < 5
33+
, binary >= 0.7 && < 0.9
34+
, bytestring >= 0.10.0.0 && < 0.13
35+
, containers >= 0.5.0.0 && < 0.9
36+
, deepseq >= 1.3.0.1 && < 1.7
37+
, directory >= 1.2 && < 1.4
38+
, filepath >= 1.3.0.1 && < 1.6
39+
, mtl >= 2.1 && < 2.4
40+
, parsec >= 3.1.13.0 && < 3.2
41+
, pretty >= 1.1.1 && < 1.2
42+
, text (>= 1.2.3.0 && < 1.3) || (>= 2.0 && < 2.2)
43+
, time >= 1.4.0.1 && < 1.15
4444
-- transformers-0.4.0.0 doesn't have record syntax e.g. for Identity
4545
-- See also https://github.com/ekmett/transformers-compat/issues/35
46-
transformers (>= 0.3 && < 0.4) || (>=0.4.1.0 && <0.7)
46+
, transformers (>= 0.3 && < 0.4) || (>=0.4.1.0 && <0.7)
4747

4848
ghc-options:
4949
-Wall
5050
-fno-ignore-asserts
51-
-fwarn-tabs
52-
-fwarn-incomplete-uni-patterns
53-
-fwarn-incomplete-record-updates
54-
-fno-warn-unticked-promoted-constructors
51+
-Wtabs
52+
-Wincomplete-uni-patterns
53+
-Wincomplete-record-updates
54+
-Wno-unticked-promoted-constructors
5555

5656
if impl(ghc >= 8.0)
5757
ghc-options: -Wcompat -Wnoncanonical-monad-instances

Cabal-syntax/src/Distribution/Compat/Binary.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
{-# LANGUAGE CPP #-}
2-
31
module Distribution.Compat.Binary
42
( decodeOrFailIO
53
, decodeFileOrFail'

Cabal-syntax/src/Distribution/Compat/Exception.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
{-# LANGUAGE CPP #-}
2-
31
module Distribution.Compat.Exception
42
( catchIO
53
, catchExit

Cabal-syntax/src/Distribution/Compat/Graph.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
{-# LANGUAGE BangPatterns #-}
2-
{-# LANGUAGE CPP #-}
32
{-# LANGUAGE FlexibleContexts #-}
43
{-# LANGUAGE ScopedTypeVariables #-}
54
{-# LANGUAGE TypeFamilies #-}
65
{-# LANGUAGE TypeOperators #-}
76
{-# LANGUAGE UndecidableInstances #-}
87

9-
-----------------------------------------------------------------------------
10-
11-
-----------------------------------------------------------------------------
12-
138
-- |
149
-- Module : Distribution.Compat.Graph
1510
-- Copyright : (c) Edward Z. Yang 2016

0 commit comments

Comments
 (0)