Skip to content

Commit db857ee

Browse files
authored
Merge branch 'master' into andrea/remove-cabal-file
2 parents 9086dbe + 285a293 commit db857ee

File tree

107 files changed

+1262
-1364
lines changed

Some content is hidden

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

107 files changed

+1262
-1364
lines changed

.github/workflows/bootstrap.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
key: bootstrap-${{ runner.os }}-${{ matrix.ghc }}-20221115-${{ github.sha }}
3535
restore-keys: bootstrap-${{ runner.os }}-${{ matrix.ghc }}-20221115-
3636

37-
- uses: actions/checkout@v3
37+
- uses: actions/checkout@v4
3838
# See https://github.com/haskell/cabal/pull/8739
3939
- name: Sudo chmod to permit ghcup to update its cache
4040
run: |

.github/workflows/changelogs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
run: cabal v2-update
5151
# Cannot install it from tarball due to
5252
# https://github.com/haskell/cabal/issues/7360
53-
- uses: actions/checkout@v3
53+
- uses: actions/checkout@v4
5454
with:
5555
repository: "fgaz/changelog-d"
5656
path: "changelog-d"
@@ -59,7 +59,7 @@ jobs:
5959
pushd changelog-d
6060
cabal v2-install
6161
popd
62-
- uses: actions/checkout@v3
62+
- uses: actions/checkout@v4
6363
- name: Run changelog-d
6464
run: |
6565
changelog-d changelog.d

.github/workflows/format.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
fourmolu:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
- uses: haskell-actions/run-fourmolu@v8
1414
with:
1515
pattern: |

.github/workflows/lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
hlint:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v4
1212
- uses: haskell/actions/hlint-setup@v2
1313
with:
1414
version: "3.5"

.github/workflows/quick-jobs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
run: cabal v2-update
4949
- name: Install alex
5050
run: cabal v2-install alex --constraint='alex ==3.2.7.3'
51-
- uses: actions/checkout@v3
51+
- uses: actions/checkout@v4
5252
- name: Regenerate files
5353
run: |
5454
make -B lexer
@@ -87,7 +87,7 @@ jobs:
8787
ghcup install cabal --set latest
8888
- name: Update Hackage index
8989
run: cabal v2-update
90-
- uses: actions/checkout@v3
90+
- uses: actions/checkout@v4
9191
- name: Install doctest
9292
run: make doctest-install
9393
- name: Doctest

.github/workflows/users-guide.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
python-version: ['3.10']
5050

5151
steps:
52-
- uses: actions/checkout@v3
52+
- uses: actions/checkout@v4
5353
with:
5454
submodules: recursive
5555

.github/workflows/validate.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555

5656
steps:
5757

58-
- uses: actions/checkout@v3
58+
- uses: actions/checkout@v4
5959

6060
# See the following link for a breakdown of the following step
6161
# https://github.com/haskell/actions/issues/7#issuecomment-745697160
@@ -197,7 +197,7 @@ jobs:
197197
# cause it does not work with the git version included in it, see:
198198
# https://github.com/actions/checkout/issues/170
199199
# https://github.com/actions/checkout/issues/295
200-
# - uses: actions/checkout@v3
200+
# - uses: actions/checkout@v4
201201
- name: Checkout
202202
run: |
203203
echo $GITHUB_REF $GITHUB_SHA
@@ -251,7 +251,7 @@ jobs:
251251
ghc: ${{ fromJSON (needs.validate.outputs.GHC_FOR_RELEASE) }}
252252

253253
steps:
254-
- uses: actions/checkout@v3
254+
- uses: actions/checkout@v4
255255

256256
# See https://github.com/haskell/cabal/pull/8739
257257
- name: Sudo chmod to permit ghcup to update its cache

.gitlab/brew.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ brew_dir="${CI_PROJECT_DIR}/.brew"
99

1010
if [ ! -e "${brew_dir}" ]; then
1111
mkdir -p "${brew_dir}"
12-
curl -L "https://github.com/Homebrew/brew/archive/refs/tags/${BREW_VERSION}.tar.gz" | tar xz --strip 1 -C "${brew_dir}"
12+
curl --fail -L "https://github.com/Homebrew/brew/archive/refs/tags/${BREW_VERSION}.tar.gz" | tar xz --strip 1 -C "${brew_dir}"
1313
fi
1414

1515
export PATH="${brew_dir}/bin:${brew_dir}/sbin:$PATH"

.readthedocs.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ version: 2
33
sphinx:
44
configuration: doc/conf.py
55

6+
build:
7+
os: "ubuntu-22.04"
8+
tools:
9+
python: "3.8"
10+
611
python:
7-
version: 3.8
812
install:
913
- requirements: doc/requirements.txt

CONTRIBUTING.md

+7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ If not, you aren't able to build the testsuite, so you need to disable the defau
1515
cabal build --project-file=cabal.project.release cabal
1616
```
1717

18+
> **Note**
19+
> If you're using Nix, you might find it convenient to work within a shell that has all the `Cabal` development dependencies:
20+
> ```
21+
> $ nix-shell -p cabal-install ghc ghcid haskellPackages.fourmolu_0_12_0_0 pkgconfig zlib.dev
22+
> ```
23+
> A Nix flake developer shell with these dependencies is also available, supported solely by the community, through the command `nix develop github:yvan-sraka/cabal.nix`.
24+
1825
The location of your build products will vary depending on which version of
1926
cabal-install you use to build; see the documentation section
2027
[Where are my build products?](http://cabal.readthedocs.io/en/latest/nix-local-build.html#where-are-my-build-products)

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

+17-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ module Test.QuickCheck.Instances.Cabal () where
55

66
import Control.Applicative (liftA2)
77
import Data.Bits (shiftR)
8-
import Data.Char (isAlphaNum, isDigit)
9-
import Data.List (intercalate)
8+
import Data.Char (isAlphaNum, isDigit, toLower)
9+
import Data.List (intercalate, (\\))
1010
import Data.List.NonEmpty (NonEmpty (..))
1111
import Distribution.Utils.Generic (lowercase)
1212
import Test.QuickCheck
@@ -405,6 +405,10 @@ instance (Arbitrary a, Ord a) => Arbitrary (NubList a) where
405405
-- InstallDirs
406406
-------------------------------------------------------------------------------
407407

408+
-- these are wrong because they bottom out in String. We should really use
409+
-- the modern FilePath at some point, so we get QC instances that don't include
410+
-- invalid characters or path components
411+
408412
instance Arbitrary a => Arbitrary (InstallDirs a) where
409413
arbitrary = InstallDirs
410414
<$> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary -- 4
@@ -506,11 +510,20 @@ arbitraryShortToken :: Gen String
506510
arbitraryShortToken = arbitraryShortStringWithout "{}[]"
507511

508512
arbitraryShortPath :: Gen String
509-
arbitraryShortPath = arbitraryShortStringWithout "{}[],"
513+
arbitraryShortPath = arbitraryShortStringWithout "{}[],<>:|*?" `suchThat` (not . winDevice)
514+
where
515+
-- split path components on dots
516+
-- no component can be empty or a device name
517+
-- this blocks a little too much (both "foo..bar" and "foo.con" are legal)
518+
-- but for QC being a little conservative isn't harmful
519+
winDevice = any (any (`elem` ["","con", "aux", "prn", "com", "lpt", "nul"]) . splitBy ".") . splitBy "\\/" . map toLower
520+
splitBy _ "" = []
521+
splitBy seps str = let (part,rest) = break (`elem` seps) str
522+
in part : if length rest == 1 then [""] else splitBy seps (drop 1 rest)
510523

511524
arbitraryShortStringWithout :: String -> Gen String
512525
arbitraryShortStringWithout excludeChars =
513-
shortListOf1 5 $ elements [c | c <- ['#' .. '~' ], c `notElem` excludeChars ]
526+
shortListOf1 5 $ elements $ ['#' .. '~'] \\ excludeChars
514527

515528
-- |
516529
intSqrt :: Int -> Int

Cabal-syntax/Cabal-syntax.cabal

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ library
3131
array >= 0.4.0.1 && < 0.6,
3232
base >= 4.9 && < 5,
3333
binary >= 0.7 && < 0.9,
34-
bytestring >= 0.10.0.0 && < 0.12,
34+
bytestring >= 0.10.0.0 && < 0.13,
3535
containers >= 0.5.0.0 && < 0.7,
3636
deepseq >= 1.3.0.1 && < 1.6,
3737
directory >= 1.2 && < 1.4,
3838
filepath >= 1.3.0.1 && < 1.5,
3939
mtl >= 2.1 && < 2.4,
4040
parsec >= 3.1.13.0 && < 3.2,
4141
pretty >= 1.1.1 && < 1.2,
42-
text (>= 1.2.3.0 && < 1.3) || (>= 2.0 && < 2.1),
42+
text (>= 1.2.3.0 && < 1.3) || (>= 2.0 && < 2.2),
4343
time >= 1.4.0.1 && < 1.13,
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

0 commit comments

Comments
 (0)