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

Package updates 2024 06 #20

Merged
merged 4 commits into from
Jun 26, 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
58 changes: 18 additions & 40 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.16.6
# version: 0.18.1
#
# REGENDATA ("0.16.6",["github","cached-io.cabal"])
# REGENDATA ("0.18.1",["github","cached-io.cabal"])
#
name: Haskell-CI
on:
Expand All @@ -28,14 +28,14 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.8.1
- compiler: ghc-9.8.2
compilerKind: ghc
compilerVersion: 9.8.1
compilerVersion: 9.8.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.2
- compiler: ghc-9.6.4
compilerKind: ghc
compilerVersion: 9.6.2
compilerVersion: 9.6.4
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.5
Expand All @@ -58,32 +58,17 @@ jobs:
compilerVersion: 8.10.7
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.8.4
compilerKind: ghc
compilerVersion: 8.8.4
setup-method: hvr-ppa
allow-failure: false
fail-fast: false
steps:
- name: apt
run: |
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
if [ "${{ matrix.setup-method }}" = ghcup ]; then
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
else
apt-add-repository -y 'ppa:hvr/ghc'
apt-get update
apt-get install -y "$HCNAME"
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
fi
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -95,20 +80,13 @@ jobs:
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
if [ "${{ matrix.setup-method }}" = ghcup ]; then
HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
else
HC=$HCDIR/bin/$HCKIND
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
fi

HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
Expand Down
4 changes: 2 additions & 2 deletions cached-io.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ author: SumAll, Inc.
maintainer: Bellroy Tech Team <[email protected]>
category: Development
build-type: Simple
tested-with: GHC ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.4 || ==9.4.5 || ==9.6.2 || ==9.8.1
tested-with: GHC ==8.10.7 || ==9.0.2 || ==9.2.4 || ==9.4.5 || ==9.6.4 || ==9.8.2
extra-doc-files:
CHANGELOG.md
README.md
Expand All @@ -22,7 +22,7 @@ source-repository head
location: https://github.com/bellroy/haskell-cached-io.git

common deps
build-depends: base >=4.13.0.0 && <4.20
build-depends: base >=4.13.0.0 && <4.21

library
import: deps
Expand Down
25 changes: 8 additions & 17 deletions cached-io.nix
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
{ mkDerivation
, lib
, base
, exceptions
, stm
, time
, transformers
}:
{ mkDerivation, base, exceptions, lib, stm, time, transformers }:
mkDerivation {
pname = "cached-io";
version = "1.1.0.0";
version = "1.3.0.0";
src = ./.;
libraryHaskellDepends = [
base
exceptions
stm
time
transformers
];
description = "A simple library to cache a single IO action with timeout";
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [ base exceptions stm time transformers ];
executableHaskellDepends = [ base ];
description = "A simple library to cache IO actions";
license = lib.licenses.asl20;
mainProgram = "test-cachedIO";
}
59 changes: 47 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 20 additions & 47 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,26 @@
description = "A simple library to cache a single IO action with timeout";

inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs";
bellroy-nix-foss.url = "github:bellroy/bellroy-nix-foss";
};

outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
rec
{
# This becomes the list of package and devShell names.
supportedCompilers = [
"ghc88"
"ghc810"
"ghc90"
"ghc92"
"ghc94"
"ghc96"
"ghc98"
];

packages = builtins.listToAttrs (
builtins.map
(compiler: {
name = compiler;
value = pkgs.haskell.packages.${compiler}.callPackage ./cached-io.nix { };
})
supportedCompilers
);

devShells' = (builtins.mapAttrs
(compiler: v: v.env.overrideAttrs (oldAttrs: {
buildInputs = oldAttrs.buildInputs
++ [ pkgs.nixpkgs-fmt ]
++ (with pkgs.haskell.packages.${compiler}; [
cabal-fmt
cabal-install
doctest
haskell-ci
haskell-language-server
hlint
]);
}))
packages
);

devShells = devShells' // { default = devShells'.ghc92; };
});
outputs = inputs:
inputs.bellroy-nix-foss.lib.haskellProject {
cabalPackages = [
{
name = "cached-io";
path = ./cached-io.nix;
}
];
supportedCompilers = [
"ghc810"
"ghc90"
"ghc92"
"ghc94"
"ghc96"
"ghc98"
"ghc910"
];
defaultCompiler = "ghc96";
};
}
Loading