Compare commits

...

4 Commits

Author SHA1 Message Date
Bodigrim
e4e28edc1a Drop support of GHC < 8.0 2024-07-06 12:53:05 +01:00
Bodigrim
9a935dbb23 Release 0.4 2024-07-06 11:39:12 +01:00
Bodigrim
2edc18e70e Regenerate CI 2024-07-06 11:38:58 +01:00
Bodigrim
653de045a1 Revert "Add unRelStDev :: RelStDev -> Double"
This reverts commit fe8fa28f3f.
2024-07-06 11:31:49 +01:00
6 changed files with 22 additions and 247 deletions

View File

@ -1,176 +0,0 @@
name: ghc-lt-8
on:
- push
- pull_request
jobs:
linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }}
runs-on: ubuntu-20.04
timeout-minutes:
60
container:
image: buildpack-deps:bionic
continue-on-error: false
strategy:
matrix:
include:
- compiler: ghc-7.10.3
compilerKind: ghc
compilerVersion: 7.10.3
- compiler: ghc-7.8.4
compilerKind: ghc
compilerVersion: 7.8.4
- compiler: ghc-7.6.3
compilerKind: ghc
compilerVersion: 7.6.3
- compiler: ghc-7.4.2
compilerKind: ghc
compilerVersion: 7.4.2
- compiler: ghc-7.2.2
compilerKind: ghc
compilerVersion: 7.2.2
- compiler: ghc-7.0.4
compilerKind: ghc
compilerVersion: 7.0.4
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
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.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" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
HCVER: ${{ matrix.compilerVersion }}
- name: Set PATH and environment variables
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
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.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"
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
HCVER: ${{ matrix.compilerVersion }}
- name: env
run: |
env
- name: write cabal config
run: |
mkdir -p $CABAL_DIR
cat >> $CABAL_CONFIG <<EOF
remote-build-reporting: anonymous
write-ghc-environment-files: never
remote-repo-cache: $CABAL_DIR/packages
logs-dir: $CABAL_DIR/logs
world-file: $CABAL_DIR/world
extra-prog-path: $CABAL_DIR/bin
symlink-bindir: $CABAL_DIR/bin
installdir: $CABAL_DIR/bin
build-summary: $CABAL_DIR/logs/build.log
store-dir: $CABAL_DIR/store
install-dirs user
prefix: $CABAL_DIR
repository hackage.haskell.org
url: http://hackage.haskell.org/
EOF
cat >> $CABAL_CONFIG <<EOF
program-default-options
ghc-options: $GHCJOBS +RTS -M3G -RTS
EOF
cat $CABAL_CONFIG
- name: versions
run: |
$HC --version || true
$HC --print-project-git-commit-id || true
$CABAL --version || true
- name: update cabal index
run: |
$CABAL v2-update -v
- name: checkout
uses: actions/checkout@v3
with:
path: source
- name: initial cabal.project for sdist
run: |
touch cabal.project
echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
cat cabal.project
- name: sdist
run: |
mkdir -p sdist
$CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
- name: unpack
run: |
mkdir -p unpacked
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
- name: generate cabal.project
run: |
PKGDIR_tasty_bench="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/tasty-bench-[0-9.]*')"
echo "PKGDIR_tasty_bench=${PKGDIR_tasty_bench}" >> "$GITHUB_ENV"
rm -f cabal.project cabal.project.local
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_tasty_bench}" >> cabal.project
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(tasty-bench)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: restore cache
uses: actions/cache/restore@v3
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
- name: install dependencies
run: |
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
- name: build w/o tests
run: |
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: build
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
- name: cabal check
run: |
cd ${PKGDIR_tasty_bench} || false
${CABAL} -vnormal check
- name: unconstrained build
run: |
rm -f cabal.project.local
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: prepare for constraint sets
run: |
rm -f cabal.project.local
- name: constraint set no-tasty
run: |
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='tasty-bench -tasty' all --dry-run
cabal-plan topo | sort
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='tasty-bench -tasty' --dependencies-only -j2 all
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='tasty-bench -tasty' all
- name: save cache
uses: actions/cache/save@v3
if: always()
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store

View File

@ -8,9 +8,9 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.19.20240608
# version: 0.19.20240702
#
# REGENDATA ("0.19.20240608",["github","tasty-bench.cabal","--haddock-jobs=>=8.2"])
# REGENDATA ("0.19.20240702",["github","tasty-bench.cabal","--haddock-jobs=>=8.2"])
#
name: Haskell-CI
on:
@ -38,9 +38,9 @@ jobs:
compilerVersion: 9.8.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.5
- compiler: ghc-9.6.6
compilerKind: ghc
compilerVersion: 9.6.5
compilerVersion: 9.6.6
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.8
@ -98,7 +98,7 @@ jobs:
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)
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
@ -116,7 +116,7 @@ jobs:
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"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.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"

View File

@ -42,7 +42,8 @@ is up to 6x faster than `criterion` and up to 8x faster than `gauge`.
`tasty-bench` is a native Haskell library and works everywhere, where GHC
does, including WASM. We support a full range of architectures (`i386`, `amd64`, `armhf`,
`arm64`, `ppc64le`, `s390x`) and operating systems (Linux, Windows, macOS,
FreeBSD, OpenBSD, NetBSD), plus any GHC from 7.0 to 9.10.
FreeBSD, OpenBSD, NetBSD), plus any GHC from 8.0 to 9.10
(and earlier releases stretch back to GHC 7.0).
## How is it possible?

View File

@ -13,7 +13,6 @@
* Decomission warning when `--timeout` is absent.
* Add `instance {Eq,Ord,Num,Fractional} {RelStDev,FailIfSlower,FailIfFaster}`.
* Add `instance {Eq,Ord} {CsvPath,SvgPath,BaselinePath}`.
* Add `unRelStDev :: RelStDev -> Double`.
# 0.3.5

View File

@ -27,7 +27,7 @@ machine is up to 16x faster than @criterion@ and up to 4x faster than
GHC does, including WASM. We support a full range of architectures
(@i386@, @amd64@, @armhf@, @arm64@, @ppc64le@, @s390x@) and operating
systems (Linux, Windows, macOS, FreeBSD, OpenBSD, NetBSD), plus any GHC
from 7.0 to 9.10.
from 8.0 to 9.10 (and earlier releases stretch back to GHC 7.0).
=== How is it possible?
@ -720,12 +720,9 @@ import Data.Proxy
import Data.Traversable (forM)
import Data.Word (Word64)
import GHC.Conc
#if MIN_VERSION_base(4,5,0)
import GHC.IO.Encoding
#endif
#if MIN_VERSION_base(4,6,0)
import GHC.Stats
#endif
import GHC.Types (SPEC(..))
import System.CPUTime
import System.Exit
import System.IO
@ -734,17 +731,8 @@ import System.Mem
import Text.Printf
#ifdef MIN_VERSION_tasty
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid (Monoid(..))
#endif
#if MIN_VERSION_base(4,9,0)
import Data.Semigroup (Semigroup(..))
#endif
#if MIN_VERSION_containers(0,5,0)
import qualified Data.IntMap.Strict as IM
#else
import qualified Data.IntMap as IM
#endif
import Data.IntMap (IntMap)
import Data.Sequence (Seq, (<|))
import qualified Data.Sequence as Seq
@ -771,15 +759,6 @@ import Data.Time.Clock.POSIX (getPOSIXTime)
import Data.Word (Word32)
#endif
#if MIN_VERSION_ghc_prim(0,3,1)
import GHC.Types (SPEC(..))
#else
import GHC.Exts (SpecConstrAnnotation(..))
data SPEC = SPEC | SPEC2
{-# ANN type SPEC ForceSpecConstr #-}
#endif
#ifndef MIN_VERSION_tasty
data Timeout
= Timeout
@ -810,10 +789,8 @@ type Progress = ()
-- only once, use command-line option @--stdev@ @Infinity@.
--
-- @since 0.2
newtype RelStDev = RelStDev
{ unRelStDev :: Double
-- ^ @since 0.4
} deriving
newtype RelStDev = RelStDev Double
deriving
( Eq
-- ^ @since 0.4
, Ord
@ -966,16 +943,12 @@ newtype Benchmarkable =
-- | 'defaultMain' forces 'setLocaleEncoding' to 'utf8', but users might
-- be running benchmarks outside of it (e. g., via 'defaultMainWithIngredients').
supportsUnicode :: Bool
#if MIN_VERSION_base(4,5,0)
supportsUnicode = take 3 (textEncodingName enc) == "UTF"
#if defined(mingw32_HOST_OS)
&& unsafePerformIO getConsoleOutputCP == 65001
#endif
where
enc = unsafePerformIO getLocaleEncoding
#else
supportsUnicode = False
#endif
{-# NOINLINE supportsUnicode #-}
mu :: Char
@ -1105,10 +1078,8 @@ predictPerturbed t1 t2 = Estimate
hasGCStats :: Bool
#if MIN_VERSION_base(4,10,0)
hasGCStats = unsafePerformIO getRTSStatsEnabled
#elif MIN_VERSION_base(4,6,0)
hasGCStats = unsafePerformIO getGCStatsEnabled
#else
hasGCStats = False
hasGCStats = unsafePerformIO getGCStatsEnabled
#endif
getAllocsAndCopied :: IO (Word64, Word64, Word64)
@ -1116,10 +1087,8 @@ getAllocsAndCopied = do
if not hasGCStats then pure (0, 0, 0) else
#if MIN_VERSION_base(4,10,0)
(\s -> (allocated_bytes s, copied_bytes s, max_mem_in_use_bytes s)) <$> getRTSStats
#elif MIN_VERSION_base(4,6,0)
(\s -> (int64ToWord64 $ bytesAllocated s, int64ToWord64 $ bytesCopied s, int64ToWord64 $ peakMegabytesAllocated s * 1024 * 1024)) <$> getGCStats
#else
pure (0, 0, 0)
(\s -> (int64ToWord64 $ bytesAllocated s, int64ToWord64 $ bytesCopied s, int64ToWord64 $ peakMegabytesAllocated s * 1024 * 1024)) <$> getGCStats
#endif
getWallTimeSecs :: IO Double
@ -1343,9 +1312,7 @@ type Benchmark = TestTree
defaultMain :: [Benchmark] -> IO ()
defaultMain bs = do
let act = defaultMain' bs
#if MIN_VERSION_base(4,5,0)
setLocaleEncoding utf8
#endif
#if defined(mingw32_HOST_OS)
codePage <- getConsoleOutputCP
bracket (setConsoleOutputCP 65001) (const $ setConsoleOutputCP codePage) (const act)
@ -2058,23 +2025,14 @@ forceFail r = r { resultOutcome = Failure TestFailed, resultShortDescription = "
data Unique a = None | Unique !a | NotUnique
deriving (Functor)
appendUnique :: Unique a -> Unique a -> Unique a
appendUnique None a = a
appendUnique a None = a
appendUnique _ _ = NotUnique
#if MIN_VERSION_base(4,9,0)
instance Semigroup (Unique a) where
(<>) = appendUnique
#endif
None <> a = a
a <> None = a
_ <> _ = NotUnique
instance Monoid (Unique a) where
mempty = None
#if MIN_VERSION_base(4,9,0)
mappend = (<>)
#else
mappend = appendUnique
#endif
modifyConsoleReporter
:: [OptionDescription]
@ -2187,7 +2145,7 @@ word64ToInt64 = fromIntegral
word64ToDouble :: Word64 -> Double
word64ToDouble = fromIntegral
#if !MIN_VERSION_base(4,10,0) && MIN_VERSION_base(4,6,0)
#if !MIN_VERSION_base(4,10,0)
int64ToWord64 :: Int64 -> Word64
int64ToWord64 = fromIntegral
#endif

View File

@ -1,5 +1,5 @@
name: tasty-bench
version: 0.3.5
version: 0.4
cabal-version: 1.18
build-type: Simple
license: MIT
@ -25,7 +25,7 @@ extra-doc-files:
example.svg
README.md
tested-with: GHC == 9.10.1, GHC == 9.8.2, GHC == 9.6.5, GHC == 9.4.8, GHC == 9.2.8, GHC==9.0.2, GHC==8.10.7, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2
tested-with: GHC == 9.10.1, GHC == 9.8.2, GHC == 9.6.6, GHC == 9.4.8, GHC == 9.2.8, GHC==9.0.2, GHC==8.10.7, GHC==8.8.4, GHC==8.6.5, GHC==8.4.4, GHC==8.2.2, GHC==8.0.2
source-repository head
type: git
@ -42,11 +42,7 @@ library
exposed-modules: Test.Tasty.Bench
hs-source-dirs: src
default-language: Haskell2010
ghc-options: -O2 -Wall -fno-warn-unused-imports
if impl(ghc < 7.10)
ghc-options: -fcontext-stack=30
if impl(ghc >= 8.0)
ghc-options: -Wcompat -Widentities
ghc-options: -O2 -Wall -fno-warn-unused-imports -Wcompat -Widentities
build-depends:
base >= 4.3 && < 5,
@ -54,11 +50,8 @@ library
ghc-prim < 0.12
if flag(tasty)
build-depends:
containers >= 0.4 && < 0.8,
containers >= 0.5 && < 0.8,
tasty >= 1.4 && < 1.6
if impl(ghc < 7.8)
build-depends:
tagged >= 0.2 && < 0.9
if impl(ghc < 8.4)
build-depends:
time >= 1.2 && < 1.13