Skip to content

Support 7.2 and 7.3 #57

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

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from
Draft
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
65 changes: 30 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,18 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
cabal: ["3.4"]
cabal: ["3.10.1.0"]
ghc:
- "8.10.7"
- "9.0.2"
- "9.2.3"
- "9.4.6"
- "9.6.2"
fdb-version:
- "7.3.26"
- "7.2.9"
- "7.1.15"
- "7.0.0"
- "6.3.12"
- "6.2.20"
- "6.1.13"
- "6.0.18"
- "5.2.8"
fdb-api-version:
- "520"
- "600"
Expand All @@ -39,37 +38,33 @@ jobs:
- "630"
- "700"
- "710"
- "720"
- "730"
# For a given installed FDB version, the client can choose to connect
# with an older version, but not a newer. This clumsily enforces that
# rule.
exclude:
- {fdb-version: "7.0.0", fdb-api-version: "710"}
- {fdb-version: "6.3.12", fdb-api-version: "710"}
- {fdb-version: "6.2.20", fdb-api-version: "710"}
- {fdb-version: "6.1.13", fdb-api-version: "710"}
- {fdb-version: "6.1.13", fdb-api-version: "710"}
- {fdb-version: "6.0.18", fdb-api-version: "710"}
- {fdb-version: "6.0.18", fdb-api-version: "710"}
- {fdb-version: "6.0.18", fdb-api-version: "710"}
- {fdb-version: "5.2.8", fdb-api-version: "710"}
- {fdb-version: "6.3.12", fdb-api-version: "700"}
- {fdb-version: "6.2.20", fdb-api-version: "700"}
- {fdb-version: "6.1.13", fdb-api-version: "700"}
- {fdb-version: "6.1.13", fdb-api-version: "620"}
- {fdb-version: "6.1.13", fdb-api-version: "630"}
- {fdb-version: "6.1.13", fdb-api-version: "700"}
- {fdb-version: "6.0.18", fdb-api-version: "700"}
- {fdb-version: "6.0.18", fdb-api-version: "700"}
- {fdb-version: "6.0.18", fdb-api-version: "700"}
- {fdb-version: "5.2.8", fdb-api-version: "700"}
- {fdb-version: "6.1.13", fdb-api-version: "710"}
- {fdb-version: "6.1.13", fdb-api-version: "720"}
- {fdb-version: "6.1.13", fdb-api-version: "730"}
- {fdb-version: "6.2.20", fdb-api-version: "630"}
- {fdb-version: "6.1.13", fdb-api-version: "630"}
- {fdb-version: "6.1.13", fdb-api-version: "620"}
- {fdb-version: "6.0.18", fdb-api-version: "630"}
- {fdb-version: "6.0.18", fdb-api-version: "620"}
- {fdb-version: "6.0.18", fdb-api-version: "610"}
- {fdb-version: "5.2.8", fdb-api-version: "630"}
- {fdb-version: "5.2.8", fdb-api-version: "620"}
- {fdb-version: "5.2.8", fdb-api-version: "610"}
- {fdb-version: "5.2.8", fdb-api-version: "600"}
- {fdb-version: "6.2.20", fdb-api-version: "700"}
- {fdb-version: "6.2.20", fdb-api-version: "710"}
- {fdb-version: "6.2.20", fdb-api-version: "720"}
- {fdb-version: "6.2.20", fdb-api-version: "730"}
- {fdb-version: "6.3.12", fdb-api-version: "700"}
- {fdb-version: "6.3.12", fdb-api-version: "710"}
- {fdb-version: "6.3.12", fdb-api-version: "720"}
- {fdb-version: "6.3.12", fdb-api-version: "730"}
- {fdb-version: "7.0.0", fdb-api-version: "710"}
- {fdb-version: "7.0.0", fdb-api-version: "720"}
- {fdb-version: "7.0.0", fdb-api-version: "730"}
- {fdb-version: "7.1.15", fdb-api-version: "720"}
- {fdb-version: "7.1.15", fdb-api-version: "730"}
- {fdb-version: "7.2.7", fdb-api-version: "730"}

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -110,12 +105,12 @@ jobs:
strategy:
fail-fast: false
matrix:
stack: ["2.1.3"]
ghc: ["8.8.3"]
stack: ["2.11.1"]
ghc: ["9.4.6"]
fdb-version:
- "7.1.15"
- "7.3.15"
fdb-api-version:
- "710"
- "730"

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ I am not using this in a production-like context, but I have exercised the code

