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

*nix installation instructions not working as written #42

Open
joshrmcdaniel opened this issue Mar 31, 2024 · 4 comments
Open

*nix installation instructions not working as written #42

joshrmcdaniel opened this issue Mar 31, 2024 · 4 comments

Comments

@joshrmcdaniel
Copy link

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.

@lhw365
Copy link

lhw365 commented Apr 3, 2024

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.

@joshrmcdaniel
Copy link
Author

joshrmcdaniel commented Apr 6, 2024

@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

@nephros
Copy link

nephros commented Jan 23, 2025

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.

@essandess
Copy link
Owner

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:
  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.

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

4 participants