haskell-hvr / resolv Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://hackage.haskell.org/package/resolv
License: Other
Home Page: https://hackage.haskell.org/package/resolv
License: Other
It'd be nice to checkout the precise commits of this repo that correspond to the uploaded hackage versions of the package.
One way to do this would be tag the commits that were released to hackage, and maybe even create GitHub releases for them.
Cabal unconditionally passes option --with-compiler
or --with-hc
in Distribution.Simple.Setup.configureArgs
. This makes configure
run from cabal v1-configure
or cabal v2-build
print the warning.
This can be fixed by declaring dummy with-options in configure.ac
diff --git a/configure.ac b/configure.ac
index 93942e2..1a1c036 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,6 +7,10 @@ AC_CONFIG_HEADERS([cbits/hs_resolv_config.h])
AC_PROG_CC
AC_C_CONST
+dnl ignore options --with-compiler and --with-hc passed by cabal configure
+AC_ARG_WITH([compiler], [], [], [])
+AC_ARG_WITH([hc], [], [], [])
+
AC_CHECK_HEADERS([netinet/in.h arpa/nameser.h])
AC_CHECK_HEADER([resolv.h],,AC_MSG_ERROR([required <resolv.h> header not found]),[[
#include <sys/types.h>
@phadej: I'd like to release 0.2.0.0 now containing:
Note that #16 shouldn't be a revision since it takes away building with GHC < 7.6.
For a couple of month now there is the question open whether you want to give me upload rights on Hackage or do the releases yourself. Please give an answer, so we can move on with this package.
AFAICS
--- resolv-0.1.1.2/src/Network/DNS/Message.hs 2018-10-28 01:43:14.000000000 +0300
+++ resolv-0.1.1.3/src/Network/DNS/Message.hs 2001-09-09 04:46:40.000000000 +0300
@@ -93,7 +93,7 @@
instance Binary CharStr where
put (CharStr bs)
- | BS.length bs > 0xff = fail "putString: string too long"
+ | BS.length bs > 0xff = error "putString: string too long"
| otherwise = do
putWord8 (fromIntegral $ BS.length bs)
putByteString bs
@@ -593,7 +593,7 @@
rdataLen = BSL.length rdata
unless (rdataLen < 0x10000) $
- fail "rdata too large"
+ error "rdata too large"
putWord16be (fromIntegral rdataLen)
putLazyByteString rdata
@@ -740,7 +740,7 @@
encodeNsecTypeMap :: Set Type -> Put
encodeNsecTypeMap bmap = do
- when (Set.null bmap) $ fail "invalid empty type-map"
+ when (Set.null bmap) $ error "invalid empty type-map"
-- when (Set.member 0 bmap) $ fail "invalid TYPE0 set in type-map"
-- TODO: verify that Meta-TYPES and QTYPEs aren't contained in bmap
would work with older base
as well?
Would you accept a PR that replaced the calls to fail
such as these with e.g. throwIO ResQueryFailed
?
I'd like to use this API for my SMTP server and I'd like to check SPF records (via TXT and SPF), it'd be nice to do a catch
of type DnsException
to handle all DNS-resolving issues.
Presently if I use a domain that doesn't have a TXT record, the failure isn't the best:
> queryTXT (Network.DNS.Name "chrisdone.com")
*** Exception: user error (res_query(3) failed)
In the case of a failed query, I'd mark incoming email as spam. So that's a fine case, other cases, I might want to log as an issue. At present I'd have to match on the strings.
Should be a quick update. And any existing code using this lib would (hopefully) get a non-exhaustive pattern match warning when upgrading. But it could also be a major version bump with a CHANGELOG warning.
We cannot build or run the test suite for resolv
in Nixpkgs any more because after updating our package set to LTS-11.x we no longer have pre 1.x versions of tasty
. If there's an opportunity to update this package to cope with the newer versions, that would be greatly appreciated. Unfortunately, simply relaxing the constraints does not suffice due to the following build error:
Building test suite 'resolv.' for resolv-0.1.1.1..
[1 of 1] Compiling Main ( src-test/Tests1.hs, dist/build/resolv./resolv.-tmp/Main.o )
src-test/Tests1.hs:81:53: error:
• Couldn't match type ‘[Char]’ with ‘Maybe GHC.Stack.Types.SrcLoc’
Expected type: Maybe GHC.Stack.Types.SrcLoc
Actual type: String
• In the first argument of ‘T.HUnitFailure’, namely ‘msg’
In the first argument of ‘E.throwIO’, namely ‘(T.HUnitFailure msg)’
In the expression: E.throwIO (T.HUnitFailure msg)
|
81 | assertJust msg Nothing = E.throwIO (T.HUnitFailure msg)
| ^^^
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.