Skip to content

Commit

Permalink
Review project stack descriptors according to haskell#2533 (haskell#2874
Browse files Browse the repository at this point in the history
)

* 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
  • Loading branch information
pepeiborra authored and hololeap committed Aug 26, 2022
1 parent a922b18 commit bba7171
Show file tree
Hide file tree
Showing 12 changed files with 178 additions and 814 deletions.
50 changes: 12 additions & 38 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,45 +75,24 @@ defaults: &defaults

version: 2
jobs:
ghc-8.6.5:
stackage-lts16:
environment:
- STACK_FILE: "stack-8.6.5.yaml"
<<: *defaults

ghc-8.8.4:
environment:
- STACK_FILE: "stack-8.8.4.yaml"
<<: *defaults

ghc-8.10.6:
environment:
- STACK_FILE: "stack-8.10.6.yaml"
<<: *defaults

ghc-8.10.7:
environment:
- STACK_FILE: "stack-8.10.7.yaml"
<<: *defaults

ghc-9.0.1:
environment:
- STACK_FILE: "stack-9.0.1.yaml"
<<: *defaults

ghc-9.0.2:
environment:
- STACK_FILE: "stack-9.0.2.yaml"
# https://github.com/digital-asset/ghc-lib/issues/352
- CPATH: "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi:$CPATH"
- STACK_FILE: "stack-lts16.yaml"
<<: *defaults

ghc-9.2.2:
stackage-lts19:
environment:
# https://github.com/digital-asset/ghc-lib/issues/352
- CPATH: "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi:$CPATH"
- STACK_FILE: "stack-9.2.yaml"
- STACK_FILE: "stack-lts19.yaml"
<<: *defaults

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

Expand All @@ -122,11 +101,6 @@ workflows:
version: 2
multiple-ghcs:
jobs:
- ghc-8.6.5
- ghc-8.8.4
- ghc-8.10.6
- ghc-8.10.7
- ghc-9.0.1
- ghc-9.0.2
- ghc-9.2.2
- ghc-default
- stackage-lts16
- stackage-lts19
- stackage-nightly
5 changes: 2 additions & 3 deletions shake-bench/shake-bench.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ author: Pepe Iborra
maintainer: [email protected]
category: Development
build-type: Simple
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
-- description is a single line so that implicit-hie can parse it
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

library
exposed-modules: Development.Benchmark.Rules
Expand Down
10 changes: 6 additions & 4 deletions shake-bench/src/Development/Benchmark/Rules.hs
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ module Development.Benchmark.Rules
) where

import Control.Applicative
import Control.Lens ((^.))
import Control.Lens ((^.), view, preview)
import Control.Monad
import qualified Control.Monad.State as S
import Data.Aeson (FromJSON (..),
ToJSON (..),
Value (..), object,
(.!=), (.:?), (.=))
import Data.Aeson.Lens (_Object)
import Data.Aeson.Lens (_Object, AsJSON (_JSON), _String)
import Data.Char (isDigit)
import Data.List (find, isInfixOf,
stripPrefix,
Expand Down Expand Up @@ -504,8 +504,10 @@ instance FromJSON GitCommit where
parseJSON o@(Object _) = do
let keymap = o ^. _Object
case toList keymap of
[(name, String gitName)] -> pure $ GitCommit gitName (Just name) Nothing True
[(name, Object props)] ->
-- excuse the aeson 2.0 compatibility hack
[(preview _String . toJSON -> Just name, String gitName)] ->
pure $ GitCommit gitName (Just name) Nothing True
[(preview _String . toJSON -> Just name, Object props)] ->
GitCommit
<$> props .:? "git" .!= name
<*> pure (Just name)
Expand Down
92 changes: 0 additions & 92 deletions stack-8.10.6.yaml

This file was deleted.

93 changes: 0 additions & 93 deletions stack-8.10.7.yaml

This file was deleted.

Loading

0 comments on commit bba7171

Please sign in to comment.