Skip to content

Commit

Permalink
screened 2025-01-09 19:29:54+00:00
Browse files Browse the repository at this point in the history
  • Loading branch information
bfrk committed Jan 9, 2025
1 parent 610fb3c commit 95096dc
Show file tree
Hide file tree
Showing 194 changed files with 7,061 additions and 9,192 deletions.
38 changes: 22 additions & 16 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,40 @@ on: push

jobs:
build-with-cabal:
name: ${{ matrix.os }} / ghc-${{ matrix.ghc }}
name: ${{ matrix.os }} / cabal-${{ matrix.cabal }} / ghc-${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
# - ubuntu-20.04
- ubuntu-22.04
# - macos-11
# - ubuntu-22.04
- ubuntu-24.04
# - macos-12
- macos-13
# - windows-2019
- windows-2022
ghc:
- 8.4.4
- 8.6.5
- 8.8.2
- 8.10.7
- 9.0.2
- 9.2.8
- 9.4.8
- 9.6.4
- 9.8.2
# - 8.6.5
# - 8.8.2
# - 8.10.7
# - 9.0.2
# - 9.2.8
# - 9.4.8
# - 9.6.6
# - 9.8.4
- 9.10.1
cabal:
- '3.10'
# - '3.10'
- '3.12'
exclude:
# building text-2.1.2 fails with obscure assembler error
- os: windows-2022
ghc: 8.10.7
env:
builddocs: ${{ matrix.ghc == '9.4.5' }}
runtests: ${{ matrix.ghc == '8.4.4' || matrix.ghc == '9.8.2' }}
runtests: ${{ matrix.ghc == '8.4.4' || matrix.ghc == '9.10.1' }}
warnaserror: ${{ matrix.ghc == '9.8.2'}}
tests-to-run: # e.g. -t=EXAMPLE
testcmd: cabal run -- darcs-test -j=6 -f=123 -i=yn -c=yn --hide
Expand Down Expand Up @@ -70,8 +76,8 @@ jobs:
uses: actions/cache/restore@v4
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: cabal-store-${{ matrix.os }}-ghc-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: cabal-store-${{ matrix.os }}-ghc-${{ matrix.ghc }}-
key: cabal-store-${{ matrix.os }}-cabal-${{ matrix.cabal }}-ghc-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: cabal-store-${{ matrix.os }}-cabal-${{ matrix.cabal }}-ghc-${{ matrix.ghc }}-

- name: Build dependencies (with docs)
if: env.builddocs == 'true'
Expand All @@ -86,7 +92,7 @@ jobs:
uses: actions/cache/save@v4
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: cabal-store-${{ matrix.os }}-ghc-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
key: cabal-store-${{ matrix.os }}-cabal-${{ matrix.cabal }}-ghc-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}

- name: Build
run: cabal build
Expand Down
18 changes: 0 additions & 18 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
Darcs 2.18.5, 9 Jan 2025

This release is done solely to keep up with (breaking) changes in some of
our dependencies. A plain `cabal update && cabal install darcs` should now
again succeed.

* restrict upper limit on attoparsec from <0.15 to <14.4 for ghc versions <8.10
* exclude system-fileio-0.3.16.5 which fails to build on Windows
* raise upper bound on tls, data-default-class -> data-default

Darcs 2.18.4, 26 Oct 2024

* darcs can now be built with stack against stackage lts-22.34, which is
the version that the debian haskell team currently targets

* resolve issue2725: the permissions of _darcs/patch_index are now
generically set to those of its parent directory

Darcs 2.18.3, 26 May 2024

