Skip to content
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
65 changes: 52 additions & 13 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.19.20250216
# version: 0.19.20250821
#
# REGENDATA ("0.19.20250216",["github","resolv.cabal"])
# REGENDATA ("0.19.20250821",["github","resolv.cabal"])
#
name: Haskell-CI
on:
Expand All @@ -32,24 +32,29 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.12.1
- compiler: ghc-9.14.0.20250819
compilerKind: ghc
compilerVersion: 9.12.1
compilerVersion: 9.14.0.20250819
setup-method: ghcup-prerelease
allow-failure: false
- compiler: ghc-9.12.2
compilerKind: ghc
compilerVersion: 9.12.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.10.1
- compiler: ghc-9.10.2
compilerKind: ghc
compilerVersion: 9.10.1
compilerVersion: 9.10.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.8.4
compilerKind: ghc
compilerVersion: 9.8.4
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.6.6
- compiler: ghc-9.6.7
compilerKind: ghc
compilerVersion: 9.6.6
compilerVersion: 9.6.7
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.8
Expand Down Expand Up @@ -106,12 +111,12 @@ jobs:
- name: Install GHCup
run: |
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
- name: Install cabal-install
run: |
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
"$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV"
- name: Install GHC (GHCup)
if: matrix.setup-method == 'ghcup'
run: |
Expand All @@ -126,6 +131,21 @@ jobs:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
HCVER: ${{ matrix.compilerVersion }}
- name: Install GHC (GHCup prerelease)
if: matrix.setup-method == 'ghcup-prerelease'
run: |
"$HOME/.ghcup/bin/ghcup" config add-release-channel prereleases
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
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"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
HCVER: ${{ matrix.compilerVersion }}
- name: Set PATH and environment variables
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
Expand All @@ -136,7 +156,7 @@ jobs:
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
if [ $((HCNUMVER >= 91400)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
Expand Down Expand Up @@ -164,6 +184,18 @@ jobs:
repository hackage.haskell.org
url: http://hackage.haskell.org/
EOF
if $HEADHACKAGE; then
cat >> $CABAL_CONFIG <<EOF
repository head.hackage.ghc.haskell.org
url: https://ghc.gitlab.haskell.org/head.hackage/
secure: True
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
key-threshold: 3
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
EOF
fi
cat >> $CABAL_CONFIG <<EOF
program-default-options
ghc-options: $GHCJOBS +RTS -M3G -RTS
Expand Down Expand Up @@ -215,9 +247,16 @@ jobs:
touch cabal.project.local
echo "packages: ${PKGDIR_resolv}" >> cabal.project
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package resolv" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package resolv" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package resolv" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
cat >> cabal.project <<EOF
EOF
if $HEADHACKAGE; then
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
fi
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(resolv)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
Expand Down
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ See also http://pvp.haskell.org/faq

# Revision history for `resolv`

## 0.2.0.3

_2025-08-31, Andreas Abel_

* Drop support for GHC 7
* Tested with GHC 8.0 - 9.14 alpha1

## 0.2.0.2

_2023-06-12, Alexey Radkov and Andreas Abel_
Expand Down
9 changes: 0 additions & 9 deletions haskell-ci.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
--- .github/workflows/haskell-ci.yml 2022-08-12 15:15:50.000000000 +0200
+++ .github/workflows/haskell-ci.yml-patched 2022-08-12 15:14:23.000000000 +0200
@@ -25,7 +25,7 @@
jobs:
linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }}
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
timeout-minutes:
60
container:
@@ -170,6 +170,9 @@
touch cabal.project
echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
Expand Down
44 changes: 23 additions & 21 deletions resolv.cabal
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
cabal-version: 2.2

name: resolv
version: 0.2.0.2
x-revision: 5
version: 0.2.0.3

