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

stack install hfmt fails on debian 12 #56

Open
jan-matejka opened this issue Sep 25, 2024 · 1 comment
Open

stack install hfmt fails on debian 12 #56

jan-matejka opened this issue Sep 25, 2024 · 1 comment

Comments

@jan-matejka
Copy link

Containerfile:

FROM ghcr.io/linuxcontainers/debian-slim:12
# Base image with haskell tooling

RUN printf "APT::Install-Recommends \"0\";" > /etc/apt/apt.conf.d/no-install-recommends
RUN apt-get update
RUN apt-get install -y vim procps iproute2 make ghc haskell-stack g++ libpq-dev
# https://docs.haskellstack.org/en/stable/install_and_upgrade/#__tabbed_8_2
RUN stack upgrade --binary-only

RUN useradd -m -s /bin/bash user
USER user
# Note: stack setup takes a while as it downloads and compiles ghc
RUN stack setup

WORKDIR /home/user/

# Update the package index.
# This takes a while so run it separately in case the next command fails.
RUN stack update

RUN stack new dummy
RUN cd dummy && stack install hfmt

$ podman build -f Containerfile:

STEP 12/12: RUN cd dummy && stack install hfmt

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 hfmt-0.3.0.0:
         * hindent must match >=5 && <6, but hindent-6.1.1 is in the Stack configuration (latest
           matching version is 5.3.4).
       The above is/are needed since hfmt is a build target.

       Some different approaches to resolving some or all of this:

         * To ignore all version constraints and build anyway, pass --allow-newer, or, in
           /home/user/.stack/config.yaml (global configuration) or /home/user/dummy/stack.yaml
           (project-level configuration), set allow-newer: true.

         * To ignore certain version constraints and build anyway, also add these package names
           under allow-newer-deps: hfmt.

         * Recommended action: try adding the following to your extra-deps in
           /home/user/dummy/stack.yaml (project-level configuration):

           - hindent-5.3.4@sha256:d758b78ce7173eff1266724456643a765049d2fc882718b844cc3654d0bc4567,3633
Error: building at STEP "RUN cd dummy && stack install hfmt": while running runtime: exit status 1
% podman run -it a8c6f494df9 bash -c 'cd dummy && stack runghc -- --version'
runghc 9.6.6
% podman run -it a8c6f494df9 bash -c "grep -v '^#' dummy/stack.yaml |cat -s"

snapshot:
  url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/35.yaml

packages:
- .
@jan-matejka
Copy link
Author

Possibly duplicate of #55 or #52. I'm not sure.

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

1 participant