adblock2privoxy icon indicating copy to clipboard operation
adblock2privoxy copied to clipboard

*nix installation instructions not working as written

Open joshrmcdaniel opened this issue 1 year ago • 2 comments

The installation instructions for *nix (debian 12 specifically) did not work as written, constant issues with stack and dependency hell. I am also not familiar with Haskell; maybe a PEBKAC issue. I was able to finally compile from source and install it properly with ghcup though.

I ran the following (as root) to successfully compile and install.

curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 sh
mkdir -p /usr/local/etc/adblock2privoxy
rsync -a ./adblock2privoxy* /usr/local/etc/adblock2privoxy
export PATH="/usr/bin:$PATH:/root/.ghcup/bin"
cd /usr/local/etc/adblock2privoxy/adblock2privoxy
cabal update
cabal install . --installdir /usr/local/bin --global

Using ghcup to install haskell instead of stack solved my issues of installation.

joshrmcdaniel avatar Mar 31 '24 02:03 joshrmcdaniel

Same problem here, thanks for pointing out ghcup works.

Haven't tried stack with --snapshot option

Error: [S-4804] Stack failed to construct a build plan.

   While constructing the build plan, Stack encountered the following errors. The 'Stack configuration' refers to the set of package versions specified
   by the snapshot (after any dropped packages, or pruned GHC boot packages; if a boot package is replaced, Stack prunes all other such packages that
   depend on it) and any extra-deps:

   In the dependencies for adblock2privoxy-2.3.0:
     * MissingH must match >=1.6.0 && <1.7, but MissingH-1.4.3.0 is in the Stack configuration (latest matching version is 1.6.0.1).
     * containers must match >=0.6.7 && <0.7, but containers-0.6.5.1 is in the Stack configuration (latest matching version is 0.6.8).
     * directory must match >=1.3.8 && <1.4, but directory-1.3.6.0 is in the Stack configuration (latest matching version is 1.3.8.3).
     * filepath must match >=1.4.200 && <1.5, but filepath-1.4.2.1 is in the Stack configuration (latest matching version is 1.4.300.1).
     * mtl must match >=2.3.1 && <2.4, but mtl-2.2.2 is in the Stack configuration (latest matching version is 2.3.1).
     * network must match >=3.1.4 && <3.2, but network-3.1.1.1 is in the Stack configuration (latest matching version is 3.1.4.0).
     * parsec must match >=3.1.16 && <3.2, but parsec-3.1.14.0 is in the Stack configuration (latest matching version is 3.1.17.0).
     * strict must match >=0.5 && <0.6, but strict-0.4.0.1 is in the Stack configuration (latest matching version is 0.5).
     * text must match >=2.0.2 && <2.1, but text-1.2.4.1 is in the Stack configuration (latest matching version is 2.0.2).
     * time must match >=1.12.2 && <1.13, but time-1.9.3 is in the Stack configuration (latest matching version is 1.12.2).
   The above is/are needed since adblock2privoxy is a build target.

lhw365 avatar Apr 03 '24 03:04 lhw365

@lhw365 If you haven't done so already, the commands I provided resulted in a successful installation

The following dependencies are required prior to running (for debian 12): rsync, git, libffi8, libgmp-dev, libgmp10, libncurses-dev, libncurses5, libtinfo5, build-essential, libffi-dev, zlib1g-dev

joshrmcdaniel avatar Apr 06 '24 13:04 joshrmcdaniel

Same problem here, thanks for pointing out ghcup works.

Haven't tried stack with --snapshot option