### Supported FoundationDB versions

Currently supports 5.2.x through 7.1.x. By default, this package builds assuming that you have installed the latest supported version of FoundationDB. If not, you need to set the appropriate flag when building the library. For example, if you installed FoundationDB 6.0.x, you need to build with
Currently supports 5.2.x through 7.3.x. By default, this package builds assuming that you have installed the latest supported version of FoundationDB. If not, you need to set the appropriate flag when building the library. For example, if you installed FoundationDB 6.0.x, you need to build with

`stack build --flag foundationdb-haskell:fdb-version-600`

Expand Down
6 changes: 6 additions & 0 deletions ci/export-fdb-version-flag-cabal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ elif [[ ${FDB_VER} = "7.0.0" ]]
then
export FDB_VER_FLAG='-f fdb-version-700'
elif [[ ${FDB_VER} = "7.1.15" ]]
then
export FDB_VER_FLAG='-f fdb-version-710'
elif [[ ${FDB_VER} = "7.2.7" ]]
then
export FDB_VER_FLAG='-f fdb-version-720'
elif [[ ${FDB_VER} = "7.3.15" ]]
then
# latest is the default, so no flag is specified
export FDB_VER_FLAG=''
Expand Down
9 changes: 9 additions & 0 deletions ci/export-fdb-version-flag-stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,16 @@ then
elif [[ ${FDB_VER} = "6.3.12" ]]
then
export FDB_VER_FLAG='--flag foundationdb-haskell:fdb-version-630'
elif [[ ${FDB_VER} = "7.0.0" ]]
then
export FDB_VER_FLAG='--flag foundationdb-haskell:fdb-version-700'
elif [[ ${FDB_VER} = "7.1.15" ]]
then
export FDB_VER_FLAG='--flag foundationdb-haskell:fdb-version-710'
elif [[ ${FDB_VER} = "7.2.7" ]]
then
export FDB_VER_FLAG='--flag foundationdb-haskell:fdb-version-720'
elif [[ ${FDB_VER} = "7.3.15" ]]
then
# latest is the default, so no flag is specified
export FDB_VER_FLAG=''
Expand Down
8 changes: 5 additions & 3 deletions ci/install-deps.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/bin/bash

set -e

FDB_VER=${1}

sudo apt install python
sudo apt install python2 libc6 libc6-dev
wget https://github.com/apple/foundationdb/releases/download/${FDB_VER}/foundationdb-clients_${FDB_VER}-1_amd64.deb
wget https://github.com/apple/foundationdb/releases/download/${FDB_VER}/foundationdb-server_${FDB_VER}-1_amd64.deb
sudo dpkg -i foundationdb-clients_${FDB_VER}-1_amd64.deb
sudo apt install --fix-broken ./foundationdb-clients_${FDB_VER}-1_amd64.deb
# 6.3.x seems to require us to make this directory
sudo mkdir -p /var/lib/foundationdb/data
sudo dpkg -i foundationdb-server_${FDB_VER}-1_amd64.deb
sudo apt install --fix-broken ./foundationdb-server_${FDB_VER}-1_amd64.deb
sudo apt-get install c2hs
48 changes: 37 additions & 11 deletions foundationdb-haskell.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -75,42 +75,56 @@ flag with-generate-options
flag fdb-version-520
description: Indicates that we are building against version 5.2.x of fdb_c.h
Only one of these flags may be specified. If none are specified,
7.1.x is assumed.
7.3.x is assumed.
Manual: True
Default: False

flag fdb-version-600
description: Indicates that we are building against version 6.0.x of fdb_c.h
Only one of these flags may be specified. If none are specified,
7.1.x is assumed.
7.3.x is assumed.
Manual: True
Default: False

flag fdb-version-610
description: Indicates that we are building against version 6.1.x of fdb_c.h
Only one of these flags may be specified. If none are specified,
7.1.x is assumed.
7.3.x is assumed.
Manual: True
Default: False

flag fdb-version-620
description: Indicates that we are building against version 6.2.x of fdb_c.h
Only one of these flags may be specified. If none are specified,
7.1.x is assumed.
7.3.x is assumed.
Manual: True
Default: False

flag fdb-version-630
description: Indicates that we are building against version 6.3.x of fdb_c.h
Only one of these flags may be specified. If none are specified,
7.1.x is assumed.
7.3.x is assumed.
Manual: True
Default: False

flag fdb-version-700
description: Indicates that we are building against version 6.3.x of fdb_c.h
description: Indicates that we are building against version 7.0.x of fdb_c.h
Only one of these flags may be specified. If none are specified,
7.3.x is assumed.
Manual: True
Default: False

flag fdb-version-710
description: Indicates that we are building against version 7.1.x of fdb_c.h
Only one of these flags may be specified. If none are specified,
7.3.x is assumed.
Manual: True
Default: False

flag fdb-version-720
description: Indicates that we are building against version 7.2.x of fdb_c.h
Only one of these flags may be specified. If none are specified,
7.1.x is assumed.
7.3.x is assumed.
Manual: True
Default: False

Expand Down Expand Up @@ -156,7 +170,7 @@ library
, integer-gmp >= 0.5.1.0 && < 1.2
, mtl >= 2.2.0 && < 2.3
, random >= 1.1 && < 1.3
, text >= 1.2.3.0 && < 1.3
, text >= 1.2.3.0 && < 2.1
, deepseq >= 1.4.0.0 && < 1.5
, monad-control >= 1.0.0.0 && < 1.1
, transformers-base >= 0.4.0 && < 0.5
Expand Down Expand Up @@ -204,6 +218,12 @@ library
if flag(fdb-version-700)
CC-Options: -std=c99 -DFDB_API_VERSION=700
CPP-Options: -DFDB_API_VERSION=700
if flag(fdb-version-710)
CC-Options: -std=c99 -DFDB_API_VERSION=710
CPP-Options: -DFDB_API_VERSION=710
if flag(fdb-version-720)
CC-Options: -std=c99 -DFDB_API_VERSION=720
CPP-Options: -DFDB_API_VERSION=720

executable generate-options
if flag(with-generate-options)
Expand All @@ -224,10 +244,10 @@ test-suite tests
build-depends: base >=4.10 && <5
, foundationdb-haskell
, async >= 2.2.3 && < 2.3
, hspec >= 2.7.8 && < 2.8
, hspec >= 2.7.8 && < 2.12
, bytestring >= 0.10.8.2 && <0.12
, QuickCheck >= 2.14.2 && < 2.15
, text >= 1.2.3.0 && < 1.3
, text >= 1.2.3.0 && < 2.1
, mtl >= 2.2.0 && < 2.3
, deepseq >= 1.4.0.0 && < 1.5
, containers >= 0.5.8.0 && < 0.7
Expand Down Expand Up @@ -264,6 +284,12 @@ test-suite tests
if flag(fdb-version-700)
CC-Options: -std=c99 -DFDB_API_VERSION=700
CPP-Options: -DFDB_API_VERSION=700
if flag(fdb-version-710)
CC-Options: -std=c99 -DFDB_API_VERSION=710
CPP-Options: -DFDB_API_VERSION=710
if flag(fdb-version-720)
CC-Options: -std=c99 -DFDB_API_VERSION=720
CPP-Options: -DFDB_API_VERSION=720

benchmark tuple-bench
type: exitcode-stdio-1.0
Expand All @@ -273,5 +299,5 @@ benchmark tuple-bench
, foundationdb-haskell
, gauge >= 0.2.5 && < 0.3
, bytestring >= 0.10.8.2 && <0.12
, text >= 1.2.3.0 && < 1.3
, text >= 1.2.3.0 && < 2.1
default-language: Haskell2010
1 change: 1 addition & 0 deletions tests/Properties.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ main :: IO ()
main = do
mv <- lookupEnv "FDB_HASKELL_TEST_API_VERSION" :: IO (Maybe String)
let version = maybe currentAPIVersion read mv
putStrLn $ "Using API version " ++ show version
withFoundationDB defaultOptions {apiVersion = version} $ \db -> do
let cleanupAfter tests = hspec $ after_ (cleanup db testSS) tests
hspec encodeDecodeSpecs
Expand Down