Skip to content

Commit 235d5dd

Browse files
authored
Merge pull request #76 from input-output-hk/jdral/open-source
Prepare for Hackage
2 parents 45df065 + 7e2f38f commit 235d5dd

File tree

12 files changed

+72
-85
lines changed

12 files changed

+72
-85
lines changed

.github/workflows/documentation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ jobs:
3232
fail-fast: false
3333

3434
env:
35-
ghc: "9.2.8"
36-
cabal: "3.10.2.0"
35+
ghc: "9.6.6"
36+
cabal: "3.12.1.0"
3737
os: ubuntu-latest"
3838

3939
steps:

.github/workflows/haskell.yml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,15 @@ jobs:
2222
strategy:
2323
fail-fast: false
2424
matrix:
25-
ghc: ["8.10.7", "9.2.8", "9.4.8", "9.6.4", "9.8.2", "9.10.1"]
26-
cabal: ["3.10.3.0"]
25+
ghc: ["8.10.7", "9.2.8", "9.4.8", "9.6.6", "9.8.2", "9.10.1"]
26+
cabal: ["3.12.1.0"]
2727
os: [ubuntu-latest, windows-latest, macOS-13]
28+
no-debug: [""]
29+
include:
30+
- ghc: "9.6.6"
31+
cabal: "3.12.1.0"
32+
os: ubuntu-latest
33+
no-debug: "no-debug"
2834

2935
timeout-minutes: 60
3036

@@ -45,6 +51,12 @@ jobs:
4551
cabal configure --enable-tests --enable-benchmark --ghc-options="-Werror" --ghc-options="-fno-ignore-asserts"
4652
cat cabal.project.local
4753
54+
- name: Configure the build (no-debug)
55+
if: ${{ matrix.no-debug }}
56+
run: |
57+
echo "" > cabal.project.debug
58+
cat cabal.project.debug
59+
4860
- name: Record cabal dependencies
4961
id: record-deps
5062
run: |
@@ -57,15 +69,15 @@ jobs:
5769
cache-name: cache-cabal-build
5870
with:
5971
path: ${{ steps.setup-haskell.outputs.cabal-store }}
60-
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
72+
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project*') }}
6173
restore-keys: |
62-
${{ runner.os }}-${{ matrix.ghc }}-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
74+
${{ runner.os }}-${{ matrix.ghc }}-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project*') }}
6375
${{ runner.os }}-${{ matrix.ghc }}-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-
6476
${{ runner.os }}-${{ matrix.ghc }}-${{ env.cache-name }}-
6577
6678
- name: Install cabal dependencies
6779
id: build-dependencies
68-
run: cabal build --only-dependencies --enable-tests --enable-benchmarks all
80+
run: cabal build --only-dependencies all
6981

7082
- name: "Save cache"
7183
uses: actions/cache/save@v4
@@ -104,8 +116,8 @@ jobs:
104116
strategy:
105117
fail-fast: false
106118
matrix:
107-
ghc: ["9.6.4"]
108-
cabal: ["3.10.3.0"]
119+
ghc: ["9.6.6"]
120+
cabal: ["3.12.1.0"]
109121
os: [ubuntu-latest]
110122

111123
# Fix the index-state so we can get proper caching effects. Change this to a
@@ -171,8 +183,8 @@ jobs:
171183
strategy:
172184
fail-fast: false
173185
matrix:
174-
ghc: ["9.6.4"]
175-
cabal: ["3.10.3.0"]
186+
ghc: ["9.6.6"]
187+
cabal: ["3.12.1.0"]
176188
os: [ubuntu-latest]
177189

178190
# See the comment on the hackage-index-state environment variable for the
@@ -233,7 +245,7 @@ jobs:
233245
strategy:
234246
fail-fast: false
235247
matrix:
236-
ghc: ["9.6.4"]
248+
ghc: ["9.6.6"]
237249
cabal: ["3.10.3.0"]
238250
os: [ubuntu-latest]
239251