Error: [S-4804] Stack failed to construct a build plan.

   While constructing the build plan, Stack encountered the following errors. The 'Stack configuration' refers to the set of package versions specified
   by the snapshot (after any dropped packages, or pruned GHC boot packages; if a boot package is replaced, Stack prunes all other such packages that
   depend on it) and any extra-deps:

   In the dependencies for adblock2privoxy-2.3.0:
     * MissingH must match >=1.6.0 && <1.7, but MissingH-1.4.3.0 is in the Stack configuration (latest matching version is 1.6.0.1).
     * containers must match >=0.6.7 && <0.7, but containers-0.6.5.1 is in the Stack configuration (latest matching version is 0.6.8).
     * directory must match >=1.3.8 && <1.4, but directory-1.3.6.0 is in the Stack configuration (latest matching version is 1.3.8.3).
     * filepath must match >=1.4.200 && <1.5, but filepath-1.4.2.1 is in the Stack configuration (latest matching version is 1.4.300.1).
     * mtl must match >=2.3.1 && <2.4, but mtl-2.2.2 is in the Stack configuration (latest matching version is 2.3.1).
     * network must match >=3.1.4 && <3.2, but network-3.1.1.1 is in the Stack configuration (latest matching version is 3.1.4.0).
     * parsec must match >=3.1.16 && <3.2, but parsec-3.1.14.0 is in the Stack configuration (latest matching version is 3.1.17.0).
     * strict must match >=0.5 && <0.6, but strict-0.4.0.1 is in the Stack configuration (latest matching version is 0.5).
     * text must match >=2.0.2 && <2.1, but text-1.2.4.1 is in the Stack configuration (latest matching version is 2.0.2).
     * time must match >=1.12.2 && <1.13, but time-1.9.3 is in the Stack configuration (latest matching version is 1.12.2).
   The above is/are needed since adblock2privoxy is a build target.

I have quite a similar issue with a docker-based build. 2.2.0 worked wonderfully using the following (gitlab) build recipe: ab2p-builder.yml

2.3.0 cannot be built using any of the haskell: docker images, resulting in the same build plan errors.

What does work is cabal v2-install adblock2privoxy but that's not the same.

nephros avatar Jan 23 '25 17:01 nephros

Thanks for posting these issues. There’s several meta-issues that are relevant:

  1. Indeed, the *nix instructions are years old and have not been updated, and neither has the Linux/rpm build pipeline. Updating all this would be worthwhile, but I think must roll in the considerations below.
  2. A straightforward cabal install adblock2privoxy using the latest cabal and ghc versions works, as does, afaik, a stack build.
  3. In the modern web with modern browsers, privoxy+adblock2privoxy isn’t going to do much without TLS inspection, a TLS-secured web server for adblock2privoxy’s CSS files, and more. All this requires an integrated secure setup with PKI management, a reverse proxy server, and possibly a PAC file served up on a LAN web server. Furthermore, privoxy’s http-inspection is hardcoded to use RSA2048 certificates, which really sloooooow things down. Fortunately, it’s trivial to patch the privoxy code to use ECC certificates that offer significant speedups.
  4. This modern privoxy+adblock2privoxy+PKI+TLS-inspection+reverse-proxy is all implemented for macOS/BSD over at MacPorts. It works great and is fast. Here are the build/install/configuration details:
  • https://github.com/macports/macports-ports/blob/master/www/privoxy/Portfile
  • https://github.com/macports/macports-ports/blob/master/www/adblock2privoxy/Portfile
  1. This modern infrastructure on macOS hasn’t been ported to *nix. Doing this should take precedence over updating the *nix build commands for a tool that needs a lot more infrastructure to really work.

essandess avatar Jan 24 '25 01:01 essandess

For anyone landing here. Just to mention that I have a Docker project that uses Privoxy + adblock2privoxy and works with HTTPS: https://github.com/Tardo/docker-privoxy-https

I don't know Haskell, but I've tried my best to compile this project in the best way possible: https://github.com/Tardo/docker-privoxy-https/blob/930c1a366dff0b4f087e922d08b327bbb5b01eee/Dockerfile#L40

Finally, thanks to those who maintain the adblock2privoxy project for their great work!

Tardo avatar Sep 30 '25 21:09 Tardo