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

adblock2privoxy compilation fail with GHC 8.4.3 #25

Closed
wmyrda opened this issue Aug 20, 2018 · 12 comments
Closed

adblock2privoxy compilation fail with GHC 8.4.3 #25

wmyrda opened this issue Aug 20, 2018 · 12 comments

Comments

@wmyrda
Copy link

wmyrda commented Aug 20, 2018

Adblock2privoxy fails to compile with GHC 8.4.3. Please take a look would fixing it be possible.

>>> Configuring source in /tmp/portage/net-proxy/adblock2privoxy-9999-r2/work/adblock2privoxy-9999/adblock2privoxy ...
 * Using cabal-2.2.0.1.
 * Prepending /usr/lib64/ghc-8.4.3 to LD_LIBRARY_PATH
/usr/bin/ghc -package Cabal-2.2.0.1 --make /tmp/portage/net-proxy/adblock2privoxy-9999-r2/work/adblock2privoxy-9999/adblock2privoxy/Setup.hs -j5 +RTS -A256M -qb0 -RTS -threaded -dynamic -o setup
[1 of 1] Compiling Main             ( /tmp/portage/net-proxy/adblock2privoxy-9999-r2/work/adblock2privoxy-9999/adblock2privoxy/Setup.hs, /tmp/portage/net-proxy/adblock2privoxy-9999-r2/work/adblock2privoxy-9999/adblock2privoxy/Setup.o )
Linking setup ...
./setup configure --ghc --prefix=/usr --with-compiler=/usr/bin/ghc --with-hc-pkg=/usr/bin/ghc-pkg --prefix=/usr --libdir=/usr/lib64 --libsubdir=adblock2privoxy-9999/ghc-8.4.3 --datadir=/usr/share/ --datasubdir=adblock2privoxy-9999/ghc-8.4.3 --ghc-options=-j5 +RTS -A256M -qb0 -RTS --with-ar=x86_64-pc-linux-gnu-ar --ghc-option=-optc-march=native --ghc-option=-optc-O2 --ghc-option=-optc-pipe --ghc-option=-optc-fgcse-sm --ghc-option=-optc-fgcse-las --ghc-option=-optc-fgcse-after-reload --ghc-option=-optc-ftree-vectorize --ghc-option=-optl-Wl,-O1 --ghc-option=-optl-Wl,--hash-style=both --ghc-option=-optl-Wl,--as-needed --ghc-option=-optl-Wl,--relax --ghc-option=-optl-Wl,--sort-common --disable-executable-stripping --docdir=/usr/share/doc/adblock2privoxy-9999-r2 --verbose --enable-shared --enable-executable-dynamic --sysconfdir=/etc --disable-library-stripping
Using Parsec parser
Configuring adblock2privoxy-1.4.2...
Dependency MissingH -any: using MissingH-1.4.0.1
Dependency base ==4.*: using base-4.11.1.0
Dependency case-insensitive -any: using case-insensitive-1.2.0.11
Dependency containers -any: using containers-0.5.11.0
Dependency directory -any: using directory-1.3.1.5
Dependency filepath -any: using filepath-1.4.2
Dependency http-conduit -any: using http-conduit-2.3.1
Dependency mtl -any: using mtl-2.2.2
Dependency network >=2.4: using network-2.6.3.2
Dependency network-uri -any: using network-uri-2.6.1.0
Dependency old-locale >=1.0: using old-locale-1.0.0.7
Dependency parsec -any: using parsec-3.1.13.0
Dependency parsec-permutation >=0.1.2.0: using parsec-permutation-0.1.2.0
Dependency strict >=0.3: using strict-0.3.2
Dependency text >=0.11: using text-1.2.3.0
Dependency time >=1.4: using time-1.8.0.2
Source component graph: component exe:adblock2privoxy
Configured component graph:
    component adblock2privoxy-1.4.2-2X1oyazVohi4OGBtlFZzjK-adblock2privoxy
        include base-4.11.1.0
        include parsec-3.1.13.0
        include mtl-2.2.2
        include containers-0.5.11.0
        include filepath-1.4.2
        include directory-1.3.1.5
        include MissingH-1.4.0.1-GvxKFm8JIQLIx04ZzIEPgN
        include parsec-permutation-0.1.2.0-3zDFfngbNb4CTcNShrLuUV
        include time-1.8.0.2
        include old-locale-1.0.0.7-26K7wLFR2jK44UeOklvTCh
        include strict-0.3.2-FUXfVuv1I9pDkeq770AklR
        include network-2.6.3.2-6UULJJw3egYFPRHsaFrlj6
        include http-conduit-2.3.1-InHJXoxZeVnHqoo92GzyfZ
        include text-1.2.3.0
        include network-uri-2.6.1.0-AstEwZoXrlUJQq4VkxaVo9
        include case-insensitive-1.2.0.11-3kxnS3DflzuLJ3paEvK126
Linked component graph:
    unit adblock2privoxy-1.4.2-2X1oyazVohi4OGBtlFZzjK-adblock2privoxy
        include base-4.11.1.0
        include parsec-3.1.13.0
        include mtl-2.2.2
        include containers-0.5.11.0
        include filepath-1.4.2
        include directory-1.3.1.5
        include MissingH-1.4.0.1-GvxKFm8JIQLIx04ZzIEPgN
        include parsec-permutation-0.1.2.0-3zDFfngbNb4CTcNShrLuUV
        include time-1.8.0.2
        include old-locale-1.0.0.7-26K7wLFR2jK44UeOklvTCh
        include strict-0.3.2-FUXfVuv1I9pDkeq770AklR
        include network-2.6.3.2-6UULJJw3egYFPRHsaFrlj6
        include http-conduit-2.3.1-InHJXoxZeVnHqoo92GzyfZ
        include text-1.2.3.0
        include network-uri-2.6.1.0-AstEwZoXrlUJQq4VkxaVo9
        include case-insensitive-1.2.0.11-3kxnS3DflzuLJ3paEvK126
