essandess / adblock2privoxy

Convert adblock config files to privoxy format
https://hackage.haskell.org/package/adblock2privoxy
GNU General Public License v3.0
93 stars 16 forks source link

Stack TLS bug in resolver lts-5.2 prevents EasyList downloads #2

Closed essandess closed 7 years ago

essandess commented 7 years ago

See https://github.com/commercialhaskell/stack/issues/234, https://github.com/commercialhaskell/stack/issues/484.

In stack.yaml:

Default resolver: lts-5.2

stack exec adblock2privoxy -- -p ./privoxy -w ./css -d 10.0.1.3:8119 https://easylist.to/easylist/easyprivacy.txt
process https://easylist.to/easylist/easyprivacy.txt                                                                           
load https://easylist.to/easylist/easyprivacy.txt (5 more attempts)...                                                         
adblock2privoxy: TlsExceptionHostPort (HandshakeFailed Error_EOF) "easylist.to" 443                                            

Trying to fix with other resolvers fails to build:

resolver: ghc-7.10.2

Try

stack setup
stack solver --update-config
stack build
    [120 of 120] Compiling Crypto.Cipher.AES ( Crypto/Cipher/AES.hs, .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/Crypto/Cipher/AES.o )

    /private/var/folders/4m/5g_wk50n5w78jf8mwnkdgrtw0000gv/T/stack38406/cryptonite-0.24/cbits/cryptonite_rdrand.c:89:0: no such instruction: `rdrand %r8'

    /private/var/folders/4m/5g_wk50n5w78jf8mwnkdgrtw0000gv/T/stack38406/cryptonite-0.24/cbits/cryptonite_rdrand.c:89:0: no such instruction: `rdrand %r8'

    /private/var/folders/4m/5g_wk50n5w78jf8mwnkdgrtw0000gv/T/stack38406/cryptonite-0.24/cbits/cryptonite_rdrand.c:89:0: no such instruction: `rdrand %r8'

This also fails:

resolver: lts-8.22

    [111 of 111] Compiling Crypto.Cipher.AES ( Crypto/Cipher/AES.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0/build/Crypto/Cipher/AES.o )

    /private/var/folders/4m/5g_wk50n5w78jf8mwnkdgrtw0000gv/T/stack59812/cryptonite-0.21/cbits/cryptonite_rdrand.c:89:0: error: 
        no such instruction: `rdrand %r8'                                                                                      

    /private/var/folders/4m/5g_wk50n5w78jf8mwnkdgrtw0000gv/T/stack59812/cryptonite-0.21/cbits/cryptonite_rdrand.c:89:0: error: 
        no such instruction: `rdrand %r8'                                                                                      

    /private/var/folders/4m/5g_wk50n5w78jf8mwnkdgrtw0000gv/T/stack59812/cryptonite-0.21/cbits/cryptonite_rdrand.c:89:0: error: 
        no such instruction: `rdrand %r8'                                                                                      
    `gcc' failed in phase `Assembler'. (Exit code: 1)                                                                          

The workaround until this is resolved is to use python's urllib to download files.

essandess commented 7 years ago

This issue is fixed as described in https://github.com/haskell-crypto/cryptonite/issues/183.

tldr; configure ghc to use /usr/bin/gcc on macOS, not Macports gcc-6.