Skip to content
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

Update bootstrap dependency versions. #6531

Closed
wants to merge 1 commit into from

Conversation

bryant
Copy link
Contributor

@bryant bryant commented Feb 8, 2020

These were needed to work with base-4.13.0.0 which comes with ghc-8.8.2.

Testing done: Successful invocation of ./bootstrap.sh.

Not sure if this should go into changelog.


Please include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog.
  • The documentation has been updated, if necessary.
  • If the change is docs-only, [ci skip] is used to avoid triggering the build bots.

Please also shortly describe how you tested your change. Bonus points for added tests!

These were needed to work with base-4.13.0.0 which comes with ghc-8.8.2.
@phadej
Copy link
Collaborator

phadej commented Feb 8, 2020

This breaks bootstrap with non-GHC-8.8.

Configuring resolv-0.1.1.3...
Setup: Encountered missing or private dependencies:
base ==4.13.*

The split of versions in resolv "make sense" if you look at the diff between 0.1.1.2 and 0.1.1.3:

--- 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"

but I'd advice to collaborate with resolv maintainer to rather use CPP then making per-version split. It does complicate cabal-install boostrapping, and therefore I cannot accept this patch yet.

@phadej
Copy link
Collaborator

phadej commented Feb 8, 2020

Note: the changelog actually says

0.1.1.3

  • GHC 8.8 / base-4.13 only compat hotfix release; the next release will support
    older GHC/base versions again

So I'd guess that the patch will be very welcome there.

@bryant
Copy link
Contributor Author

bryant commented Feb 11, 2020

I saw that you've asked a related question in haskell-hvr/resolv#7.

My understanding from some very brief research is that ghc-8.8.2 throws hard errors on non-MFP-conforming code, and the version of binary that resolv-0.1.1.3 depends on does not instance MonadFail PutM. It's unclear why the preprocessor is not used instead (as you pointed out), and it does not seem like an answer will be provided in reasonable time.

Would it be amenable to work around the resolv dependency? Something like setting RESOLV_VER conditionally on GHC_VER, for instance.

@phadej
Copy link
Collaborator

phadej commented Feb 12, 2020

and it does not seem like an answer will be provided in reasonable time.

This is disrespectful, until this issue haskell-hvr/resolv#7 weren't objectively important.

Rather then adding a hack to cabal, offer a patch to resolv. Based on changelog entry I think it will be welcomed.

(FYI, Herbert often misses GitHub notifications, it's relatively easy to read the issue and forget it completely).

@phadej
Copy link
Collaborator

phadej commented Apr 1, 2020

resolv was updated. Amended its version in #6636. CI is happy.

Thanks for writing this PR.

@phadej phadej closed this Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants