Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump cabal version #196

Merged
merged 2 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type nix-shell >/dev/null 2>&1 && use nix
24 changes: 9 additions & 15 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,26 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: ["9.2.2", "9.0.2", "8.10.7", "8.8.4", "8.6.5"]
ghc: ["9.10.1", "9.8.2", "9.6.6"]
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
- uses: actions/checkout@v2

- uses: haskell/actions/setup@v1
- uses: haskell-actions/setup@v2.7.5
id: setup-haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: 3.6.2.0
cabal-version: 3.12.1.0

- name: Set some window specific things
if: matrix.os == 'windows-latest'
run: echo 'EXE_EXT=.exe' >> $GITHUB_ENV

- name: Configure project
run: cabal configure --enable-tests --enable-benchmarks --write-ghc-environment-files=ghc8.4.4+
run: |
cabal configure --enable-tests --enable-benchmarks --write-ghc-environment-files=ghc8.4.4+
cabal build all --enable-tests --dry-run

- name: Cabal cache over S3
uses: action-works/cabal-cache-s3@v1
Expand All @@ -46,7 +48,7 @@ jobs:
dist-dir: dist-newstyle
store-path: ${{ steps.setup-haskell.outputs.cabal-store }}
threads: 16
archive-uri: ${{ secrets.BINARY_CACHE_URI }}
archive-uri: ${{ secrets.BINARY_CACHE_URI }}/${{ env.CABAL_CACHE_VERSION }}/${{ runner.os }}/${{ matrix.cabal }}/${{ matrix.ghc }}
skip: "${{ secrets.BINARY_CACHE_URI == '' }}"

- name: Cabal cache over HTTPS
Expand All @@ -55,7 +57,7 @@ jobs:
dist-dir: dist-newstyle
store-path: ${{ steps.setup-haskell.outputs.cabal-store }}
threads: 16
archive-uri: https://cache.haskellworks.io/archive
archive-uri: https://cache.haskellworks.io/${{ env.CABAL_CACHE_VERSION }}/${{ runner.os }}/${{ matrix.cabal }}/${{ matrix.ghc }}
skip: "${{ secrets.BINARY_CACHE_URI != '' }}"

- name: Build
Expand Down Expand Up @@ -157,14 +159,6 @@ jobs:
fi
done

- name: "Build Changelog"
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v3
env:
GITHUB_TOKEN: ${{ github.token }}
with:
toTag: "{{ github.ref }}"

- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand All @@ -173,6 +167,6 @@ jobs:
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ needs.check.outputs.tag }}
body: ${{ steps.build_changelog.outputs.changelog }}
body: Undocumented
draft: true
prerelease: false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ stack.yaml.lock
*~
/.ghc.environment.*

.direnv/
11 changes: 5 additions & 6 deletions avro.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 2.4

name: avro
version: 0.6.1.2
version: 0.6.2.1
synopsis: Avro serialization support for Haskell
description: Avro serialization and deserialization support for Haskell
category: Data
Expand All @@ -11,7 +11,7 @@ author: Thomas M. DuBuisson
maintainer: Alexey Raga <alexey.raga@gmail.com>
license: BSD-3-Clause
license-file: LICENSE
tested-with: GHC == 9.2.2, GHC == 9.0.2, GHC == 8.10.7, GHC == 8.8.4, GHC == 8.6.5
tested-with: GHC == 9.10.1, GHC == 9.8.2, GHC == 9.6.6
build-type: Simple
extra-source-files: README.md
ChangeLog.md
Expand Down Expand Up @@ -75,7 +75,7 @@ common raw-strings-qq { build-depends: raw-strings-qq
common scientific { build-depends: scientific }
common semigroups { build-depends: semigroups }
common tagged { build-depends: tagged }
common text { build-depends: text >= 1.2.3 && < 1.3 || >= 2.0 && < 2.1 }
common text { build-depends: text >= 1.2.3 && < 1.3 || >= 2.0 && < 2.2 }
common time { build-depends: time }
common template-haskell { build-depends: template-haskell >= 2.4 && < 3 }
common tf-random { build-depends: tf-random }
Expand All @@ -86,7 +86,7 @@ common uuid { build-depends: uuid
common vector { build-depends: vector }
common zlib { build-depends: zlib }

common gauge { if arch(x86_64) || arch(i386) { build-depends: gauge } }
common gauge { build-depends: criterion }

common config
default-language: Haskell2010
Expand Down Expand Up @@ -267,8 +267,7 @@ benchmark bench-time
default-language: Haskell2010
type: exitcode-stdio-1.0
main-is: Main.hs
if arch(x86_64) || arch(i386)
other-modules: Bench.Deconflict
other-modules: Bench.Deconflict
Bench.Deconflict.Reader
Bench.Deconflict.Writer
Bench.Encoding
Expand Down
9 changes: 5 additions & 4 deletions bench/Bench/Deconflict.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Bench.Deconflict
)
where

import Data.Avro (decodeContainerWithReaderSchema, decodeValue, decodeValueWithSchema, encodeContainerWithSchema, encodeValueWithSchema, nullCodec)
import Data.Avro (decodeContainerWithReaderSchema, decodeValueWithSchema, encodeContainerWithSchema, encodeValueWithSchema, nullCodec)
import Data.Avro.Schema.ReadSchema (fromSchema)
import Data.Vector (Vector)

Expand All @@ -17,7 +17,8 @@ import qualified Bench.Deconflict.Writer as W
import qualified Data.Vector as Vector
import qualified System.Random as Random

import Gauge
-- import Gauge
import Criterion.Main

newOuter :: IO W.Outer
newOuter = do
Expand All @@ -29,12 +30,12 @@ many :: Int -> IO a -> IO (Vector a)
many = Vector.replicateM

values :: Benchmark
values = env (many 1e5 $ encodeValueWithSchema W.schema'Outer <$> newOuter) $ \ values ->
values = env (many 1e5 $ encodeValueWithSchema W.schema'Outer <$> newOuter) $ \ vs ->
let
readSchema = fromSchema W.schema'Outer
in bgroup "Encoded: ByteString"
[ bgroup "No Deconflict"
[ bench "Read via FromAvro" $ nf (fmap (decodeValueWithSchema @W.Outer readSchema)) values
[ bench "Read via FromAvro" $ nf (fmap (decodeValueWithSchema @W.Outer readSchema)) vs
]
]

Expand Down
7 changes: 3 additions & 4 deletions bench/Bench/Encoding.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@ module Bench.Encoding
where

import Control.DeepSeq
import Data.Avro (decodeContainerWithEmbeddedSchema, encodeContainer, encodeContainerWithSchema, encodeValueWithSchema, nullCodec)
import Data.Avro (decodeContainerWithEmbeddedSchema, encodeValueWithSchema, nullCodec)
import qualified Data.Avro as Avro
import Data.Avro.Deriving (deriveAvroFromByteString, r)
import Data.ByteString (ByteString)
import Data.ByteString.Builder
import qualified Data.ByteString.Lazy as BL
import Data.List (unfoldr)
import qualified Data.Vector as Vector
import qualified System.Random as Random

import Gauge
-- import Gauge
import Criterion.Main

deriveAvroFromByteString [r|
{
Expand Down
15 changes: 8 additions & 7 deletions bench/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@

module Main where

#if defined(i386_HOST_ARCH) || defined(x86_64_HOST_ARCH)
-- #if defined(i386_HOST_ARCH) || defined(x86_64_HOST_ARCH)
import qualified Bench.Deconflict as Deconflict
import qualified Bench.Encoding as Encoding
import Gauge
#endif
import Criterion.Main
-- import Gauge
-- #endif

main :: IO ()
main =
#if defined(i386_HOST_ARCH) || defined(x86_64_HOST_ARCH)
-- #if defined(i386_HOST_ARCH) || defined(x86_64_HOST_ARCH)
defaultMain
[ Deconflict.values
, Encoding.encodeToBS
, Encoding.encodeContainer
, Encoding.roundtripContainer
, Deconflict.container
]
#else
return ()
#endif
-- #else
-- return ()
-- #endif
34 changes: 3 additions & 31 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,40 +1,12 @@
with (import <nixpkgs> {config.allowUnfree = true;});

let
vscode-overlay = self: super: {
vscode-with-extensions = super.vscode-with-extensions.override {
vscodeExtensions = with super.vscode-extensions; [
bbenoist.Nix
] ++ super.vscode-utils.extensionsFromVscodeMarketplace [
{
name = "language-haskell";
publisher = "justusadam";
version = "2.7.0";
sha256 = "1z6nxbg1a0yvbdicib3kxl04hrxwxi3p1hmc0qfahqkf6xwcmlc5";
}
{
name = "vscode-hie-server";
publisher = "alanz";
version = "0.0.34";
sha256 = "0cipm36l3219r1yhk4j7l02mc2c0chfnv7wl44n1h0966jp1sda3";
}
];
};
};
in
with import <unstable> {
overlays = [ vscode-overlay ];
};

pkgs.mkShell {
buildInputs = with pkgs; [
zlib
ghc
haskell.compiler.ghc910
cabal-install
vscode-with-extensions

vivaldi
vivaldi-widevine
vivaldi-ffmpeg-codecs

];

shellHook = ''
Expand Down
Loading