cabal.project

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
1-
-- Custom repository for cardano haskell packages
2-
repository cardano-haskell-packages
3-
url: https://input-output-hk.github.io/cardano-haskell-packages
4-
secure: True
5-
root-keys:
6-
3e0cce471cf09815f930210f7827266fd09045445d65923e6d0238a6cd15126f
7-
443abb7fb497a134c343faf52f0b659bd7999bc06b7f63fa76dc99d631f9bea1
8-
a86a1f6ce86c449c46666bda44268677abf29b5b2d2eb5ec7af903ec2f117a82
9-
bcec67e8e99cabfa7764d75ad9b158d72bfacf70ca1d0ec8bc6b4406d1bf8413
10-
c00aae8461a256275598500ea0e187588c35a5d5d7454fb57eac18d9edb86a56
11-
d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee
12-
131
index-state:
142
-- Bump this if you need newer packages from Hackage
15-
, hackage.haskell.org 2024-06-07T00:00:00Z
16-
-- Bump this if you need newer packages from CHaP
17-
, cardano-haskell-packages 2024-06-07T00:00:00Z
3+
, hackage.haskell.org 2024-07-17T00:00:00Z
184

195
packages:
206
fs-api
@@ -26,8 +12,3 @@ benchmarks: True
2612

2713
-- comment me if you are benchmarking
2814
import: cabal.project.debug
29-
30-
if impl(ghc >=9.8)
31-
allow-newer:
32-
-- https://github.com/wrengr/unix-bytestring/pull/46
33-
, unix-bytestring:base

fs-api/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
responsible for picking sensible directory/file names.
3434
* Bump upper version bounds for `io-classes` to `1.6`
3535
* Make it build with `ghc-9.10`.
36+
* Tight dependency bounds.
3637

3738
## 0.2.0.1 -- 2023-10-30
3839

fs-api/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ data HasFS m h = HasFS {
1616

1717
Code that is written using this interface can be run against any implementation
1818
of a file system. The `System.FS.IO` module provides a function for initialising
19-
a `HasFS` interface for the built-in filesystem.
19+
a `HasFS` interface for the real filesystem.
2020

2121
```haskell
22-
ioHasFS :: MonadIO m => MountPoint -> HasFS m HandleIO
22+
ioHasFS :: (MonadIO m, PrimState IO ~ PrimState m) => MountPoint -> HasFS m HandleIO
2323
```
2424

2525
Note that `ioHasFS` requires some context in the form of a `MountPoint`: the

fs-api/fs-api.cabal

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
cabal-version: 3.0
22
name: fs-api
33
version: 0.2.0.1
4-
synopsis: API for file systems
5-
description: API for file systems.
4+
synopsis: Abstract interface for the file system
5+
description: Abstract interface for the file system.
66
license: Apache-2.0
77
license-files:
88
LICENSE
@@ -39,17 +39,17 @@ library
3939

4040
default-language: Haskell2010
4141
build-depends:
42-
, base >=4.14 && <4.21
43-
, bytestring >=0.10 && <0.13
44-
, containers >=0.5 && <0.8
45-
, deepseq
46-
, digest
47-
, directory >=1.3 && <1.4
48-
, filepath >=1.4 && <1.6
49-
, io-classes >=0.3 && <1.6
42+
, base >=4.14 && <4.21
43+
, bytestring ^>=0.10 || ^>=0.11 || ^>=0.12
44+
, containers ^>=0.5 || ^>=0.6 || ^>=0.7
45+
, deepseq ^>=1.4 || ^>=1.5
46+
, digest ^>=0.0
47+
, directory ^>=1.3
48+
, filepath ^>=1.4 || ^>=1.5
49+
, io-classes ^>=1.0 || ^>=1.1 || ^>=1.2 || ^>=1.3 || ^>=1.4 || ^>=1.5
5050
, primitive ^>=0.9
5151
, safe-wild-cards ^>=1.0
52-
, text >=1.2 && <2.2
52+
, text ^>=1.2 || ^>=2.0 || ^>=2.1
5353

5454
if os(windows)
5555
hs-source-dirs: src-win32
@@ -61,8 +61,8 @@ library
6161
hs-source-dirs: src-unix
6262
exposed-modules: System.FS.IO.Unix
6363
build-depends:
64-
, unix
65-
, unix-bytestring >=0.4.0
64+
, unix ^>=2.7 || ^>=2.8
65+
, unix-bytestring ^>=0.4
6666

6767
ghc-options:
6868
-Wall -Wcompat -Wincomplete-uni-patterns

fs-sim/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@
2020
breaking changes:
2121
* Add a `PrimMonad m` constraint to `runSimErrorFS`, `mkSimErrorHasFS'` and `mkSimErrorHasFS`.
2222
* Change the `StrictTVar` argument to `mkSimErrorHasFS` to a `StrictTMVar`.
23+
* Rename `mkSimErrorHasFS` to `simErrorHasFS`.
24+
* Rename `mkSimErrorHasFS'` to `simErrorHasFS'`.
2325

2426
### Non-breaking
2527

2628
* New constructors for the `Errors` type: `hGetBufSomeE`, `hGetBufSomeAtE`,
2729
`hGetBufSomeE`, and `hPutBufSomeAtE`.
30+
* Expose the new `System.FS.Sim.Prim` module.
2831

2932
### Patch
3033

@@ -34,6 +37,7 @@
3437
* The shrinker for `Errors` was not shrinking every stream.
3538
* Adapt to moving of `Util` modules in `fs-api`.
3639
* Make it build with `ghc-9.10`.
40+
* Tight dependency bounds.
3741

3842
## 0.2.1.1 -- 2023-10-30
3943

fs-sim/fs-sim.cabal

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,24 @@ library
3030
System.FS.Sim.Error
3131
System.FS.Sim.FsTree
3232
System.FS.Sim.MockFS
33+
System.FS.Sim.Prim
3334
System.FS.Sim.STM
3435
System.FS.Sim.Stream
3536

36-
other-modules: System.FS.Sim.Prim
3737
default-language: Haskell2010
3838
build-depends:
39-
, base >=4.14 && <4.21
40-
, base16-bytestring
41-
, bytestring >=0.10 && <0.13
42-
, containers >=0.5 && <0.8
39+
, base >=4.14 && <4.21
40+
, base16-bytestring ^>=0.1 || ^>=1.0
41+
, bytestring ^>=0.10 || ^>=0.11 || ^>=0.12
42+
, containers ^>=0.5 || ^>=0.6 || ^>=0.7
4343
, fs-api ^>=0.2
44-
, io-classes >=0.3 && <1.6
45-
, mtl
44+
, io-classes ^>=1.0 || ^>=1.1 || ^>=1.2 || ^>=1.3 || ^>=1.4 || ^>=1.5
45+
, mtl ^>=2.2 || ^>=2.3
4646
, primitive ^>=0.9
47-
, QuickCheck
47+
, QuickCheck ^>=2.13 || ^>=2.14 || ^>=2.15
4848
, safe-wild-cards ^>=1.0
49-
, strict-stm >=0.3 && <1.6
50-
, text >=1.2 && <2.2
49+
, strict-stm ^>=1.0 || ^>=1.1 || ^>=1.2 || ^>=1.3 || ^>=1.4 || ^>=1.5
50+
, text ^>=1.2 || ^>=2.0 || ^>=2.1
5151

5252
ghc-options:
5353
-Wall -Wcompat -Wincomplete-uni-patterns
@@ -56,15 +56,9 @@ library
5656

5757
test-suite fs-sim-test
5858
type: exitcode-stdio-1.0
59-
hs-source-dirs: test src
59+
hs-source-dirs: test
6060
main-is: Main.hs
6161
other-modules:
62-
System.FS.Sim.Error
63-
System.FS.Sim.FsTree
64-
System.FS.Sim.MockFS
65-
System.FS.Sim.Prim
66-
System.FS.Sim.STM
67-
System.FS.Sim.Stream
6862
Test.System.FS.Sim.Error
6963
Test.System.FS.Sim.FsTree
7064
Test.System.FS.StateMachine
@@ -75,20 +69,17 @@ test-suite fs-sim-test
7569
default-language: Haskell2010
7670
build-depends:
7771
, base
78-
, base16-bytestring
7972
, bifunctors
8073
, bytestring
8174
, containers
8275
, fs-api
76+
, fs-sim
8377
, generics-sop
84-
, io-classes
85-
, mtl
8678
, pretty-show
8779
, primitive
8880
, QuickCheck
8981
, quickcheck-state-machine >=0.10
9082
, random
91-
, safe-wild-cards
9283
, strict-stm
9384
, tasty
9485
, tasty-hunit

fs-sim/src/System/FS/Sim/Error.hs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
-- testing error handling.
1111
module System.FS.Sim.Error (
1212
-- * Simulate Errors monad
13-
mkSimErrorHasFS
14-
, mkSimErrorHasFS'
13+
simErrorHasFS
14+
, simErrorHasFS'
1515
, runSimErrorFS
1616
, withErrors
1717
-- * Streams
@@ -481,22 +481,21 @@ instance Arbitrary Errors where
481481
Simulate Errors monad
482482
-------------------------------------------------------------------------------}
483483

484-
-- | Alternative to 'mkSimErrorHasFS' that creates 'TVar's internally.
485-
mkSimErrorHasFS' :: (MonadSTM m, MonadThrow m, PrimMonad m)
484+
-- | Alternative to 'simErrorHasFS' that creates 'TVar's internally.
485+
simErrorHasFS' :: (MonadSTM m, MonadThrow m, PrimMonad m)
486486
=> MockFS
487487
-> Errors
488488
-> m (HasFS m HandleMock)
489-
mkSimErrorHasFS' mockFS errs =
490-
mkSimErrorHasFS <$> newTMVarIO mockFS <*> newTVarIO errs
489+
simErrorHasFS' mockFS errs =
490+
simErrorHasFS <$> newTMVarIO mockFS <*> newTVarIO errs
491491

492492
-- | Introduce possibility of errors
493-
--
494-
-- TODO: Lenses would be nice for the setters
495-
mkSimErrorHasFS :: forall m. (MonadSTM m, MonadThrow m, PrimMonad m)
493+
simErrorHasFS :: forall m. (MonadSTM m, MonadThrow m, PrimMonad m)
496494
=> StrictTMVar m MockFS
497495
-> StrictTVar m Errors
498496
-> HasFS m HandleMock
499-
mkSimErrorHasFS fsVar errorsVar =
497+
simErrorHasFS fsVar errorsVar =
498+
-- TODO: Lenses would be nice for the setters
500499
case Sim.simHasFS fsVar of
501500
hfs@HasFS{..} -> HasFS{
502501
dumpState =
@@ -547,7 +546,7 @@ mkSimErrorHasFS fsVar errorsVar =
547546
withErr errorsVar p1 (renameFile p1 p2) "renameFile"
548547
renameFileE (\e es -> es { renameFileE = e })
549548
, mkFsErrorPath = fsToFsErrorPathUnmounted
550-
, unsafeToFilePath = error "mkSimErrorHasFS:unsafeToFilePath"
549+
, unsafeToFilePath = error "simErrorHasFS:unsafeToFilePath"
551550
-- File I\/O with user-supplied buffers
552551
, hGetBufSome = hGetBufSomeWithErr errorsVar hfs
553552
, hGetBufSomeAt = hGetBufSomeAtWithErr errorsVar hfs
@@ -565,7 +564,7 @@ runSimErrorFS :: (MonadSTM m, MonadThrow m, PrimMonad m)
565564
runSimErrorFS mockFS errors action = do
566565
fsVar <- newTMVarIO mockFS
567566
errorsVar <- newTVarIO errors
568-
a <- action errorsVar $ mkSimErrorHasFS fsVar errorsVar
567+
a <- action errorsVar $ simErrorHasFS fsVar errorsVar
569568
fs' <- atomically $ takeTMVar fsVar
570569
return (a, fs')
571570

fs-sim/src/System/FS/Sim/MockFS.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,9 +859,8 @@ renameFile fpOld fpNew =
859859
-------------------------------------------------------------------------------}
860860

861861
-- | Renders the 'MockFS' in a human-readable fashion.
862-
--
863-
-- TODO: Right now does this not show the state of the handles.
864862
pretty :: MockFS -> String
863+
-- TODO: Right now does this not show the state of the handles.
865864
pretty = FS.pretty renderFile . mockFiles
866865
where
867866
renderFile :: ByteString -> String

0 commit comments

Comments
 (0)