Skip to content

Commit c0189b8

Browse files
pepeiborrasloorush
authored andcommitted
Review project stack descriptors according to haskell#2533 (haskell#2874)
* Review project stack descriptors according to haskell#2533 * adjust shake-bench cabal descriptor to work with gen-hie * Fix shake-bench to build with aeson 2.x * track also LTS 16
1 parent 66a6e83 commit c0189b8

12 files changed

+178
-814
lines changed

.circleci/config.yml

+12-38
Original file line numberDiff line numberDiff line change
@@ -75,45 +75,24 @@ defaults: &defaults
7575

7676
version: 2
7777
jobs:
78-
ghc-8.6.5:
78+
stackage-lts16:
7979
environment:
80-
- STACK_FILE: "stack-8.6.5.yaml"
81-
<<: *defaults
82-
83-
ghc-8.8.4:
84-
environment:
85-
- STACK_FILE: "stack-8.8.4.yaml"
86-
<<: *defaults
87-
88-
ghc-8.10.6:
89-
environment:
90-
- STACK_FILE: "stack-8.10.6.yaml"
91-
<<: *defaults
92-
93-
ghc-8.10.7:
94-
environment:
95-
- STACK_FILE: "stack-8.10.7.yaml"
96-
<<: *defaults
97-
98-
ghc-9.0.1:
99-
environment:
100-
- STACK_FILE: "stack-9.0.1.yaml"
101-
<<: *defaults
102-
103-
ghc-9.0.2:
104-
environment:
105-
- STACK_FILE: "stack-9.0.2.yaml"
80+
# https://github.com/digital-asset/ghc-lib/issues/352
81+
- CPATH: "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi:$CPATH"
82+
- STACK_FILE: "stack-lts16.yaml"
10683
<<: *defaults
10784

108-
ghc-9.2.2:
85+
stackage-lts19:
10986
environment:
11087
# https://github.com/digital-asset/ghc-lib/issues/352
11188
- CPATH: "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi:$CPATH"
112-
- STACK_FILE: "stack-9.2.yaml"
89+
- STACK_FILE: "stack-lts19.yaml"
11390
<<: *defaults
11491

115-
ghc-default:
92+
stackage-nightly:
11693
environment:
94+
# https://github.com/digital-asset/ghc-lib/issues/352
95+
- CPATH: "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi:$CPATH"
11796
- STACK_FILE: "stack.yaml"
11897
<<: *defaults
11998

@@ -122,11 +101,6 @@ workflows:
122101
version: 2
123102
multiple-ghcs:
124103
jobs:
125-
- ghc-8.6.5
126-
- ghc-8.8.4
127-
- ghc-8.10.6
128-
- ghc-8.10.7
129-
- ghc-9.0.1
130-
- ghc-9.0.2
131-
- ghc-9.2.2
132-
- ghc-default
104+
- stackage-lts16
105+
- stackage-lts19
106+
- stackage-nightly

shake-bench/shake-bench.cabal

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ author: Pepe Iborra
88
maintainer: [email protected]
99
category: Development
1010
build-type: Simple
11-
description:
12-
A library Shake rules to build and run benchmarks for multiple revisions of a project.
13-
An example of usage can be found in the ghcide benchmark suite
11+
-- description is a single line so that implicit-hie can parse it
12+
description: A library Shake rules to build and run benchmarks for multiple revisions of a project. An example of usage can be found in the ghcide benchmark suite
1413

1514
library
1615
exposed-modules: Development.Benchmark.Rules

shake-bench/src/Development/Benchmark/Rules.hs

+6-4
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ module Development.Benchmark.Rules
6767
) where
6868

6969
import Control.Applicative
70-
import Control.Lens ((^.))
70+
import Control.Lens ((^.), view, preview)
7171
import Control.Monad
7272
import qualified Control.Monad.State as S
7373
import Data.Aeson (FromJSON (..),
7474
ToJSON (..),
7575
Value (..), object,
7676
(.!=), (.:?), (.=))
77-
import Data.Aeson.Lens (_Object)
77+
import Data.Aeson.Lens (_Object, AsJSON (_JSON), _String)
7878
import Data.Char (isDigit)
7979
import Data.List (find, isInfixOf,
8080
stripPrefix,
@@ -504,8 +504,10 @@ instance FromJSON GitCommit where
504504
parseJSON o@(Object _) = do
505505
let keymap = o ^. _Object
506506
case toList keymap of
507-
[(name, String gitName)] -> pure $ GitCommit gitName (Just name) Nothing True
508-
[(name, Object props)] ->
507+
-- excuse the aeson 2.0 compatibility hack
508+
[(preview _String . toJSON -> Just name, String gitName)] ->
509+
pure $ GitCommit gitName (Just name) Nothing True
510+
[(preview _String . toJSON -> Just name, Object props)] ->
509511
GitCommit
510512
<$> props .:? "git" .!= name
511513
<*> pure (Just name)

stack-8.10.6.yaml

-92
This file was deleted.

stack-8.10.7.yaml

-93
This file was deleted.

0 commit comments

Comments
 (0)