Your message dated Tue, 15 Oct 2013 15:34:11 +0000
with message-id <e1vw6dp-0005xg...@franck.debian.org>
and subject line Bug#726372: fixed in haskell-lens 3.9.0.2-4
has caused the Debian Bug report #726372,
regarding build on arches w/o TH
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
726372: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=726372
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: haskell-lens
Severity: normal
Version: 3.9.0.2
Tags: patch

Lens FTBFS on arches without TH, but the template haskell is only used
for deriving lenses for records (and some dependencies of error lenses).
Lens is otherwise useable on those arches. For example, code might only
want to use a lens into tuples, or maps, or any of the many other
provided lenses. Or a package that does need record lenses could be
fixed to build on all arches rather simply by pasting in the boilerplate
getters and setters, and could then use the rest of lens.

I have been avoiding using lens for some time because of this
portability problem. But it strikes me that the rest of the haskell
community is not likely to do that, and it seems to be getting more
widely used. So I think Debian should consider modifying lens to build
without TH on arches that lack it. 

The modifications turn out to be fairly reasonable. Patches attached.

There is a risk that some package that currently builds on arches
without TH currently tests that lens is not available, and avoids using
Control.Lens.TH. With this patch, such a test would be defeated, and the
package's build would be broken. I feel this is an fairly unlikely
scenario, and one that would be quickly caught in the regular haskell
package rebuild cycle, and would be easily fixed.

-- 
see shy jo
From 04510ab1a91ec7445b9575e9cb7fda3be94b2b2c Mon Sep 17 00:00:00 2001
From: Joey Hess <j...@kitenet.net>
Date: Sun, 13 Oct 2013 01:55:21 -0400
Subject: [PATCH 1/3] remove hlint ANNotations

These prevent building on systems without ghci.
---
 debian/control                      |    7 +++----
 src/Control/Exception/Lens.hs       |    2 --
 src/Control/Lens.hs                 |    1 -
 src/Control/Lens/Equality.hs        |    3 ---
 src/Control/Lens/Fold.hs            |    4 ----
 src/Control/Lens/Internal.hs        |    1 -
 src/Control/Lens/Internal/Zipper.hs |    1 -
 src/Control/Lens/Iso.hs             |    1 -
 src/Control/Lens/Lens.hs            |    2 --
 src/Control/Lens/Operators.hs       |    1 -
 src/Control/Lens/Plated.hs          |    1 -
 src/Control/Lens/Prism.hs           |    1 -
 src/Control/Lens/Setter.hs          |    1 -
 src/Data/Data/Lens.hs               |    3 ---
 14 files changed, 3 insertions(+), 26 deletions(-)

diff --git a/debian/control b/debian/control
index 83af3b0..364ee63 100644
--- a/debian/control
+++ b/debian/control
@@ -26,9 +26,9 @@ Build-Depends: debhelper (>= 9)
  , libghc-distributive-dev (>> 0.3)
  , libghc-distributive-dev (<< 1)
  , libghc-distributive-prof
- , libghc-generic-deriving-dev (>> 1.4)
- , libghc-generic-deriving-dev (<< 1.6)
- , libghc-generic-deriving-prof
+ , libghc-generic-deriving-dev (>> 1.4) [!armel]
+ , libghc-generic-deriving-dev (<< 1.6) [!armel]
+ , libghc-generic-deriving-prof [!armel]
  , libghc-hashable-dev (>> 1.1.2.3)
  , libghc-hashable-dev (<< 1.3)
  , libghc-hashable-prof
@@ -62,7 +62,6 @@ Build-Depends: debhelper (>= 9)
  , libghc-tagged-dev (>> 0.4.4)
  , libghc-tagged-dev (<< 1)
  , libghc-tagged-prof
- , ghc-ghci
  , libghc-text-dev (>> 0.11)
  , libghc-text-dev (<< 0.12)
  , libghc-text-prof
diff --git a/src/Control/Exception/Lens.hs b/src/Control/Exception/Lens.hs
index 4bc3926..34b46ff 100644
--- a/src/Control/Exception/Lens.hs
+++ b/src/Control/Exception/Lens.hs
@@ -112,8 +112,6 @@ import Prelude
   ,  Maybe(..), Either(..), Functor(..), String, IO
   )
 
-{-# ANN module "HLint: ignore Use Control.Exception.catch" #-}
-
 -- $setup
 -- >>> :set -XNoOverloadedStrings
 -- >>> :m + Control.Exception Control.Monad Data.List Prelude
diff --git a/src/Control/Lens.hs b/src/Control/Lens.hs
index 242c3c1..c60cf91 100644
--- a/src/Control/Lens.hs
+++ b/src/Control/Lens.hs
@@ -99,4 +99,3 @@ import Control.Lens.Wrapped
 import Control.Lens.Zipper
 import Control.Lens.Zoom
 
-{-# ANN module "HLint: ignore Use import/export shortcut" #-}
diff --git a/src/Control/Lens/Equality.hs b/src/Control/Lens/Equality.hs
index 982c2d7..32c25c3 100644
--- a/src/Control/Lens/Equality.hs
+++ b/src/Control/Lens/Equality.hs
@@ -28,9 +28,6 @@ module Control.Lens.Equality
 import Control.Lens.Internal.Setter
 import Control.Lens.Type
 
-{-# ANN module "HLint: ignore Use id" #-}
-{-# ANN module "HLint: ignore Eta reduce" #-}
-
 -- $setup
 -- >>> import Control.Lens
 
diff --git a/src/Control/Lens/Fold.hs b/src/Control/Lens/Fold.hs
index 32a4073..aec2d4d 100644
--- a/src/Control/Lens/Fold.hs
+++ b/src/Control/Lens/Fold.hs
@@ -163,10 +163,6 @@ import Data.Traversable
 -- >>> let g :: Expr -> Expr; g = Debug.SimpleReflect.Vars.g
 -- >>> let timingOut :: NFData a => a -> IO a; timingOut = fmap (fromMaybe (error "timeout")) . timeout (5*10^6) . evaluate . force
 
-{-# ANN module "HLint: ignore Eta reduce" #-}
-{-# ANN module "HLint: ignore Use camelCase" #-}
-{-# ANN module "HLint: ignore Use curry" #-}
-
 infixl 8 ^.., ^?, ^?!, ^@.., ^@?, ^@?!
 
 --------------------------
diff --git a/src/Control/Lens/Internal.hs b/src/Control/Lens/Internal.hs
index 295662e..7b30335 100644
--- a/src/Control/Lens/Internal.hs
+++ b/src/Control/Lens/Internal.hs
@@ -43,4 +43,3 @@ import Control.Lens.Internal.Review
 import Control.Lens.Internal.Setter
 import Control.Lens.Internal.Zoom
 
-{-# ANN module "HLint: ignore Use import/export shortcut" #-}
diff --git a/src/Control/Lens/Internal/Zipper.hs b/src/Control/Lens/Internal/Zipper.hs
index 95875b7..9139d18 100644
--- a/src/Control/Lens/Internal/Zipper.hs
+++ b/src/Control/Lens/Internal/Zipper.hs
@@ -53,7 +53,6 @@ import Data.Profunctor.Unsafe
 -- >>> import Control.Lens
 -- >>> import Data.Char
 
-{-# ANN module "HLint: ignore Use foldl" #-}
 
 ------------------------------------------------------------------------------
 -- * Jacket
diff --git a/src/Control/Lens/Iso.hs b/src/Control/Lens/Iso.hs
index 1152af4..5b680ec 100644
--- a/src/Control/Lens/Iso.hs
+++ b/src/Control/Lens/Iso.hs
@@ -82,7 +82,6 @@ import Data.Maybe
 import Data.Profunctor
 import Data.Profunctor.Unsafe
 
-{-# ANN module "HLint: ignore Use on" #-}
 
 -- $setup
 -- >>> :set -XNoOverloadedStrings
diff --git a/src/Control/Lens/Lens.hs b/src/Control/Lens/Lens.hs
index b26cc06..cf8d688 100644
--- a/src/Control/Lens/Lens.hs
+++ b/src/Control/Lens/Lens.hs
@@ -126,8 +126,6 @@ import Data.Profunctor.Rep
 import Data.Profunctor.Unsafe
 import Data.Void
 
-{-# ANN module "HLint: ignore Use ***" #-}
-
 -- $setup
 -- >>> :set -XNoOverloadedStrings
 -- >>> import Control.Lens
diff --git a/src/Control/Lens/Operators.hs b/src/Control/Lens/Operators.hs
index 11868e0..4e77cd0 100644
--- a/src/Control/Lens/Operators.hs
+++ b/src/Control/Lens/Operators.hs
@@ -108,4 +108,3 @@ import Control.Lens.Review
 import Control.Lens.Setter
 import Control.Lens.Zipper
 
-{-# ANN module "HLint: ignore Use import/export shortcut" #-}
diff --git a/src/Control/Lens/Plated.hs b/src/Control/Lens/Plated.hs
index a8c4d20..e6b8dea 100644
--- a/src/Control/Lens/Plated.hs
+++ b/src/Control/Lens/Plated.hs
@@ -95,7 +95,6 @@ import           Data.Data.Lens
 import           Data.Monoid
 import           Data.Tree
 
-{-# ANN module "HLint: ignore Reduce duplication" #-}
 
 -- | A 'Plated' type is one where we know how to extract its immediate self-similar children.
 --
diff --git a/src/Control/Lens/Prism.hs b/src/Control/Lens/Prism.hs
index 0f3253f..e60a884 100644
--- a/src/Control/Lens/Prism.hs
+++ b/src/Control/Lens/Prism.hs
@@ -51,7 +51,6 @@ import Data.Void
 import Unsafe.Coerce
 #endif
 
-{-# ANN module "HLint: ignore Use camelCase" #-}
 
 -- $setup
 -- >>> :set -XNoOverloadedStrings
diff --git a/src/Control/Lens/Setter.hs b/src/Control/Lens/Setter.hs
index a1e953f..d9f5b73 100644
--- a/src/Control/Lens/Setter.hs
+++ b/src/Control/Lens/Setter.hs
@@ -87,7 +87,6 @@ import Data.Profunctor
 import Data.Profunctor.Rep
 import Data.Profunctor.Unsafe
 
-{-# ANN module "HLint: ignore Avoid lambda" #-}
 
 -- $setup
 -- >>> import Control.Lens
diff --git a/src/Data/Data/Lens.hs b/src/Data/Data/Lens.hs
index cf1e7c9..fdb0e8f 100644
--- a/src/Data/Data/Lens.hs
+++ b/src/Data/Data/Lens.hs
@@ -65,9 +65,6 @@ import           Data.Monoid
 import           GHC.Exts (realWorld#)
 #endif
 
-{-# ANN module "HLint: ignore Eta reduce" #-}
-{-# ANN module "HLint: ignore Use foldl" #-}
-{-# ANN module "HLint: ignore Reduce duplication" #-}
 
 -- $setup
 -- >>> :set -XNoOverloadedStrings
-- 
1.7.10.4

From 88646e0992887d03b01407cf585818a35143558c Mon Sep 17 00:00:00 2001
From: Joey Hess <j...@kitenet.net>
Date: Mon, 14 Oct 2013 23:43:12 -0400
Subject: [PATCH 2/3] packaging changes

---
 debian/control |   14 +++++++-------
 debian/rules   |    5 +++++
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/debian/control b/debian/control
index 364ee63..fa467a6 100644
--- a/debian/control
+++ b/debian/control
@@ -26,9 +26,9 @@ Build-Depends: debhelper (>= 9)
  , libghc-distributive-dev (>> 0.3)
  , libghc-distributive-dev (<< 1)
  , libghc-distributive-prof
- , libghc-generic-deriving-dev (>> 1.4) [!armel]
- , libghc-generic-deriving-dev (<< 1.6) [!armel]
- , libghc-generic-deriving-prof [!armel]
+ , libghc-generic-deriving-dev (>> 1.4) [!armel !armhf !mips !mipsel !s390 !s390x]
+ , libghc-generic-deriving-dev (<< 1.6) [!armel !armhf !mips !mipsel !s390 !s390x]
+ , libghc-generic-deriving-prof [!armel !armhf !mips !mipsel !s390 !s390x]
  , libghc-hashable-dev (>> 1.1.2.3)
  , libghc-hashable-dev (<< 1.3)
  , libghc-hashable-prof
@@ -47,9 +47,9 @@ Build-Depends: debhelper (>= 9)
  , libghc-profunctors-dev (>> 3.2)
  , libghc-profunctors-dev (<< 4)
  , libghc-profunctors-prof
- , libghc-reflection-dev (>> 1.1.6)
- , libghc-reflection-dev (<< 2)
- , libghc-reflection-prof
+ , libghc-reflection-dev (>> 1.1.6) [!armel !armhf !mips !mipsel !s390 !s390x]
+ , libghc-reflection-dev (<< 2) [!armel !armhf !mips !mipsel !s390 !s390x]
+ , libghc-reflection-prof [!armel !armhf !mips !mipsel !s390 !s390x]
  , libghc-semigroupoids-dev (>> 3.0.2)
  , libghc-semigroupoids-dev (<< 4)
  , libghc-semigroupoids-prof
@@ -82,7 +82,7 @@ Build-Depends: debhelper (>= 9)
  , libghc-test-framework-dev (>> 0.6)
  , libghc-test-framework-quickcheck2-dev (>> 0.2)
  , libghc-test-framework-hunit-dev (>> 0.2)
- , libghc-test-framework-th-dev (>> 0.2)
+ , libghc-test-framework-th-dev (>> 0.2) [!armel !armhf !mips !mipsel !s390 !s390x]
  , libghc-doctest-dev (>> 0.9.1)
  , libghc-simple-reflect-dev (>> 0.3.1)
 Build-Depends-Indep: ghc-doc
diff --git a/debian/rules b/debian/rules
index 8ec1809..8ad7013 100755
--- a/debian/rules
+++ b/debian/rules
@@ -10,3 +10,8 @@ ifeq ($(DEB_HOST_ARCH),sparc)
 	# Disable tests that require SMP.
 	DEB_SETUP_GHC_CONFIGURE_ARGS := -f-test-hunit -f-test-properties
 endif
+
+ifeq ($(shell if [ ! -e /usr/bin/ghci ]; then echo 0; fi),0)
+	DEB_SETUP_GHC_CONFIGURE_ARGS := -fwithout-th -f-test-hunit -f-test-properties -f-test-doctests
+endif
+
-- 
1.7.10.4

From 6db5884760a02adc15e5777a675c32a7ab926b8b Mon Sep 17 00:00:00 2001
From: Joey Hess <j...@kitenet.net>
Date: Mon, 14 Oct 2013 23:43:57 -0400
Subject: [PATCH 3/3] add without-th flag

---
 lens.cabal                             |   28 +++++++++++++++++++++-------
 src/Control/Lens/Internal/Exception.hs |    6 ++++++
 2 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/lens.cabal b/lens.cabal
index 8714cdd..7c31cab 100644
--- a/lens.cabal
+++ b/lens.cabal
@@ -133,6 +133,11 @@ flag dump-splices
   default: False
   manual: True
 
+-- Avoid bulding modules that need TH
+flag without-th
+  default: False
+  manual: True
+
 -- You can disable the doctests test suite with -f-test-doctests
 flag test-doctests
   default: True
@@ -175,7 +180,6 @@ library
     containers                >= 0.4.0    && < 0.6,
     distributive              >= 0.3      && < 1,
     filepath                  >= 1.2.0.0  && < 1.4,
-    generic-deriving          >= 1.4      && < 1.6,
     ghc-prim,
     hashable                  >= 1.1.2.3  && < 1.3,
     MonadCatchIO-transformers >= 0.3      && < 0.4,
@@ -183,7 +187,6 @@ library
     parallel                  >= 3.1.0.1  && < 3.3,
     profunctors               >= 3.2      && < 4,
     profunctor-extras         >= 3.3      && < 4,
-    reflection                >= 1.1.6    && < 2,
     semigroupoids             >= 3.0.2    && < 4,
     semigroups                >= 0.8.4    && < 1,
     split                     == 0.2.*,
@@ -237,7 +240,6 @@ library
     Control.Lens.Review
     Control.Lens.Setter
     Control.Lens.Simple
-    Control.Lens.TH
     Control.Lens.Traversal
     Control.Lens.Tuple
     Control.Lens.Type
@@ -268,14 +270,23 @@ library
     Data.Typeable.Lens
     Data.Vector.Lens
     Data.Vector.Generic.Lens
-    Generics.Deriving.Lens
-    GHC.Generics.Lens
     System.Exit.Lens
     System.FilePath.Lens
-    System.IO.Error.Lens
-    Language.Haskell.TH.Lens
     Numeric.Lens
 
+  if flag(without-th)
+    cpp-options: -DDISABLE_TEMPLATE_HASKELL
+  else
+    build-depends:
+      generic-deriving          >= 1.4      && < 1.6,
+      reflection                >= 1.1.6    && < 2
+    exposed-modules:
+      Control.Lens.TH
+      Language.Haskell.TH.Lens
+      Generics.Deriving.Lens
+      GHC.Generics.Lens
+      System.IO.Error.Lens
+
   if flag(safe)
     cpp-options: -DSAFE=1
 
@@ -308,6 +319,9 @@ test-suite templates
   build-depends: base, lens
   ghc-options: -Wall -threaded
   hs-source-dirs: tests
+  
+  if flag(without-th)
+    buildable: False
 
   if flag(dump-splices)
     ghc-options: -ddump-splices
diff --git a/src/Control/Lens/Internal/Exception.hs b/src/Control/Lens/Internal/Exception.hs
index 387203e..43a59fa 100644
--- a/src/Control/Lens/Internal/Exception.hs
+++ b/src/Control/Lens/Internal/Exception.hs
@@ -34,7 +34,9 @@ import Control.Monad.CatchIO as CatchIO
 import Data.IORef
 import Data.Monoid
 import Data.Proxy
+#ifndef DISABLE_TEMPLATE_HASKELL
 import Data.Reflection
+#endif
 import Data.Typeable
 import System.IO.Unsafe
 
@@ -128,6 +130,7 @@ class Handleable e (m :: * -> *) (h :: * -> *) | h -> e m where
   handler_ l = handler l . const
   {-# INLINE handler_ #-}
 
+#ifndef DISABLE_TEMPLATE_HASKELL
 instance Handleable SomeException IO Exception.Handler where
   handler = handlerIO
 
@@ -139,6 +142,7 @@ handlerIO l f = reify (preview l) $ \ (_ :: Proxy s) -> Exception.Handler (\(Han
 
 handlerCatchIO :: forall m a r. Getting (First a) SomeException a -> (a -> m r) -> CatchIO.Handler m r
 handlerCatchIO l f = reify (preview l) $ \ (_ :: Proxy s) -> CatchIO.Handler (\(Handling a :: Handling a s m) -> f a)
+#endif
 
 ------------------------------------------------------------------------------
 -- Helpers
@@ -172,8 +176,10 @@ instance Show (Handling a s m) where
   showsPrec d _ = showParen (d > 10) $ showString "Handling ..."
   {-# INLINE showsPrec #-}
 
+#ifndef DISABLE_TEMPLATE_HASKELL
 instance Reifies s (SomeException -> Maybe a) => Exception (Handling a s m) where
   toException _ = SomeException HandlingException
   {-# INLINE toException #-}
   fromException = fmap Handling . reflect (Proxy :: Proxy s)
   {-# INLINE fromException #-}
+#endif
-- 
1.7.10.4

Attachment: signature.asc
Description: Digital signature


--- End Message ---
--- Begin Message ---
Source: haskell-lens
Source-Version: 3.9.0.2-4

We believe that the bug you reported is fixed in the latest version of
haskell-lens, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 726...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Joachim Breitner <nome...@debian.org> (supplier of updated haskell-lens package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Tue, 15 Oct 2013 17:01:52 +0200
Source: haskell-lens
Binary: libghc-lens-dev libghc-lens-prof libghc-lens-doc
Architecture: source all amd64
Version: 3.9.0.2-4
Distribution: unstable
Urgency: low
Maintainer: Debian Haskell Group 
<pkg-haskell-maintain...@lists.alioth.debian.org>
Changed-By: Joachim Breitner <nome...@debian.org>
Description: 
 libghc-lens-dev - Lenses, Folds and Traversals
 libghc-lens-doc - Lenses, Folds and Traversals; documentation
 libghc-lens-prof - Lenses, Folds and Traversals; profiling libraries
Closes: 726372
Changes: 
 haskell-lens (3.9.0.2-4) unstable; urgency=low
 .
   * Adjust watch file to new hackage layout
   * Disable TH on arches where it is not available, thanks to Joey Hess for
     the patches.  (Closes: #726372)
Checksums-Sha1: 
 b6253f1c8c9876d5f01e670a737ca2a235fc9f6d 4602 haskell-lens_3.9.0.2-4.dsc
 108e59f58fe44ef2d10e31b0de8ec3e3d7d8d1c8 8067 
haskell-lens_3.9.0.2-4.debian.tar.gz
 2d6e93e96ff6d198abb8b4c9300312144ee66fc9 815886 
libghc-lens-doc_3.9.0.2-4_all.deb
 22da0e18162d83de60ea2a1a4a6dcd3ec357dfda 1285214 
libghc-lens-dev_3.9.0.2-4_amd64.deb
 8012eb7eac8554594287cdf68e964bfff3328a39 1502672 
libghc-lens-prof_3.9.0.2-4_amd64.deb
Checksums-Sha256: 
 43212b8a1ad81304154cd52cd00a4564a1b40a8478e40a1e879201826d6ac68a 4602 
haskell-lens_3.9.0.2-4.dsc
 4705d0ed8a0dc98ea33588b391b2e17bbdedc260a8ac630cbcae53054f751b0d 8067 
haskell-lens_3.9.0.2-4.debian.tar.gz
 7dde2b84d64107690425714c57d657a9150363fa120f90e4af8d3d2674dd2250 815886 
libghc-lens-doc_3.9.0.2-4_all.deb
 5156b6e0f90ab09760afb0b1b33fcb4e1fa79fd430c97c0e653aafc6627752bd 1285214 
libghc-lens-dev_3.9.0.2-4_amd64.deb
 d8c7f0a1ea685839e2462800b665563e6aab5336356fd9e37afc6ab5cf0018da 1502672 
libghc-lens-prof_3.9.0.2-4_amd64.deb
Files: 
 9c81ece2aac198960c18b2e84ca3f91a 4602 haskell extra haskell-lens_3.9.0.2-4.dsc
 15e8fdcaabcffcd902923abc71db9d5c 8067 haskell extra 
haskell-lens_3.9.0.2-4.debian.tar.gz
 baa5f182fd2a0117c55b222231f7bbc6 815886 doc extra 
libghc-lens-doc_3.9.0.2-4_all.deb
 8f6f98d104eb012b5bbefa20b041b45a 1285214 haskell extra 
libghc-lens-dev_3.9.0.2-4_amd64.deb
 11bee6a0afdeadc81fe7390f2775a611 1502672 haskell extra 
libghc-lens-prof_3.9.0.2-4_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (GNU/Linux)

iEYEARECAAYFAlJdXIAACgkQ9ijrk0dDIGyLGACZAbOA74ZAIqOslN2SxFoLvbQR
GDMAmwYf8lBeb3BiKjfb1as8uEMpU0M1
=V7FU
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to