* relax upper bounds for some dependencies
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cabal update && cabal install darcs
```

with a recent cabal (version 3.2 or later is recommended). Any version of
ghc from 8.2 up to 9.8 should work.
ghc from 8.2 up to 9.10 should work.

From inside a clone or a source dist, use

Expand Down
2 changes: 1 addition & 1 deletion Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Distribution.PackageDescription ( PackageDescription )
import Distribution.Package ( packageVersion )
import Distribution.Version( Version )
import Distribution.Simple.LocalBuildInfo
( LocalBuildInfo(..), absoluteInstallDirs )
( LocalBuildInfo(..), absoluteInstallDirs, buildDir )
import Distribution.Simple.InstallDirs (mandir, CopyDest (NoCopyDest))
import Distribution.Simple.Setup
(buildVerbosity, copyDest, copyVerbosity, fromFlag,
Expand Down
48 changes: 14 additions & 34 deletions darcs.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Cabal-Version: 2.4
Name: darcs
version: 2.18.5
version: 2.19.1
License: GPL-2.0-or-later
License-file: COPYING
Author: David Roundy <[email protected]>, <[email protected]>
Expand Down Expand Up @@ -61,9 +61,6 @@ extra-source-files:
release/distributed-version
release/distributed-context

-- bundled shelly (the bare minimum required)
shelly/LICENSE

-- testsuite
tests/data/*.tgz
tests/data/README
Expand Down Expand Up @@ -123,8 +120,8 @@ flag warn-as-error
-- ----------------------------------------------------------------------

custom-setup
setup-depends: base >= 4.10 && < 4.20,
Cabal >= 2.4 && < 3.11,
setup-depends: base >= 4.10 && < 4.21,
Cabal >= 2.4 && < 3.13,
process >= 1.2.3.0 && < 1.7,
filepath >= 1.4.1 && < 1.5.0.0,
directory >= 1.2.7 && < 1.4
Expand Down Expand Up @@ -416,7 +413,7 @@ Library
build-depends: unix >= 2.7.1.0 && < 2.9,
directory >= 1.2.7 && < 1.4

build-depends: base >= 4.10 && < 4.20,
build-depends: base >= 4.10 && < 4.21,
safe >= 0.3.20 && < 0.4,
stm >= 2.1 && < 2.6,
binary >= 0.5 && < 0.11,
Expand Down Expand Up @@ -448,7 +445,7 @@ Library
async >= 2.0.2 && < 2.3,
constraints >= 0.11 && < 0.15,
unix-compat >= 0.6 && < 0.8,
bytestring >= 0.10.6 && < 0.13,
bytestring >= 0.11.3.0 && < 0.13,
old-time >= 1.1.0.3 && < 1.2,
time >= 1.9 && < 1.15,
text >= 1.2.1.3 && < 2.2,
Expand All @@ -458,6 +455,7 @@ Library
hashable >= 1.2.3.3 && < 1.5,
mmap >= 0.5.9 && < 0.6,
zlib >= 0.6.1.2 && < 0.8,
xml >= 1.3.14 && < 1.4,
network-uri >= 2.6 && < 2.8,
network >= 2.6 && < 3.3,
conduit >= 1.3.0 && < 1.4,
Expand All @@ -483,12 +481,12 @@ Library

ghc-options: -Wall -funbox-strict-fields -fwarn-tabs

-- It's a deliberate choice to use NoMonoLocalBinds and tolerate this warning long-term,
-- as otherwise we'd need 10s of extra type signatures in our code.
-- See https://mail.haskell.org/pipermail/glasgow-haskell-users/2010-November/019464.html
if impl(ghc >= 9.4.1)
ghc-options: -Wno-gadt-mono-local-binds

if impl(ghc >= 9.0.1)
ghc-options: -Wno-star-is-type

-- The terminfo package cannot be built on Windows.
if flag(terminfo) && !os(windows)
build-depends: terminfo >= 0.4.0.2 && < 0.5
Expand Down Expand Up @@ -573,7 +571,7 @@ test-suite darcs-test
type: exitcode-stdio-1.0
default-language: Haskell2010
main-is: test.hs
hs-source-dirs: harness, shelly/src
hs-source-dirs: harness

if os(windows)
cpp-options: -DWIN32
Expand Down Expand Up @@ -603,17 +601,7 @@ test-suite darcs-test
test-framework-leancheck >= 0.0.1 && < 0.1,
vector,
zip-archive,
-- additional dependencies needed by the shelly modules
async,
exceptions,
monad-control >= 0.3.2 && < 1.1,
process,
system-filepath >= 0.4.7 && < 0.5,
-- exclude 0.3.16.5 which fails to build on Windows
system-fileio < 0.3.16.5 || > 0.3.16.5 && < 0.4,
time,
transformers-base,
unix-compat,
shelly,

-- the tests shell out to a built darcs binary, so we depend on it to make
-- sure that it's built. It's not actually required for build, just at runtime,
Expand All @@ -627,25 +615,23 @@ test-suite darcs-test
Darcs.Test.Patch.Check
Darcs.Test.Patch.Depends
Darcs.Test.Patch.Examples.Set1
Darcs.Test.Patch.Examples.Set2Unwitnessed
Darcs.Test.Patch.Examples.Set2
Darcs.Test.Patch.Examples.Unwind
Darcs.Test.Patch.WSub
Darcs.Test.Patch.Info
Darcs.Test.Patch.Properties
Darcs.Test.Patch.Properties.V1Set1
Darcs.Test.Patch.Properties.V1Set2
Darcs.Test.Patch.Properties.Generic
Darcs.Test.Patch.Properties.GenericUnwitnessed
Darcs.Test.Patch.Properties.Check
Darcs.Test.Patch.Properties.RepoPatch
Darcs.Test.Patch.Properties.Mergeable
Darcs.Test.Patch.Properties.RepoPatchV3
Darcs.Test.Patch.Arbitrary.Generic
Darcs.Test.Patch.Arbitrary.Named
Darcs.Test.Patch.Arbitrary.NamedPrim
Darcs.Test.Patch.Arbitrary.PatchTree
Darcs.Test.Patch.Arbitrary.PrimFileUUID
Darcs.Test.Patch.Arbitrary.PrimV1
Darcs.Test.Patch.Arbitrary.RepoPatch
Darcs.Test.Patch.Arbitrary.Mergeable
Darcs.Test.Patch.Arbitrary.RepoPatchV1
Darcs.Test.Patch.Arbitrary.RepoPatchV2
Darcs.Test.Patch.Arbitrary.RepoPatchV3
Expand Down Expand Up @@ -681,9 +667,6 @@ test-suite darcs-test
Darcs.Test.UI.Commands.Test.Simple
Darcs.Test.Util.TestResult
Darcs.Test.Util.QuickCheck
Shelly
Shelly.Base
Shelly.Find

if flag(warn-as-error)
ghc-options: -Werror
Expand All @@ -693,9 +676,6 @@ test-suite darcs-test
if impl(ghc >= 9.4.1)
ghc-options: -Wno-gadt-mono-local-binds

if impl(ghc >= 9.0.1)
ghc-options: -Wno-star-is-type

if flag(threaded)
ghc-options: -threaded

Expand Down
16 changes: 12 additions & 4 deletions harness/Darcs/Test/Patch.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ import Darcs.Patch.V1 ( RepoPatchV1 )
import Darcs.Patch.V2.RepoPatch ( RepoPatchV2 )
import Darcs.Patch.V3 ( RepoPatchV3 )
import Darcs.Patch.Commute ( Commute(..) )
import qualified Darcs.Patch.RepoPatch as RP

import Darcs.Test.Patch.Arbitrary.Generic
import Darcs.Test.Patch.Arbitrary.Named ()
import Darcs.Test.Patch.Arbitrary.PrimFileUUID()
import Darcs.Test.Patch.Arbitrary.RepoPatch
import Darcs.Test.Patch.Arbitrary.Mergeable
import Darcs.Test.Patch.Arbitrary.RepoPatchV1 ()
import Darcs.Test.Patch.Arbitrary.RepoPatchV2 ()
import Darcs.Test.Patch.Arbitrary.RepoPatchV3 ()
Expand All @@ -58,10 +59,12 @@ type Prim2 = V2.Prim
-- tests (either QuickCheck or Unit) that should be run on any type of patch
general_patchTests
:: forall p
. ( ArbitraryRepoPatch p, CheckedMerge p
. ( ArbitraryMergeable p, CheckedMerge p
, RP.RepoPatch p
, PrimBased p, Commute (OnlyPrim p), ArbitraryPrim (OnlyPrim p)
, ShrinkModel (PrimOf p)
, Show1 (ModelOf (PrimOf p)), Show2 p
, ShrinkModel (ModelOf p) (PrimOf p)
, Show1 (ModelOf p), Show2 p
, RepoApply (PrimOf p)
)
=> [Test]
general_patchTests =
Expand All @@ -76,6 +79,7 @@ testSuite =
, repoPatchV1Tests
, repoPatchV2Tests
, repoPatchV3Tests
, namedPatchV3Tests
, Darcs.Test.Patch.Depends.testSuite
, Darcs.Test.Patch.Info.testSuite
, Darcs.Test.Patch.Selection.testSuite
Expand Down Expand Up @@ -109,3 +113,7 @@ testSuite =
qc_V3 (undefined :: FileUUID.Prim wX wY) ++
general_patchTests @(RepoPatchV3 FileUUID.Prim)
]
namedPatchV3Tests = testGroup "Named RepoPatchV3"
[ testGroup "using V2.Prim wrapper for Prim.V1" $
qc_Named_V3 (undefined :: Prim2 wX wY)
]
13 changes: 3 additions & 10 deletions harness/Darcs/Test/Patch/Arbitrary/Generic.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{-# LANGUAGE UndecidableInstances #-}
module Darcs.Test.Patch.Arbitrary.Generic
( ArbitraryPrim(..)
, ShrinkPrim
, TestablePrim
, PrimBased(..)
, NullPatch(..)
Expand All @@ -28,7 +27,7 @@ import Darcs.Patch.Witnesses.Ordered
import Darcs.Patch.Apply ( Apply, ApplyState )
import Darcs.Patch.Effect ( Effect(..) )
import Darcs.Patch.Format ( PatchListFormat )
import Darcs.Patch.Merge ( Merge(..) )
import Darcs.Patch.Merge ( CleanMerge, Merge(..) )
import Darcs.Patch.Invert ( Invert(..) )
import Darcs.Patch.Commute ( Commute(..) )
import Darcs.Patch.FromPrim ( PrimOf )
Expand Down Expand Up @@ -119,13 +118,8 @@ class ( ArbitraryState prim
default usesV1Model :: ModelOf prim ~ V1Model => Maybe (Dict (ModelOf prim ~ V1Model))
usesV1Model = Just Dict

type ShrinkPrim prim =
( ShrinkModel prim
, PropagateShrink prim prim
)

type TestablePrim prim =
( Apply prim, Commute prim, Invert prim, Eq2 prim
( Apply prim, CleanMerge prim, Commute prim, Invert prim, Eq2 prim, Show2 prim
, PatchListFormat prim, ShowPatchBasic prim, ReadPatch prim
, RepoModel (ModelOf prim), ApplyState prim ~ RepoState (ModelOf prim)
, ArbitraryPrim prim
Expand All @@ -139,12 +133,11 @@ class ( Effect p, Show2 (OnlyPrim p), ArbitraryState (OnlyPrim p)
, ModelOf p ~ ModelOf (OnlyPrim p)
)
=> PrimBased p where
type OnlyPrim p :: * -> * -> *
type OnlyPrim p :: Type -> Type -> Type
primEffect :: OnlyPrim p wX wY -> FL (PrimOf p) wX wY
liftFromPrim :: OnlyPrim p wX wY -> p wX wY

instance (Commute (OnlyPrim p), PrimBased p) => PrimBased (FL p) where
type OnlyPrim (FL p) = FL (OnlyPrim p)
primEffect = concatFL . mapFL_FL (primEffect @p)
liftFromPrim = mapFL_FL liftFromPrim

Loading

0 comments on commit 95096dc

Please sign in to comment.