Ready component graph:
    definite adblock2privoxy-1.4.2-2X1oyazVohi4OGBtlFZzjK-adblock2privoxy
        depends base-4.11.1.0
        depends parsec-3.1.13.0
        depends mtl-2.2.2
        depends containers-0.5.11.0
        depends filepath-1.4.2
        depends directory-1.3.1.5
        depends MissingH-1.4.0.1-GvxKFm8JIQLIx04ZzIEPgN
        depends parsec-permutation-0.1.2.0-3zDFfngbNb4CTcNShrLuUV
        depends time-1.8.0.2
        depends old-locale-1.0.0.7-26K7wLFR2jK44UeOklvTCh
        depends strict-0.3.2-FUXfVuv1I9pDkeq770AklR
        depends network-2.6.3.2-6UULJJw3egYFPRHsaFrlj6
        depends http-conduit-2.3.1-InHJXoxZeVnHqoo92GzyfZ
        depends text-1.2.3.0
        depends network-uri-2.6.1.0-AstEwZoXrlUJQq4VkxaVo9
        depends case-insensitive-1.2.0.11-3kxnS3DflzuLJ3paEvK126
Using Cabal-2.2.0.1 compiled by ghc-8.4
Using compiler: ghc-8.4.3
Using install prefix: /usr
Executables installed in: /usr/bin
Libraries installed in: /usr/lib64/adblock2privoxy-9999/ghc-8.4.3
Dynamic Libraries installed in: /usr/lib64/x86_64-linux-ghc-8.4.3
Private executables installed in:
/usr/libexec/x86_64-linux-ghc-8.4.3/adblock2privoxy-1.4.2
Data files installed in: /usr/share/adblock2privoxy-9999/ghc-8.4.3
Documentation installed in: /usr/share/doc/adblock2privoxy-9999-r2
Configuration files installed in: /etc
Using alex version 3.2.4 found on system at: /usr/bin/alex
Using ar given by user at: /usr/bin/x86_64-pc-linux-gnu-ar
Using c2hs version 0.28.5 found on system at: /usr/bin/c2hs
Using cpphs version 1.20.8 found on system at: /usr/bin/cpphs
No doctest found
Using gcc version 8.2.0 found on system at: /usr/bin/x86_64-pc-linux-gnu-gcc
Using ghc version 8.4.3 given by user at: /usr/bin/ghc
Using ghc-pkg version 8.4.3 given by user at: /usr/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
No greencard found
Using haddock version 2.20.0 found on system at: /usr/bin/haddock-ghc-8.4.3
Using happy version 1.19.9 found on system at: /usr/bin/happy
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.67 found on system at: /usr/bin/hpc
Using hsc2hs version 0.68.3 found on system at: /usr/bin/hsc2hs
No hscolour found
No jhc found
Using ld found on system at: /usr/bin/x86_64-pc-linux-gnu-ld
No lhc found
No lhc-pkg found
Using pkg-config version 0.29.2 found on system at: /usr/bin/pkg-config
Using runghc version 8.4.3 found on system at: /usr/bin/runghc
Using strip version 2.30 found on system at: /usr/bin/strip
Using tar found on system at: /bin/tar
No uhc found
>>> Source configured.
>>> Compiling source in /tmp/portage/net-proxy/adblock2privoxy-9999-r2/work/adblock2privoxy-9999/adblock2privoxy ...
./setup build
Preprocessing executable 'adblock2privoxy' for adblock2privoxy-1.4.2..
Building executable 'adblock2privoxy' for adblock2privoxy-1.4.2..
[ 1 of 18] Compiling InputParser      ( src/InputParser.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/InputParser.dyn_o )
[ 2 of 18] Compiling Network          ( src/Network.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/Network.dyn_o )
[ 3 of 18] Compiling Paths_adblock2privoxy ( dist/build/adblock2privoxy/autogen/Paths_adblock2privoxy.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/Paths_adblock2privoxy.dyn_o )
[ 4 of 18] Compiling PopupBlocker     ( src/PopupBlocker.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/PopupBlocker.dyn_o )
[ 5 of 18] Compiling ProgramOptions   ( src/ProgramOptions.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/ProgramOptions.dyn_o )
[ 6 of 18] Compiling SourceInfo       ( src/SourceInfo.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/SourceInfo.dyn_o )
[ 7 of 18] Compiling Statistics       ( src/Statistics.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/Statistics.dyn_o )
[ 8 of 18] Compiling Task             ( src/Task.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/Task.dyn_o )
[ 9 of 18] Compiling UrlBlocker[boot] ( src/UrlBlocker.hs-boot, dist/build/adblock2privoxy/adblock2privoxy-tmp/UrlBlocker.dyn_o-boot )
[10 of 18] Compiling Templates        ( src/Templates.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/Templates.dyn_o )
[11 of 18] Compiling OptionsConverter ( src/OptionsConverter.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/OptionsConverter.dyn_o )
[12 of 18] Compiling Utils            ( src/Utils.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/Utils.dyn_o )

src/Utils.hs:60:10: error:
    • Could not deduce (Semigroup (ZipListM a))
        arising from the superclasses of an instance declaration
      from the context: Monoid a
        bound by the instance declaration at src/Utils.hs:60:10-40
    • In the instance declaration for ‘Monoid (ZipListM a)’
   |
60 | instance Monoid a => Monoid (ZipListM a) where
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 * ERROR: net-proxy/adblock2privoxy-9999-r2::bigvo failed (compile phase):
 *   setup build failed
 * 
 * Call stack:
 *     ebuild.sh, line  124:  Called src_compile
 *   environment, line 3350:  Called haskell-cabal_src_compile
 *   environment, line 2537:  Called cabal_src_compile
 *   environment, line  911:  Called cabal-build
 *   environment, line  675:  Called die
 * The specific snippet of code:
 *       ./setup "$@" || die "setup build failed"
 * 

>>> Failed to emerge net-proxy/adblock2privoxy-9999-r2, Log file:
@essandess
Copy link
Owner

After I cloned this repo, I upgraded it to compile with resolver lts-8.23. See adblock2privoxy/stack.yaml.

This was kind of a pain and required both some code refactoring and help from the Haskell community.

I never did get it to compile with one of the ghc resolvers. Is there a reason you wish to use a different resolver? I’d recommend a “if it’s not broken don’t fix it” approach, unless indeed something is broken.

@wmyrda
Copy link
Author

wmyrda commented Aug 26, 2018

Building the package Gentoo system I use has nice way of providing installation scripts (portage) which are called ebuilds. They inherit additional scripts to do the magic for given group of packages and in this case it is haskell-cabal. Hence it does its job right for 100s of packages I did not even look what exactly it did and what resolver it used to install package hence everything went smooth with installation script for adblock2privoxy I created.
Now in Gentoo GHC was updated from 8.0.2 to 8.4.3 and package compilation broke hence the report. Obviously one could stay at 8.0.2 and everything would work, but it does not seem as proper long term solution.

@wmyrda
Copy link
Author

wmyrda commented Sep 8, 2018

Patch for this issue is ready and tested. Fortunately only one instance of one file was affected.

diff -Naur adblock2privoxy-9999.old/adblock2privoxy/src/Utils.hs adblock2privoxy-9999/adblock2privoxy/src/Utils.hs
--- adblock2privoxy-9999.old/adblock2privoxy/src/Utils.hs       2018-09-08 21:15:22.343524300 +0200
+++ adblock2privoxy-9999/adblock2privoxy/src/Utils.hs   2018-09-08 21:16:50.847833262 +0200
@@ -25,6 +25,7 @@
 import Control.Applicative hiding (many)
 import Control.Monad.Writer
 import Control.Monad.State
+import qualified Data.Semigroup as S
 
 ------------------------------------------------------------------------------------------
 ----------------------------- export -----------------------------------------------------
@@ -61,6 +62,9 @@
   mempty = pure mempty
   mappend x y = mappend <$> x <*> y
 
+instance Monoid a => S.Semigroup (ZipListM a) where
+    (<>) x y = mappend <$> x <*> y
+
 class Struct2 f where
         struct2 :: a1 -> a2 -> f a1 a2
         square2 :: (Applicative g, Monoid a1, Monoid a2) => g a1 -> g a2 -> [g (f a1 a2)]

Source: gentoo-haskell/gentoo-haskell#701 (comment)

@essandess
Copy link
Owner

Per #26, I'm going to try to address this now. I'll need your help.

Rather than go to the trouble of creating a new branch, I'll use the existing one and show you the diffs, unless this becomes too burdensome.

Here's what I've done:

  1. Download and install latest ghc-8.4.3 from https://www.haskell.org/platform/
  2. rsync the latest branch to /tmp/adblock2privoxy
mkdir /tmp/adblock2privoxy
rsync essandess/adblock2privoxy/adblock2privoxy* /tmp/adblock2privoxy
cd /tmp/adblock2privoxy
vi stack.yaml
  1. Make these changes:
resolver: ghc-8.4.3
system-ghc: true
  1. Run the stack setup and install commands, making sure that it find the right binaries:
bash -c 'export PATH=/usr/bin:/usr/local/bin:$PATH ; export STACK_ROOT=/tmp/adblock2privoxy/.stack ; ( cd /tmp/adblock2privoxy/adblock2privoxy ; stack setup --allow-different-user ; stack install --local-bin-path /tmp/adblock2privoxy --allow-different-user )'

First error look like below. Keep adding stuff to extra-deps in stack.yaml as suggested, including allow-newer: true.

Error: While constructing the build plan, the following exceptions were
encountered:

In the dependencies for adblock2privoxy-1.4.2:
    MissingH needed, but the stack configuration has no specified version 
             (latest matching version is 1.4.0.1)
    http-conduit needed, but the stack configuration has no specified version 
                 (latest matching version is 2.3.2)
    old-locale must match >=1.0, but the stack configuration has no specified
               version  (latest matching version is 1.0.0.7)
    strict must match >=0.3, but the stack configuration has no specified
           version  (latest matching version is 0.3.2)
needed since adblock2privoxy is a build target.

Some different approaches to resolving this:

  * Consider trying 'stack solver', which uses the cabal-install solver to
    attempt to find some working build configuration. This can be convenient
    when dealing with many complicated constraint errors, but results may be
    unpredictable.

  * Recommended action: try adding the following to your extra-deps
    in /private/tmp/adblock2privoxy/adblock2privoxy/stack.yaml:

- MissingH-1.4.0.1
- http-conduit-2.3.2
- old-locale-1.0.0.7
- strict-0.3.2
  1. Try again with the following stack.yaml (diff). It starts to build.
4c4
< resolver: lts-8.23
---
> resolver: ghc-8.4.3
9a10,11
> allow-newer: true
> 
11c13,64
< extra-deps: [parsec-permutation-0.1.2.0]
---
> extra-deps:
> - parsec-permutation-0.1.2.0
> - MissingH-1.4.0.1
> - http-conduit-2.3.2
> - old-locale-1.0.0.7
> - strict-0.3.2
> - aeson-1.4.0.0
> - conduit-1.3.0.3
> - conduit-extra-1.3.0
> - hslogger-1.2.10
> - http-client-0.5.13.1
> - http-client-tls-0.3.5.3
> - http-types-0.12.1
> - old-time-1.1.0.3
> - resourcet-1.2.1
> - unliftio-core-0.1.2.0
> - base-compat-0.10.4
> - blaze-builder-0.4.1.0
> - connection-0.2.8
> - cookie-0.4.4
> - cryptonite-0.25
> - data-default-class-0.1.2.0
> - dlist-0.8.0.5
> - exceptions-0.10.0
> - memory-0.14.16
> - mime-types-0.1.0.8
> - mono-traversable-1.0.9.0
> - streaming-commons-0.2.1.0
> - tagged-0.8.6
> - th-abstraction-0.2.8.0
> - time-locale-compat-0.1.1.5
> - tls-1.4.1
> - typed-process-0.2.3.0
> - uuid-types-1.0.3
> - asn1-encoding-0.9.5
> - asn1-types-0.3.2
> - basement-0.0.8
> - byteable-0.1.1
> - cereal-0.5.7.0
> - foundation-0.0.21
> - socks-0.5.6
> - time-1.4.2
> - transformers-compat-0.6.2
> - vector-algorithms-0.7.0.4
> - x509-1.7.4
> - x509-store-1.6.6
> - x509-system-1.6.6
> - x509-validation-1.6.10
> - asn1-parse-0.9.4
> - deepseq-1.3.0.2
> - hourglass-0.2.12
> - pem-0.2.4
20c73
< # system-ghc: true
---
> system-ghc: true
  1. Finally, encounter this compile-time error:
stack will use the GHC on your PATH
For more information on paths, see 'stack path' and 'stack exec env'
To use this GHC and packages outside of a project, consider using:
stack ghc, stack ghci, stack runghc, or stack exec
jWARNING: Ignoring out of range dependency (allow-newer enabled): base-4.11.1.0. deepseq requires: >=4.3 && <4.8
WARNING: Ignoring out of range dependency (allow-newer enabled): transformers-0.5.5.0. transformers-compat requires: >=0.3 && ==0.2.*
WARNING: Ignoring out of range dependency (allow-newer enabled): time-1.4.2. cookie requires: >=1.5
jj[1 of 2] Compiling Main             ( /private/tmp/adblock2privoxy/.stack/setup-exe-src/setup-mPHDZzAJ.hs, /private/tmp/adblock2privoxy/.stack/setup-exe-src/setup-mPHDZzAJ.o )
…

parsec-3.1.13.0: copy/register                                         
cryptonite-0.25: copy/register                  
Progress 49/75                 

--  While building custom Setup.hs for package cookie-0.4.4 using:
      /private/tmp/adblock2privoxy/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.3 --builddir=.stack-work/dist/x86_64-osx/Cabal-2.2.0.1 build --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
    Logs have been written to: /private/tmp/adblock2privoxy/adblock2privoxy/.stack-work/logs/cookie-0.4.4.log

    Configuring cookie-0.4.4...
    clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
    Preprocessing library for cookie-0.4.4..
    Building library for cookie-0.4.4..
    [1 of 1] Compiling Web.Cookie       ( Web/Cookie.hs, .stack-work/dist/x86_64-osx/Cabal-2.2.0.1/build/Web/Cookie.o )
    
    /private/var/folders/w3/pqgw02vs1zjd_nd0gdc1ctf80000gp/T/stack1259/cookie-0.4.4/Web/Cookie.hs:45:78: error:
        Module ‘Data.Time’ does not export ‘parseTimeM’
       |
    45 | import Data.Time (UTCTime (UTCTime), toGregorian, fromGregorian, formatTime, parseTimeM, defaultTimeLocale)
       |                                                                              ^^^^^^^^^^
    
    /private/var/folders/w3/pqgw02vs1zjd_nd0gdc1ctf80000gp/T/stack1259/cookie-0.4.4/Web/Cookie.hs:45:90: error:
        Module ‘Data.Time’ does not export ‘defaultTimeLocale’
       |
    45 | import Data.Time (UTCTime (UTCTime), toGregorian, fromGregorian, formatTime, parseTimeM, defaultTimeLocale)
       |                                                                                          ^^^^^^^^^^^^^^^^^
    

A few things are clearly wrong here. Having to add all those extra-dep's and allow-newer: true looks wrong. The compile error at Module Data.Time is different from your compile error.

I'm not sure which issue to tackle. Any insight based on your experience?

@essandess
Copy link
Owner

Running stack solver yields these errors:

$ stack solver
Using configuration file: stack.yaml
Using cabal packages:
- ./


Warning: Installed version of cabal-install (2.2.0.0) is newer than stack has been tested with.  If you run into difficulties, consider downgrading.
         
Using compiler: ghc-8.4.3
Using resolver: ghc-8.4.3

Warning: Installed version of cabal-install (2.2.0.0) is newer than stack has been tested with.  If you run into difficulties, consider downgrading.
         
Using compiler: ghc-8.4.3
Asking cabal to calculate a build plan...
Trying with packages from ghc-8.4.3 and 51 external packages as hard constraints...
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
Warning: cannot determine version of /usr/bin/strip :
""
CallStack (from HasCallStack):
  die', called at ./Distribution/Client/Install.hs:238:21 in main:Distribution.Client.Install
cabal: Could not resolve dependencies:
[__0] trying: adblock2privoxy-1.4.2 (user goal)
[__1] next goal: time (dependency of adblock2privoxy)
[__1] rejecting: time-1.8.0.2/installed-1.8..., time-1.9.2, time-1.9.1,
time-1.9, time-1.8.0.4, time-1.8.0.3, time-1.8.0.2, time-1.8.0.1, time-1.8,
time-1.7.0.1, time-1.7, time-1.6.0.1, time-1.6, time-1.5.0.1, time-1.5
(constraint from main config
/private/var/folders/w3/pqgw02vs1zjd_nd0gdc1ctf80000gp/T/cabal-solver15541/cabal.config
requires ==1.4.2)
[__1] trying: time-1.4.2
[__2] next goal: deepseq (dependency of time)
[__2] rejecting: deepseq-1.4.3.0/installed-1.4..., deepseq-1.4.3.0,
deepseq-1.4.2.0, deepseq-1.4.1.2, deepseq-1.4.1.1, deepseq-1.4.1.0,
deepseq-1.4.0.0 (constraint from main config
/private/var/folders/w3/pqgw02vs1zjd_nd0gdc1ctf80000gp/T/cabal-solver15541/cabal.config
requires ==1.3.0.2)
[__2] trying: deepseq-1.3.0.2
[__3] next goal: base (dependency of adblock2privoxy)
[__3] rejecting: base-4.11.1.0/installed-4.1... (conflict: deepseq =>
base>=4.3 && <4.8)
[__3] rejecting: base-4.11.1.0 (constraint from non-upgradeable package
requires installed instance)
[__3] rejecting: base-4.11.0.0, base-4.10.1.0, base-4.10.0.0, base-4.9.1.0,
base-4.9.0.0, base-4.8.2.0, base-4.8.1.0, base-4.8.0.0, base-4.7.0.2,
base-4.7.0.1, base-4.7.0.0, base-4.6.0.1, base-4.6.0.0, base-4.5.1.0,
base-4.5.0.0, base-4.4.1.0, base-4.4.0.0, base-4.3.1.0, base-4.3.0.0,
base-4.2.0.2, base-4.2.0.1, base-4.2.0.0, base-4.1.0.0, base-4.0.0.0,
base-3.0.3.2, base-3.0.3.1 (constraint from main config
/private/var/folders/w3/pqgw02vs1zjd_nd0gdc1ctf80000gp/T/cabal-solver15541/cabal.config
requires ==4.11.1.0)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: time (36), base (29), adblock2privoxy
(17), deepseq (17)

Could not parse cabal-install errors:

>>>> Cabal errors begin
<<<< Cabal errors end

CallStack (from HasCallStack):
  error, called at src/Stack/Solver.hs:130:25 in stack-1.7.1-A62z9q64Mh5FcCcTUbfiGu:Stack.Solver

@wmyrda
Copy link
Author

wmyrda commented Sep 15, 2018

Using Gentoo overlay specified above which is work toward getting GHC 8.4.3 mainstreamed I did not need to update any libraries manually as during upgrade they all were rebuild by the updater. Some of them actually several times.
Other thing is that Gentoo uses cabal instead of stack to build Haskell related stuff so my build process looked somewhat different

>>> Configuring source in /tmp/portage/net-proxy/adblock2privoxy-9999-r2/work/adblock2privoxy-9999/adblock2privoxy ...
 * Using cabal-2.2.0.1.
 * Prepending /usr/lib64/ghc-8.4.3 to LD_LIBRARY_PATH
/usr/bin/ghc -package Cabal-2.2.0.1 --make /tmp/portage/net-proxy/adblock2privoxy-9999-r2/work/adblock2privoxy-9999/adblock2privoxy/Setup.hs -j5 +RTS -A256M -qb0 -RTS -threaded -dynamic -o setup
[1 of 1] Compiling Main             ( /tmp/portage/net-proxy/adblock2privoxy-9999-r2/work/adblock2privoxy-9999/adblock2privoxy/Setup.hs, /tmp/portage/net-proxy/adblock2privoxy-9999-r2/work/adblock2privoxy-9999/adblock2privoxy/Setup.o )
Linking setup ...
./setup configure --ghc --prefix=/usr --with-compiler=/usr/bin/ghc --with-hc-pkg=/usr/bin/ghc-pkg --prefix=/usr --libdir=/usr/lib64 --libsubdir=adblock2privoxy-9999/ghc-8.4.3 --datadir=/usr/share/ --datasubdir=adblock2privoxy-9999/ghc-8.4.3 --ghc-options=-j5 +RTS -A256M -qb0 -RTS --with-ar=x86_64-pc-linux-gnu-ar --ghc-option=-optc-march=native --ghc-option=-optc-O2 --ghc-option=-optc-pipe --ghc-option=-optc-fgcse-sm --ghc-option=-optc-fgcse-las --ghc-option=-optc-fgcse-after-reload --ghc-option=-optc-ftree-vectorize --ghc-option=-optl-Wl,-O1 --ghc-option=-optl-Wl,--hash-style=both --ghc-option=-optl-Wl,--as-needed --ghc-option=-optl-Wl,--relax --ghc-option=-optl-Wl,--sort-common --disable-executable-stripping --docdir=/usr/share/doc/adblock2privoxy-9999-r2 --verbose --enable-shared --enable-executable-dynamic --sysconfdir=/etc --disable-library-stripping
Using Parsec parser
Configuring adblock2privoxy-1.4.2...
Dependency MissingH -any: using MissingH-1.4.0.1
Dependency base ==4.*: using base-4.11.1.0
Dependency case-insensitive -any: using case-insensitive-1.2.0.11
Dependency containers -any: using containers-0.5.11.0
Dependency directory -any: using directory-1.3.1.5
Dependency filepath -any: using filepath-1.4.2
Dependency http-conduit -any: using http-conduit-2.3.1
Dependency mtl -any: using mtl-2.2.2
Dependency network >=2.4: using network-2.6.3.2
Dependency network-uri -any: using network-uri-2.6.1.0
Dependency old-locale >=1.0: using old-locale-1.0.0.7
Dependency parsec -any: using parsec-3.1.13.0
Dependency parsec-permutation >=0.1.2.0: using parsec-permutation-0.1.2.0
Dependency strict >=0.3: using strict-0.3.2
Dependency text >=0.11: using text-1.2.3.0
Dependency time >=1.4: using time-1.8.0.2
Source component graph: component exe:adblock2privoxy
Configured component graph:
    component adblock2privoxy-1.4.2-BoIDSq3xSo41L2jN7NgU2h-adblock2privoxy
        include base-4.11.1.0
        include parsec-3.1.13.0
        include mtl-2.2.2
        include containers-0.5.11.0
        include filepath-1.4.2
        include directory-1.3.1.5
        include MissingH-1.4.0.1-GvxKFm8JIQLIx04ZzIEPgN
        include parsec-permutation-0.1.2.0-3zDFfngbNb4CTcNShrLuUV
        include time-1.8.0.2
        include old-locale-1.0.0.7-26K7wLFR2jK44UeOklvTCh
        include strict-0.3.2-FUXfVuv1I9pDkeq770AklR
        include network-2.6.3.2-6UULJJw3egYFPRHsaFrlj6
        include http-conduit-2.3.1-9bkcXwjbXyG5M24jTz5Ktl
        include text-1.2.3.0
        include network-uri-2.6.1.0-AstEwZoXrlUJQq4VkxaVo9
        include case-insensitive-1.2.0.11-3kxnS3DflzuLJ3paEvK126
Linked component graph:
    unit adblock2privoxy-1.4.2-BoIDSq3xSo41L2jN7NgU2h-adblock2privoxy
        include base-4.11.1.0
        include parsec-3.1.13.0
        include mtl-2.2.2
        include containers-0.5.11.0
        include filepath-1.4.2
        include directory-1.3.1.5
        include MissingH-1.4.0.1-GvxKFm8JIQLIx04ZzIEPgN
        include parsec-permutation-0.1.2.0-3zDFfngbNb4CTcNShrLuUV
        include time-1.8.0.2
        include old-locale-1.0.0.7-26K7wLFR2jK44UeOklvTCh
        include strict-0.3.2-FUXfVuv1I9pDkeq770AklR
        include network-2.6.3.2-6UULJJw3egYFPRHsaFrlj6
        include http-conduit-2.3.1-9bkcXwjbXyG5M24jTz5Ktl
        include text-1.2.3.0
        include network-uri-2.6.1.0-AstEwZoXrlUJQq4VkxaVo9
        include case-insensitive-1.2.0.11-3kxnS3DflzuLJ3paEvK126
Ready component graph:
    definite adblock2privoxy-1.4.2-BoIDSq3xSo41L2jN7NgU2h-adblock2privoxy
        depends base-4.11.1.0
        depends parsec-3.1.13.0
        depends mtl-2.2.2
        depends containers-0.5.11.0
        depends filepath-1.4.2
        depends directory-1.3.1.5
        depends MissingH-1.4.0.1-GvxKFm8JIQLIx04ZzIEPgN
        depends parsec-permutation-0.1.2.0-3zDFfngbNb4CTcNShrLuUV
        depends time-1.8.0.2
        depends old-locale-1.0.0.7-26K7wLFR2jK44UeOklvTCh
        depends strict-0.3.2-FUXfVuv1I9pDkeq770AklR
        depends network-2.6.3.2-6UULJJw3egYFPRHsaFrlj6
        depends http-conduit-2.3.1-9bkcXwjbXyG5M24jTz5Ktl
        depends text-1.2.3.0
        depends network-uri-2.6.1.0-AstEwZoXrlUJQq4VkxaVo9
        depends case-insensitive-1.2.0.11-3kxnS3DflzuLJ3paEvK126
Using Cabal-2.2.0.1 compiled by ghc-8.4
Using compiler: ghc-8.4.3
Using install prefix: /usr
Executables installed in: /usr/bin
Libraries installed in: /usr/lib64/adblock2privoxy-9999/ghc-8.4.3
Dynamic Libraries installed in: /usr/lib64/x86_64-linux-ghc-8.4.3
Private executables installed in:
/usr/libexec/x86_64-linux-ghc-8.4.3/adblock2privoxy-1.4.2
Data files installed in: /usr/share/adblock2privoxy-9999/ghc-8.4.3
Documentation installed in: /usr/share/doc/adblock2privoxy-9999-r2
Configuration files installed in: /etc
Using alex version 3.2.4 found on system at: /usr/bin/alex
Using ar given by user at: /usr/bin/x86_64-pc-linux-gnu-ar
Using c2hs version 0.28.5 found on system at: /usr/bin/c2hs
Using cpphs version 1.20.8 found on system at: /usr/bin/cpphs
No doctest found
Using gcc version 8.2.0 found on system at: /usr/bin/x86_64-pc-linux-gnu-gcc
Using ghc version 8.4.3 given by user at: /usr/bin/ghc
Using ghc-pkg version 8.4.3 given by user at: /usr/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
No greencard found
Using haddock version 2.20.0 found on system at: /usr/bin/haddock-ghc-8.4.3
Using happy version 1.19.9 found on system at: /usr/bin/happy
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.67 found on system at: /usr/bin/hpc
Using hsc2hs version 0.68.3 found on system at: /usr/bin/hsc2hs
No hscolour found
No jhc found
Using ld found on system at: /usr/bin/x86_64-pc-linux-gnu-ld
No lhc found
No lhc-pkg found
Using pkg-config version 0.29.2 found on system at: /usr/bin/pkg-config
Using runghc version 8.4.3 found on system at: /usr/bin/runghc
Using strip version 2.30 found on system at: /usr/bin/strip
Using tar found on system at: /bin/tar
No uhc found
>>> Source configured.
>>> Compiling source in /tmp/portage/net-proxy/adblock2privoxy-9999-r2/work/adblock2privoxy-9999/adblock2privoxy ...
./setup build
Preprocessing executable 'adblock2privoxy' for adblock2privoxy-1.4.2..
Building executable 'adblock2privoxy' for adblock2privoxy-1.4.2..
[ 1 of 18] Compiling InputParser      ( src/InputParser.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/InputParser.dyn_o )
[ 2 of 18] Compiling Network          ( src/Network.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/Network.dyn_o )
[ 3 of 18] Compiling Paths_adblock2privoxy ( dist/build/adblock2privoxy/autogen/Paths_adblock2privoxy.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/Paths_adblock2privoxy.dyn_o )
[ 4 of 18] Compiling PopupBlocker     ( src/PopupBlocker.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/PopupBlocker.dyn_o )
[ 5 of 18] Compiling ProgramOptions   ( src/ProgramOptions.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/ProgramOptions.dyn_o )
[ 6 of 18] Compiling SourceInfo       ( src/SourceInfo.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/SourceInfo.dyn_o )
[ 7 of 18] Compiling Statistics       ( src/Statistics.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/Statistics.dyn_o )
[ 8 of 18] Compiling Task             ( src/Task.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/Task.dyn_o )
[ 9 of 18] Compiling UrlBlocker[boot] ( src/UrlBlocker.hs-boot, dist/build/adblock2privoxy/adblock2privoxy-tmp/UrlBlocker.dyn_o-boot )
[10 of 18] Compiling Templates        ( src/Templates.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/Templates.dyn_o )
[11 of 18] Compiling OptionsConverter ( src/OptionsConverter.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/OptionsConverter.dyn_o )
[12 of 18] Compiling Utils            ( src/Utils.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/Utils.dyn_o )
[13 of 18] Compiling PolicyTree       ( src/PolicyTree.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/PolicyTree.dyn_o )
[14 of 18] Compiling ParsecExt        ( src/ParsecExt.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/ParsecExt.dyn_o )
[15 of 18] Compiling PatternConverter ( src/PatternConverter.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/PatternConverter.dyn_o )
[16 of 18] Compiling UrlBlocker       ( src/UrlBlocker.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/UrlBlocker.dyn_o )
[17 of 18] Compiling ElementBlocker   ( src/ElementBlocker.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/ElementBlocker.dyn_o )
[18 of 18] Compiling Main             ( src/Main.hs, dist/build/adblock2privoxy/adblock2privoxy-tmp/Main.dyn_o )
Linking dist/build/adblock2privoxy/adblock2privoxy ...
>>> Source compiled.

Haskell libs I have now are in following versions

aeson-1.3.1.1
aeson-compat-0.3.8
alex-3.2.4
annotated-wl-pprint-0.7.0
ansi-terminal-0.8.0.4
ansi-wl-pprint-0.6.8.2
asn1-encoding-0.9.5
asn1-parse-0.9.4
asn1-types-0.3.2
async-2.2.1
attoparsec-0.13.2.2
attoparsec-iso8601-1.0.0.0-r1
auto-update-0.1.4
base16-bytestring-0.1.1.6
base64-bytestring-1.0.0.1
base-compat-0.10.4
basement-0.0.7
base-orphans-0.8
base-prelude-1.3
bifunctors-5.5.3
binary-0.8.5.1
binary-tagged-0.1.5
bindings-uname-0.1
bitarray-0.0.1.1
blaze-builder-0.4.1.0
blaze-html-0.9.1.1
blaze-markup-0.8.2.1
byteable-0.1.1
bytestring-builder-0.10.8.1.0
c2hs-0.28.5
cabal-2.2.0.1
cabal-doctest-1.0.6
call-stack-0.1.0
case-insensitive-1.2.0.11
cereal-0.5.5.0
clock-0.7.2
cmdargs-0.10.20
colour-2.3.4
comonad-5.0.4
conduit-1.3.0.3
conduit-extra-1.3.0
connection-0.2.8
constraints-0.10
contravariant-1.5
cookie-0.4.3
cpphs-1.20.8
cryptohash-0.11.9
cryptohash-conduit-0.1.1
cryptohash-sha256-0.11.101.0
cryptonite-0.25
cryptonite-conduit-0.2.2
data-default-class-0.1.2.0
digest-0.0.1.2
distributive-0.5.3
dlist-0.8.0.4
easy-file-0.2.2
echo-0.1.3
ed25519-0.0.5.0
either-5
enclosed-exceptions-1.0.3
errors-2.2.5
exceptions-0.10.0
extensible-exceptions-0.1.1.4
extra-1.6.6
fail-4.9.0.0
fast-logger-2.4.11
file-embed-0.0.10.1
filelock-0.1.1.2
foundation-0.0.20
free-5.0.2
fsnotify-0.2.1.2
generic-deriving-1.12.1
generics-sop-0.3.2.0-r1
gitrev-1.3.1
glob-0.9.2
hackage-security-0.5.3.0-r1
happy-1.19.9
hashable-1.2.7.0
haskell-src-exts-1.20.2
haskell-src-meta-0.8.0.2
hastache-0.6.1
hinotify-0.3.10
hit-0.6.3
hourglass-0.2.11
hpack-0.30.0
hslogger-1.2.10
hspec-2.5.0
hspec-core-2.5.0
hspec-discover-2.5.0
hspec-expectations-0.8.2
hspec-smallcheck-0.5.2
http-4000.3.12
http-api-data-0.3.8.1
http-client-0.5.13.1
http-client-tls-0.3.5.3
http-conduit-2.3.1
http-types-0.12.1
hunit-1.6.0.0
ieee754-0.7.9
infer-license-0.2.0
integer-logarithms-1.0.2.1
language-c-0.8.1
lifted-async-0.10.0.1
lifted-base-0.2.3.12
logict-0.6.0.2
math-functions-0.2.1.0
memory-0.14.16
microlens-0.4.9.1
microlens-mtl-0.1.11.1
microlens-th-0.4.2.1
mime-types-0.1.0.8
mintty-0.1.2
missingh-1.4.0.1
mmorph-1.1.2
monad-control-1.0.2.3
monad-logger-0.3.28.5
monad-loops-0.4.3
monadrandom-0.5.1.1
monad-unlift-0.2.0
mono-traversable-1.0.8.1
mtl-2.2.2
mustache-2.3.0
mwc-random-0.13.6.0
nats-1.1.2
neat-interpolation-0.3.2.1
network-2.6.3.2
network-uri-2.6.1.0
old-locale-1.0.0.7
old-time-1.1.0.3-r1
open-browser-0.2.1.0-r1
optparse-applicative-0.14.2.0
optparse-simple-0.1.0
parsec-3.1.13.0
parsec-permutation-0.1.2.0
path-0.6.1
path-io-1.3.3
path-pieces-0.2.1
patience-0.1.1
pem-0.2.2
persistent-2.8.2
persistent-sqlite-2.8.1
persistent-template-2.5.4
pid1-0.1.2.0
polyparse-1.12
prelude-extras-0.4.0.3
primitive-0.6.3.0
profunctors-5.2.2-r1
project-template-0.2.0.1
quickcheck-2.11.3
quickcheck-io-0.2.0
random-1.1
regex-applicative-0.3.3
regex-applicative-text-0.1.0.1
regex-base-0.93.2-r1
regex-compat-0.95.1-r1
regex-posix-0.95.2-r1
resource-pool-0.2.3.2
resourcet-1.2.1
retry-0.7.7.0
rio-0.1.2.0
safe-0.3.15
safe-exceptions-0.1.7.0
scientific-0.3.5.3
semigroupoids-5.2.2-r1
semigroups-0.18.4
setenv-0.1.1.3
sha-1.6.4.4
silently-1.2.5
smallcheck-1.1.5
socks-0.5.5
split-0.2.3.3
stack-1.7.1
statevar-1.1.1.0
stm-2.4.5.0
stm-chans-3.0.0.4
store-0.4.3.2
store-core-0.4.1
streaming-commons-0.2.1.0
strict-0.3.2
syb-0.7
system-fileio-0.3.16.3
system-filepath-0.4.14
tagged-0.8.5
tar-0.5.1.0
temporary-1.2.1.1
text-1.2.3.0
text-binary-0.2.1.1
text-metrics-0.3.0
tf-random-0.5
th-abstraction-0.2.8.0
th-expand-syns-0.4.4.0
th-lift-0.7.11
th-lift-instances-0.1.11
th-orphans-0.13.6
th-reify-many-0.1.8
th-utilities-0.2.0.1
time-locale-compat-0.1.1.4
tls-1.4.1
transformers-0.5.5.0
transformers-base-0.4.5.2
transformers-compat-0.6.2
typed-process-0.2.2.0
unexceptionalio-0.3.0
unicode-transforms-0.3.4
unix-compat-0.5.0.1-r1
unix-time-0.3.8
unliftio-0.2.8.0
unliftio-core-0.1.2.0
unordered-containers-0.2.9.0
uri-bytestring-0.3.2.0
utf8-string-1.0.1.1
uuid-types-1.0.3
vector-0.12.0.1
vector-algorithms-0.7.0.1-r1
vector-binary-instances-0.2.4
vector-th-unbox-0.2.1.6
void-0.7.2
x509-1.7.3
x509-store-1.6.6
x509-system-1.6.6
x509-validation-1.6.10
xml-1.3.14
yaml-0.10.1.1
zip-archive-0.3.3
zlib-0.6.2
zlib-bindings-0.1.1.5

@essandess
Copy link
Owner

Before I start mucking around with code or module versions, I’d like to understand why stack isn’t updating this stuff automatically. I suspect it’s some versioning spec deep in a .hs file somewhere, but am not really sure. I’ve asked for help at
commercialhaskell/stack#4309.

@qrilka
Copy link
Contributor

qrilka commented Sep 15, 2018

@essandess to use GHC 8.4.3 you need to switch to LTS-12, in qrilka@042ac83 I've fixed the code and adblock2privoxy builds fine with stack-1.7.1 do you want to have it as a PR?

@essandess
Copy link
Owner

essandess commented Sep 15, 2018

@qrilka Wow thank you for the prompt help! I can copy your diffs easily enough.

If you don't mind, I'd appreciate some insight into what we're changing, as @wmyrda is trying to create an ebuild with cabal as well.

The errors above occur when I set:

resolver: ghc-8.4.3
  • What's going with specifying ghc-8.4.3 versus lts-12.9?
  • How did you know do add the magic versioning conditional stuff for Utils.hs in qrilka@042ac83?
  • Should we update something to get rid of the outdated code blocks in Utils.hs?
  • @wmyrda, will @qrilka's fix work for your ebuild?

@wmyrda
Copy link
Author

wmyrda commented Sep 15, 2018

@essandess I might have not it clearly enough, but my ebuild for Gentoo works and builds just fine using cabal. As you see in the end it said >>> Source compiled so the patch I previously presented was enough for me.

Some guidelines are here . However I am not sure if this should be updated to say >lts-12 hence it should be fine to build adblok2privoxy with older stack as well as patch does not delete any older code just adds a bit for new version.

@qrilka
Copy link
Contributor

qrilka commented Sep 15, 2018

answering your questions @essandess

  1. See https://docs.haskellstack.org/en/stable/yaml_configuration/#resolver - ghc-8.4.3 specifies no Stackage snapshot just libraries which get shipped with GHC
  2. That one is a standard way to deal with API changes in Haskell about the change see http://hackage.haskell.org/package/base-4.11.1.0/docs/Data-Monoid.html (namely "NOTE: Semigroup is a superclass of Monoid since base-4.11.0.0.")
  3. Those are not outdated if previous versions of GHC are to be supported (and many devs use previous major versions of GHC, e.g. GHC 8.2.2)

@essandess
Copy link
Owner

@qrilka, @wmyrda Thank you very much for the fixes and insights.

@qrilka Would you please send a PR and I'll close this issue, then start nibbling on the other issues @wmyrda identified in #26.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants