Skip to content

Allow Win32-2.10 #11

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

Merged
merged 1 commit into from
Nov 1, 2020
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
20 changes: 18 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This Travis job script has been generated by a script via
#
# haskell-ci '--branches' 'master' 'postgresql-libpq.cabal'
# haskell-ci '--config=cabal.haskell-ci' 'postgresql-libpq.cabal'
#
# To regenerate the script (for example after adjusting tested-with) run
#
Expand All @@ -20,6 +20,10 @@ git:
branches:
only:
- master
services:
- postgresql
addons:
postgresql: "10"
cache:
directories:
- $HOME/.cabal/packages
Expand All @@ -38,39 +42,51 @@ jobs:
include:
- compiler: ghc-8.10.2
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.10.2","cabal-install-3.4"]}}
env: DATABASE_CONNSTRING=travis
os: linux
- compiler: ghc-8.8.4
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.8.4","cabal-install-3.4"]}}
env: DATABASE_CONNSTRING=travis
os: linux
- compiler: ghc-8.6.5
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.6.5","cabal-install-3.4"]}}
env: DATABASE_CONNSTRING=travis
os: linux
- compiler: ghc-8.4.4
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.4.4","cabal-install-3.4"]}}
env: DATABASE_CONNSTRING=travis
os: linux
- compiler: ghc-8.2.2
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.2.2","cabal-install-3.4"]}}
env: DATABASE_CONNSTRING=travis
os: linux
- compiler: ghc-8.0.2
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-8.0.2","cabal-install-3.4"]}}
env: DATABASE_CONNSTRING=travis
os: linux
- compiler: ghc-7.10.3
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.10.3","cabal-install-3.4"]}}
env: DATABASE_CONNSTRING=travis
os: linux
- compiler: ghc-7.8.4
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.8.4","cabal-install-3.4"]}}
env: DATABASE_CONNSTRING=travis
os: linux
- compiler: ghc-7.6.3
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.6.3","cabal-install-3.4"]}}
env: DATABASE_CONNSTRING=travis
os: linux
- compiler: ghc-7.4.2
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.4.2","cabal-install-3.4"]}}
env: DATABASE_CONNSTRING=travis
os: linux
- compiler: ghc-7.2.2
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.2.2","cabal-install-3.4"]}}
env: DATABASE_CONNSTRING=travis
os: linux
- compiler: ghc-7.0.4
addons: {"apt":{"sources":[{"sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main","key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286"}],"packages":["ghc-7.0.4","cabal-install-3.4"]}}
env: DATABASE_CONNSTRING=travis
os: linux
before_install:
- HC=$(echo "/opt/$CC/bin/ghc" | sed 's/-/\//')
Expand Down Expand Up @@ -169,5 +185,5 @@ script:
- rm -f cabal.project.local
- ${CABAL} v2-build $WITHCOMPILER --disable-tests --disable-benchmarks all

# REGENDATA ("0.11.20200918",["--branches","master","postgresql-libpq.cabal"])
# REGENDATA ("0.11.20200918",["--config=cabal.haskell-ci","postgresql-libpq.cabal"])
# EOF
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
-------

- Support `bytestring-0.11`
- Allow `Win32-2.10.0.0`
- Make `PQconsumeInput` FFI call `safe`

0.9.4.2
Expand Down
72 changes: 72 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
clone_folder: "c:\\WORK"

branches:
only:
- master

services:
- postgresql96

environment:
global:
CABOPTS: "--store-dir=C:\\SR --http-transport=plain-http"
PGUSER: postgres
PGPASSWORD: Password12!
PGPORT: "5432"
DATABASE_CONNSTRING: appveyor
matrix:
# 64 bit builds
- GHCVER: "8.8.1"
CHOCOPTS:
- GHCVER: "8.6.5"
CHOCOPTS:
- GHCVER: "8.4.4"
CHOCOPTS:
- GHCVER: "8.2.2"
CHOCOPTS:
- GHCVER: "8.0.2"
CHOCOPTS:
- GHCVER: "7.10.3.2"
CHOCOPTS:

