Code Monkey home page Code Monkey logo

resolv's People

Contributors

andreasabel avatar ckoparkar avatar dminuoso avatar hvr avatar jessicah avatar lyokha avatar phadej avatar yorickvp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

resolv's Issues

configure: WARNING: unrecognized options: --with-compiler

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>

Release 0.2.0.0 / new maintainer wanted

@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.

Why resolv-0.1.1.3 allows only base-4.13, and 0.1.1.2 the "rest"?

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?

Throwing a DnsException rather than calling fail

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.

Please support current versions of tasty

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)
   |                                                     ^^^

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.