synopsis: Domain Name Service (DNS) lookup via the libresolv standard library routines
description: {
Expand Down Expand Up @@ -36,7 +35,7 @@ provides a compatible subset of this package's API.
license: GPL-2.0-or-later
license-files: LICENSE LICENSE.GPLv2 LICENSE.GPLv3
author: Herbert Valerio Riedel
maintainer: Alexey Radkov
maintainer: Alexey Radkov, Andreas Abel
category: Network
build-type: Configure
bug-reports: https://github.com/haskell-hvr/resolv/issues
Expand All @@ -56,10 +55,11 @@ extra-tmp-files: autom4te.cache
cbits/hs_resolv_config.h

tested-with:
GHC == 9.12.1
GHC == 9.10.1
GHC == 9.14.1
GHC == 9.12.2
GHC == 9.10.2
GHC == 9.8.4
GHC == 9.6.6
GHC == 9.6.7
GHC == 9.4.8
GHC == 9.2.8
GHC == 9.0.2
Expand Down Expand Up @@ -89,23 +89,25 @@ library
Trustworthy

hs-source-dirs: src
include-dirs: cbits

exposed-modules: Network.DNS
other-modules: Network.DNS.Message
Network.DNS.FFI
Compat

build-depends: base >= 4.6 && < 5
-- bytestring-0.10.0.0 was shipped with GHC 7.6 (base-4.6)
, base16-bytestring >= 0.1 && < 1.1
, binary ^>= 0.7.3 || ^>= 0.8
-- we need binary-0.7.3 for isolate
, bytestring >= 0.10.0.0 && < 0.13
-- instance IsString ByteString exists in its form since bytestring-0.10.0.0
-- see https://github.com/haskell-hvr/resolv/pull/13#issuecomment-1213876161
, containers >= 0.4.2.1 && < 0.9

ghc-options: -Wall
include-dirs: cbits
-- Lower bounds take from GHC 8.0 shipped libraries and Stackage LTS 7.0
build-depends: base >= 4.9 && < 5
, base16-bytestring >= 0.1.1.6 && < 1.1
, binary >= 0.8.3 && < 0.9
, bytestring >= 0.10.8.0 && < 0.13
, containers >= 0.5.7.1 && < 0.9

ghc-options:
-Wall
-Wcompat
-Wunused-packages
-Wincomplete-patterns

test-suite resolv.
default-language: Haskell2010
Expand All @@ -119,7 +121,7 @@ test-suite resolv.
, bytestring

-- additional dependencies not inherited
build-depends: tasty >= 1.2.3 && < 1.6
build-depends: tasty >= 1.2.3 && < 1.6
, tasty-hunit ^>= 0.10.0
, directory ^>= 1.1.0 || ^>= 1.2.0 || ^>= 1.3.0
, filepath >= 1.3 && < 1.6
, directory >= 1.2.6.2 && < 1.4
, filepath >= 1.4.1.0 && < 1.6
7 changes: 5 additions & 2 deletions src-test/Tests1.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}

#if __GLASGOW_HASKELL__ >= 900
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
#endif

module Main where

import Control.Applicative as A
Expand Down Expand Up @@ -87,5 +92,3 @@ assertEqShow onFail ref cur
onFail
T.assertFailure ("expected: " ++ show ref ++ "\n but got: " ++ show cur)
| otherwise = A.pure ()


4 changes: 1 addition & 3 deletions src/Network/DNS.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{-# LANGUAGE CApiFFI #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE Trustworthy #-}
Expand Down Expand Up @@ -84,7 +83,6 @@ module Network.DNS

import Control.Exception
import Data.Bits (unsafeShiftR, (.&.))
import Data.Typeable (Typeable)
import Foreign.C
import Foreign.Marshal.Alloc
import Numeric (showInt)
Expand Down Expand Up @@ -120,7 +118,7 @@ data DnsException
-- ^ No such domain (non-authoritative) or SERVERFAIL
--
-- @since 0.2.0.0
deriving (Eq, Show, Typeable)
deriving (Eq, Show)

instance Exception DnsException

Expand Down