# Fails to link
#
# - GHCVER: "7.8.4.1"
# CHOCOPTS:

# 32 bit builds

# Linker errors...

# - GHCVER: "8.6.5"
# CHOCOPTS: --forcex86
# - GHCVER: "8.4.4"
# CHOCOPTS: --forcex86
# - GHCVER: "8.2.2"
# CHOCOPTS: --forcex86

# older segfault?

cache:
- "C:\\SR"

install:
- "choco install -y ghc --version %GHCVER% %CHOCOPTS%"
- "choco install -y cabal %CHOCOPTS%"
- "refreshenv"
- "set PATH=C:\\ghc\\ghc-%GHCVER%:C:\\msys64\\mingw64\\bin;C:\\msys64\\usr\\bin;%PATH%"
- "cabal --version"
- "ghc --version"

- set PATH=C:\Progra~1\PostgreSQL\9.6\bin\;%PATH%

build: off

test_script:
- "cabal %CABOPTS% update -v"
- createdb TestDb
- IF EXIST configure.ac bash -c "autoreconf -i"
- "move cabal.project.local.win cabal.project.local"
- "cabal %CABOPTS% v2-build -j1 all"
# - "cabal %CABOPTS% v2-test -j1 all"
- "cabal %CABOPTS% v2-run smoke"
15 changes: 15 additions & 0 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
branches: master
postgresql: True

env: 7.0.4:DATABASE_CONNSTRING=travis
env: 7.2.2:DATABASE_CONNSTRING=travis
env: 7.4.2:DATABASE_CONNSTRING=travis
env: 7.6.3:DATABASE_CONNSTRING=travis
env: 7.8.4:DATABASE_CONNSTRING=travis
env: 7.10.3:DATABASE_CONNSTRING=travis
env: 8.0.2:DATABASE_CONNSTRING=travis
env: 8.2.2:DATABASE_CONNSTRING=travis
env: 8.4.4:DATABASE_CONNSTRING=travis
env: 8.6.5:DATABASE_CONNSTRING=travis
env: 8.8.4:DATABASE_CONNSTRING=travis
env: 8.10.2:DATABASE_CONNSTRING=travis
1 change: 1 addition & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
packages: .
2 changes: 2 additions & 0 deletions cabal.project.local.win
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package postgresql-libpq
flags: -use-pkg-config
12 changes: 4 additions & 8 deletions postgresql-libpq.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ description:
backend server and to receive the results of
these queries.

homepage: https://github.com/phadej/postgresql-libpq
homepage: https://github.com/haskellari/postgresql-libpq
bug-reports: https://github.com/haskellari/postgresql-libpq/issues
license: BSD3
license-file: LICENSE
author: Grant Monroe, Leon P Smith, Joey Adams
Expand Down Expand Up @@ -66,7 +67,7 @@ library
build-depends: unix >=2.4.2.0 && <2.8

if os(windows)
build-depends: Win32 >=2.2.0.2 && <2.7
build-depends: Win32 >=2.2.0.2 && <2.11

ghc-options: -Wall

Expand Down Expand Up @@ -104,9 +105,4 @@ test-suite smoke

source-repository head
type: git
location: https://github.com/phadej/postgresql-libpq

source-repository this
type: git
location: https://github.com/phadej/postgresql-libpq
tag: v0.9.4.0
location: https://github.com/haskellari/postgresql-libpq
7 changes: 6 additions & 1 deletion test/Smoke.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ main = do
env <- getEnvironment
case lookup "DATABASE_CONNSTRING" env of
Nothing -> putStrLn "Set DATABASE_CONNSTRING environment variable"
Just s -> smoke (BS8.pack s)
Just s -> smoke (BS8.pack (special s))
where
-- https://www.appveyor.com/docs/services-databases/
special "appveyor" = "dbname='TestDb' user='postgres' password='Password12!'"
special "travis" = ""
special s = s

smoke :: BS8.ByteString -> IO ()
smoke connstring = do
Expand Down