-
Notifications
You must be signed in to change notification settings - Fork 37
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
Latest 9.10.1 docker images cabal that doesn't support ghc version #140
Comments
Can you please share more details about how you're encountering this error? |
I tried locally and I got the same warning as you. But it's just a warning. It shouldn't prevent cabal from building projects with more recent ghc version.
But I would agree that we should eventually update to more recent version of cabal. |
Hey @jhrcek, big thanks for the detailed & prompt reply, sorry for not giving a lot of information in my initial description. I've now created a barebones project using cabal-version: 3.4
name: hs-docker-image-example
version: 0.1.0.0
-- synopsis:
-- description:
license: BSD-3-Clause
license-file: LICENSE
-- copyright:
category: Web
build-type: Simple
extra-doc-files: CHANGELOG.md
-- extra-source-files:
common warnings
ghc-options: -Wall
executable hs-docker-image-example
import: warnings
main-is: Main.hs
-- other-modules:
-- other-extensions:
build-depends: base ^>=4.20.0.0
hs-source-dirs: app
default-language: GHC2024
# syntax=docker/dockerfile:1
FROM haskell:9.10.1-bullseye AS build-stage
WORKDIR /opt/hs-docker-image-example
COPY ./hs-docker-image-example.cabal /opt/hs-docker-image-example/hs-docker-image-example.cabal
RUN cabal update && cabal build --only-dependencies -j
# Now build the app
COPY . /opt/hs-docker-image-example
RUN cabal build && \
cp "$(cabal list-bin hs-docker-image-example)" .
CMD ["./hs-docker-image-example"] When I run [I] ~/p/h/hs-docker-image-example ❯❯❯ sudo docker buildx build --progress plain .
#0 building with "default" instance using docker driver
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 468B done
#1 DONE 0.0s
#2 resolve image config for docker-image://docker.io/docker/dockerfile:1
#2 DONE 0.8s
#3 docker-image://docker.io/docker/dockerfile:1@sha256:865e5dd094beca432e8c0a1d5e1c465db5f998dca4e439981029b3b81fb39ed5
#3 CACHED
#4 [internal] load metadata for docker.io/library/haskell:9.10.1-bullseye
#4 DONE 0.0s
#5 [ 1/14] FROM docker.io/library/haskell:9.10.1-bullseye
#5 CACHED
#6 [internal] load .dockerignore
#6 transferring context: 2B done
#6 DONE 0.0s
#7 [internal] load build context
#7 transferring context: 1.15kB done
#7 DONE 0.0s
#8 [2/6] WORKDIR /opt/hs-docker-image-example
#8 CACHED
#9 [3/6] COPY ./hs-docker-image-example.cabal /opt/hs-docker-image-example/hs-docker-image-example.cabal
#9 CACHED
#10 [4/6] RUN cabal update && cabal build --only-dependencies -j
#10 0.204 Config file path source is default config file.
#10 0.204 Config file not found: /root/.config/cabal/config
#10 0.205 Writing default configuration to /root/.config/cabal/config
#10 1.108 Downloading the latest package list from hackage.haskell.org
#10 39.69 Package list of hackage.haskell.org has been updated.
#10 39.69 The index-state is set to 2024-09-27T04:07:36Z.
#10 39.80 Warning: Unknown/unsupported 'ghc' version detected (Cabal 3.10.3.0 supports
#10 39.80 'ghc' version < 9.10): /opt/ghc/9.10.1/bin/ghc is version 9.10.1
#10 41.53 Resolving dependencies...
#10 41.97 Error: cabal: Could not resolve dependencies:
#10 41.97 [__0] next goal: hs-docker-image-example (user goal)
#10 41.97 [__0] rejecting: hs-docker-image-example-0.1.0.0 (conflict: requires unknown
#10 41.97 language GHC2024; did you mean GHC2021?)
#10 41.97 [__0] fail (backjumping, conflict set: hs-docker-image-example)
#10 41.97 After searching the rest of the dependency tree exhaustively, these were the
#10 41.97 goals I've had most trouble fulfilling: hs-docker-image-example
#10 41.97
#10 ERROR: process "/bin/sh -c cabal update && cabal build --only-dependencies -j" did not complete successfully: exit code: 1
------
> [4/6] RUN cabal update && cabal build --only-dependencies -j:
39.80 'ghc' version < 9.10): /opt/ghc/9.10.1/bin/ghc is version 9.10.1
41.53 Resolving dependencies...
41.97 Error: cabal: Could not resolve dependencies:
41.97 [__0] next goal: hs-docker-image-example (user goal)
41.97 [__0] rejecting: hs-docker-image-example-0.1.0.0 (conflict: requires unknown
41.97 language GHC2024; did you mean GHC2021?)
41.97 [__0] fail (backjumping, conflict set: hs-docker-image-example)
41.97 After searching the rest of the dependency tree exhaustively, these were the
41.97 goals I've had most trouble fulfilling: hs-docker-image-example
41.97
------
Dockerfile:6
--------------------
4 |
5 | COPY ./hs-docker-image-example.cabal /opt/hs-docker-image-example/hs-docker-image-example.cabal
6 | >>> RUN cabal update && cabal build --only-dependencies -j
7 |
8 | # Now build the app
--------------------
ERROR: failed to solve: process "/bin/sh -c cabal update && cabal build --only-dependencies -j" did not complete successfully: exit code: 1 The build seems to fail due to not recognising |
Of course, as you point out, I could just not use GHC2024. But I do like it :). And yes you were quite right, I was missing a cabal update. |
Let me try upgrading cabal there; 3.12 should be out for a while now |
As per title, the latest images install a version of cabal which doesn't support 9.10.1.
Cabal 3.10.3.0 does not support anything beyond 9.10:
The text was updated successfully, but these errors were encountered: