diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 493afc0..b4d3bc5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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" @@ -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 @@ -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 diff --git a/README.md b/README.md index dac976f..4a1f487 100644 --- a/README.md +++ b/README.md @@ -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` diff --git a/ci/export-fdb-version-flag-cabal.sh b/ci/export-fdb-version-flag-cabal.sh index 46839e0..261e4e6 100755 --- a/ci/export-fdb-version-flag-cabal.sh +++ b/ci/export-fdb-version-flag-cabal.sh @@ -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='' diff --git a/ci/export-fdb-version-flag-stack.sh b/ci/export-fdb-version-flag-stack.sh index efbcc56..5218de9 100755 --- a/ci/export-fdb-version-flag-stack.sh +++ b/ci/export-fdb-version-flag-stack.sh @@ -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='' diff --git a/ci/install-deps.sh b/ci/install-deps.sh index 3ba8f2d..8538652 100755 --- a/ci/install-deps.sh +++ b/ci/install-deps.sh @@ -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 diff --git a/foundationdb-haskell.cabal b/foundationdb-haskell.cabal index 3ed4ae7..bd8a435 100644 --- a/foundationdb-haskell.cabal +++ b/foundationdb-haskell.cabal @@ -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 @@ -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 @@ -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) @@ -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 @@ -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 @@ -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 diff --git a/tests/Properties.hs b/tests/Properties.hs index 71c01ca..3d5a46b 100644 --- a/tests/Properties.hs +++ b/tests/Properties.hs @@ -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