Code Monkey home page Code Monkey logo

language-docker's Issues

build errors with ghc-9.8.x

[   30s] src/Language/Docker.hs:26:5: error: [GHC-97219]
[   30s]     Duplicate record field ‘targetPath’ in export list:
[   30s]        ‘Language.Docker.Syntax.AddArgs(..)’ exports the field ‘Language.Docker.Syntax.targetPath’
[   30s]        belonging to the constructor ‘Language.Docker.Syntax.AddArgs’
[   30s]          imported qualified from ‘Language.Docker.Syntax’ at src/Language/Docker.hs:46:1-39
[   30s]          (and originally defined at src/Language/Docker/Syntax.hs:194:9-18)
[   30s]        ‘Language.Docker.Syntax.CopyArgs(..)’ exports the field ‘Language.Docker.Syntax.targetPath’
[   30s]        belonging to the constructor ‘Language.Docker.Syntax.CopyArgs’
[   30s]          imported qualified from ‘Language.Docker.Syntax’ at src/Language/Docker.hs:46:1-39
[   30s]          (and originally defined at src/Language/Docker/Syntax.hs:175:9-18)
[   30s]     Suggested fix: Perhaps you intended to use DuplicateRecordFields
[   30s]    |
[   30s] 26 |     Language.Docker.Syntax.AddArgs (..),
[   30s]    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[   30s] 
[   30s] src/Language/Docker.hs:26:5: error: [GHC-97219]
[   30s]     Duplicate record field ‘sourcePaths’ in export list:
[   30s]        ‘Language.Docker.Syntax.AddArgs(..)’ exports the field ‘Language.Docker.Syntax.sourcePaths’
[   30s]        belonging to the constructor ‘Language.Docker.Syntax.AddArgs’
[   30s]          imported qualified from ‘Language.Docker.Syntax’ at src/Language/Docker.hs:46:1-39
[   30s]          (and originally defined at src/Language/Docker/Syntax.hs:193:9-19)
[   30s]        ‘Language.Docker.Syntax.CopyArgs(..)’ exports the field ‘Language.Docker.Syntax.sourcePaths’
[   30s]        belonging to the constructor ‘Language.Docker.Syntax.CopyArgs’
[   30s]          imported qualified from ‘Language.Docker.Syntax’ at src/Language/Docker.hs:46:1-39
[   30s]          (and originally defined at src/Language/Docker/Syntax.hs:174:9-19)
[   30s]     Suggested fix: Perhaps you intended to use DuplicateRecordFields
[   30s]    |
[   30s] 26 |     Language.Docker.Syntax.AddArgs (..),
[   30s]    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[   30s] [18 of 18] Compiling Paths_language_docker
[   30s] error: Bad exit status from /var/tmp/rpm-tmp.Dg6asp (%build)

Cannot parse image name with "registry:port"

Raised in hadolint/hadolint#169

We cannot parse

FROM myregistry.com:5000/imagename:tag

because we expect only one colon :, but having a port number in registry name is usual for local/private registries.


Extended description

An image name is made up of slash-separated name components, optionally prefixed by a registry hostname. The hostname must comply with standard DNS rules, but may not contain underscores. If a hostname is present, it may optionally be followed by a port number in the format :8080. If not present, the command uses Docker’s public registry located at registry-1.docker.io by default. Name components may contain lowercase letters, digits and separators. A separator is defined as a period, one or two underscores, or one or more dashes. A name component may not start or end with a separator.

A tag name must be valid ASCII and may contain lowercase and uppercase letters, digits, underscores, periods and dashes. A tag name may not start with a period or a dash and may contain a maximum of 128 characters.

https://docs.docker.com/engine/reference/commandline/tag/#extended-description

Cannot parse if line ends with linebreak and space

FROM centos:centos7

RUN yum -y install --setopt=tsflags=nodocs epel-release && \ 
    yum -y update && yum clean all

There is a space after \

$ integration-tests/parseFile Dockerfile.break
Left (TrivialError (SourcePos {sourceName = "Dockerfile.break", sourceLine = Pos 4, sourceColumn = Pos 5} :| []) (Just (Tokens ('y' :| ""))) (fromList [Tokens ('#' :| ""),Label ('A' :| "DD"),Label ('A' :| "RG"),Label ('C' :| "MD"),Label ('C' :| "OPY"),Label ('E' :| "NTRYPOINT"),Label ('E' :| "NV"),Label ('E' :| "XPOSE"),Label ('F' :| "ROM"),Label ('H' :| "EALTHCHECK"),Label ('L' :| "ABEL"),Label ('M' :| "AINTAINER"),Label ('O' :| "NBUILD"),Label ('R' :| "UN"),Label ('S' :| "HELL"),Label ('S' :| "TOPSIGNAL"),Label ('U' :| "SER"),Label ('V' :| "OLUME"),Label ('W' :| "ORKDIR"),Label ('t' :| "he rest of a new line followed by the next instruction"),EndOfInput]))

It wasn't catched in integration tests because error message has changed

if ./parseFile "$dockerfile" | grep -a1 unexpected; then

Build failure with ghc 8.4

[ 5 of 13] Compiling Language.Docker.PrettyPrint ( src/Language/Docker/PrettyPrint.hs, dist/build/Language/Docker/PrettyPrint.o )

src/Language/Docker/PrettyPrint.hs:34:64: error:
    Ambiguous occurrence ‘<>’
    It could refer to either ‘Prelude.<>’,
                             imported from ‘Prelude’ at src/Language/Docker/PrettyPrint.hs:14:1-43
                             (and originally defined in ‘GHC.Base’)
                          or ‘Text.PrettyPrint.<>’,
                             imported from ‘Text.PrettyPrint’ at src/Language/Docker/PrettyPrint.hs:15:1-23
                             (and originally defined in ‘Text.PrettyPrint.HughesPJ’)
   |
34 | prettyPrintImage (Image (Just (Registry reg)) name) = text reg <> char '/' <> text name
   |                                                                ^^

The same failure repeats many, many times, every time <> is used.

Add --link flag to COPY/ADD instrructions

Hello,

On 9 March, a new version of dockerfile frontend has been released. This introduced one change to the syntax.

COPY --link and ADD --link allow copying files with increased cache efficiency and rebase images without requiring them to be rebuilt. --link copies files to a separate layer and then uses new LLB MergeOp implementation to chain independent layers together.

Documentation: https://github.com/moby/buildkit/blob/dockerfile/1.4.0/frontend/dockerfile/docs/syntax.md#linked-copies-copy---link-add---link

We need to add support for the following new syntaxes:

COPY --link /source /target
ADD --link /source /target
COPY --link=true /source /target
COPY --link=false /source /target

Best regards,

Parse RUN agruments do not respect control operators

Intro

bash manpage:

       control operator
              A token that performs a control function.  It is one of the following symbols:
              || & && ; ;; ( ) | |& <newline>

Control operators are important for decisions which are happening later in hadolint https://github.com/hadolint/hadolint/blob/master/src/Hadolint/Rules.hs#L173

This issue has been found through hadolint/hadolint#196

Current state

RUN set -ex; apk add --no-cache curl=7.59.0-r0

is parsed

$ stack repl
> parseString "RUN set -ex; apk add --no-cache ca-certificates=20171114-r0"
Right [InstructionPos {instruction = Run (Arguments ["set","-ex;","apk","add","--no-cache","ca-certificates=20171114-r0"]), sourcename = "<string>", lineNumber = 1}]

where ; is parsed as part of -ex.

I believe it is done here

return $ Arguments (words args)

Desired state

Split RUN arguments using white space and selected control operators.

$ stack repl
> parseString "RUN set -ex; apk add --no-cache ca-certificates=20171114-r0"
Right [InstructionPos {instruction = Run (Arguments ["set","-ex",";","apk","add","--no-cache","ca-certificates=20171114-r0"]), sourcename = "<string>", lineNumber = 1}]

'label' has to quote arguments

λ> putDockerfileStr $ label [("maintainer","Peter Simons <[email protected]>")]
LABEL maintainer=Peter Simons <[email protected]>

gives a Dockerfile that's syntactically incorrect. I would expect label to quote that value as needed. Is that not how it's supposed to be used? Do I need to quote these values myself?

prettyPrint does not preseve the content of quoted string

Hi there,

I have a similar problem to #57 with the prettyPrint for the quoted string.
It is about prettyPrint automatically move the parts after token && to a new line even in a quoted string.
The example code is described as below.

Is there any quick workarounds for this issue? I'm really looking forward to it.
Thank you very much!

I am using language-docker-10.4.2.

module Main
  ( main
  ) where

import qualified Data.Either as Either
import qualified Data.Text as T
import qualified Data.Text.IO as T.IO
import qualified Data.Text.Lazy as Lazy
import qualified Language.Docker as Docker
import Prelude (IO, ($))

main :: IO ()
main = T.IO.putStr prettyPrinted
  where
    prettyPrinted = Lazy.toStrict $ Docker.prettyPrint parsed
    parsed = Either.fromRight [] $ Docker.parseText source
    source = T.pack "FROM alpine\nRUN grep -F 'cd dir && ./run.sh ' /opt/Makefile"

It should return

FROM alpine
RUN grep -F 'cd dir && ./run.sh ' /opt/Makefile

However, the actual return is as below, which creates different shell execution result.

FROM alpine
RUN grep -F 'cd dir \
 && ./run.sh ' /opt/Makefile

Stage name of image is part of name/tag/sha

In a Dockerfile used for multistage build, a stage of image is part of name/tag/sha

> parseString "FROM ubuntu AS ubuntu-build"
Right [InstructionPos (From (UntaggedImage "ubuntu AS ubuntu-build")) "<string>" 1]

> parseString "FROM ubuntu:16.04 as ubuntu-build"
Right [InstructionPos (From (TaggedImage "ubuntu" "16.04 as ubuntu-build")) "<string>" 1]

> parseString "FROM ubuntu@sha256:0ef2e08ed3fabfc44002ccb846c4f2416a2135affc3ce39538834059606f32dd as ubuntu-build"
Right [InstructionPos (From (TaggedImage "ubuntu@sha256" "0ef2e08ed3fabfc44002ccb846c4f2416a2135affc3ce39538834059606f32dd as ubuntu-build")) "<string>" 1]

It would be nice to get a stage name also from parser.

https://docs.docker.com/engine/userguide/eng-image/multistage-build/#name-your-build-stages

Add full support for RUN --mount=type=cache flags

RUN --mount=type=cache understands some flags the parser doesn't recognize yet:

ARG debian_version=12
FROM debian:bookworm-slim
RUN --mount=id=debian:${debian_version}-/var/cache/apt,sharing=locked,target=/var/cache/apt,type=cache \

Errors with:
Dockerfile:3:13 unexpected "id=debian:${" expecting "from=", "readonly", "readonly=", "readwrite", "readwrite=", "ro", "ro=", "rw", "rw=", "type=", source=, or target=

Fail to compile language-docker-5.0.1

Hey,
I am trying to build hadolint on my gentoo system, but I can not manage to build,
language-docker-5.0.1, here the error I get

[ 1 of 11] Compiling Paths_language_docker ( dist/build/autogen/Paths_language_docker.hs, dist/build/Paths_language_docker.o )
[ 2 of 11] Compiling Language.Docker.Syntax ( src/Language/Docker/Syntax.hs, dist/build/Language/Docker/Syntax.o )
[ 3 of 11] Compiling Language.Docker.Syntax.Lift ( src/Language/Docker/Syntax/Lift.hs, dist/build/Language/Docker/Syntax/Lift.o )
[ 4 of 11] Compiling Language.Docker.PrettyPrint ( src/Language/Docker/PrettyPrint.hs, dist/build/Language/Docker/PrettyPrint.o )

src/Language/Docker/PrettyPrint.hs:93:25: error:
    Not in scope: ‘fail’
    Perhaps you want to add ‘fail’ to the import list in the import of
    ‘Prelude’ (src/Language/Docker/PrettyPrint.hs:(15,1)-(17,18)).
[ 5 of 11] Compiling Language.Docker.Normalize ( src/Language/Docker/Normalize.hs, dist/build/Language/Docker/Normalize.o )
[ 6 of 11] Compiling Language.Docker.Lexer ( src/Language/Docker/Lexer.hs, dist/build/Language/Docker/Lexer.o )
[ 7 of 11] Compiling Language.Docker.Parser ( src/Language/Docker/Parser.hs, dist/build/Language/Docker/Parser.o )

src/Language/Docker/Parser.hs:402:17: warning: [-Wmissing-monadfail-instances]
    • No instance for (Control.Monad.Fail.MonadFail
                         (ParsecT String () Data.Functor.Identity.Identity))
        arising from the failable pattern ‘Cmd checkCommand’
        (this will become an error in a future GHC release)
    • In a stmt of a 'do' block: Cmd checkCommand <- cmd
      In the expression:
        do { Cmd checkCommand <- cmd;
             let interval = listToMaybe intervals;
             let timeout = listToMaybe timeouts;
             let startPeriod = listToMaybe startPeriods;
             .... }
      In a case alternative:
          _ -> do { Cmd checkCommand <- cmd;
                    let interval = ...;
                    let timeout = ...;
                    .... }
[ 8 of 11] Compiling Language.Docker.EDSL.Types ( src/Language/Docker/EDSL/Types.hs, dist/build/Language/Docker/EDSL/Types.o )

I use ghc version 8.0.2 should I try a newer version ?

compilation with ghc 8.8.2 stack 15.1

I am trying to get our hadolint/hadolint working with the latest LTS stack. Unfortunately, build is failing for this repo with the latest stack 15.1 which is using ghc 8.8.2 and I am getting this error:

/home/zemanlx/git/language-docker/src/Language/Docker/Syntax/Lift.hs:18:10: error:
    Duplicate instance declarations:
      instance Lift Text.Text
        -- Defined at src/Language/Docker/Syntax/Lift.hs:18:10
      instance Lift Text.Text -- Defined in ‘Data.Text’
   |
18 | instance Lift Text.Text where
   |          ^^^^^^^^^^^^^^

I bet it is something that can be solved somehow trivially but I do not know how. If I can get hint @lorenzo I am happy to make PR for it.

Pretty printing of `RUN` in shell form replaces multiple spaces in quoted string

First of all, thanks for this helpful library.

The Dockerfile

FROM alpine
RUN echo 'a    b'

is pretty printed by prettyPrint as

FROM alpine
RUN echo 'a b'

I'd expect a quoted string to be left unchanged instead of reduced to 'a b'.

This happens not only with RUN instructions (in shell form), but also with health check commands.

A minimal code example is

module Main
  ( main
  ) where

import qualified Data.Either as Either
import qualified Data.Text as T
import qualified Data.Text.IO as T.IO
import qualified Data.Text.Lazy as Lazy
import qualified Language.Docker as Docker
import Prelude (IO, ($))

main :: IO ()
main = T.IO.putStr prettyPrinted
  where
    prettyPrinted = Lazy.toStrict $ Docker.prettyPrint parsed
    parsed = Either.fromRight [] $ Docker.parseText source
    source = T.pack "FROM alpine\nRUN echo 'a    b'\n"

I'm using version 9.1.1 of the library (via LTS Haskell 16.18).

Return EXPOSE ports as tuple

Current state

> parseString "EXPOSE 80/tcp 53/udp"
Right [InstructionPos (Expose (PortStr "80/tcp 53/udp")) "<string>" 1]
> parseString "EXPOSE 80 53/udp"
Right [InstructionPos (Expose (PortStr "80 53/udp")) "<string>" 1]
> parseString "EXPOSE 80 53"
Right [InstructionPos (Expose (Ports [80,53])) "<string>" 1]

This means that I have to parse it again when I get string to get ports and protocols. I would like to get it beck from parser as pairs portnumber/protocol where default protocol is tcp.

https://docs.docker.com/engine/reference/builder/#expose

Proposed state

> parseString "EXPOSE 80/tcp 53/udp"
Right [InstructionPos (Expose (Ports [(80,"tcp"), (53,"udp")])) "<string>" 1]
> parseString "EXPOSE 80 53/udp"
Right [InstructionPos (Expose (Ports [(80,"tcp"), (53,"udp")])) "<string>" 1]
> parseString "EXPOSE 80 53"
Right [InstructionPos (Expose (Ports [(80,"tcp"), (53,"tcp")])) "<string>" 1]

Digested image is not parsed

There is a definition for DigestedImage but it is not used. I always get it as TaggedImage

> parseString "FROM ubuntu@sha256:0ef2e08ed3fabfc44002ccb846c4f2416a2135affc3ce39538834059606f32dd"
Right [InstructionPos (From (TaggedImage "ubuntu@sha256" "0ef2e08ed3fabfc44002ccb846c4f2416a2135affc3ce39538834059606f32dd")) "<string>" 1]

Unexpected parser error in language-docker-6.0.1

I tried to parse https://github.com/peti/opensuse-docker/blob/master/tw-haskell-dev/Dockerfile and got the following error:

../opensuse-docker/tw-haskell-dev/Dockerfile:18:2:
unexpected '&'
expecting '#', ADD, ARG, CMD, COPY, ENTRYPOINT, ENV, EXPOSE, FROM, HEALTHCHECK, LABEL, MAINTAINER, ONBUILD, RUN, SHELL, STOPSIGNAL, USER, VOLUME, WORKDIR, end of input, or the rest of a new line followed by the next instruction

Curiously enough, docker parses and handles that Dockerfile just fine, so I reckon this is more likely to be an issue in the parser than an actual error in the file?

sdist doesn't include all necessary files for tests

Running 1 test suites...
Test suite hspec: RUNNING...

Language.Docker.Integration
  parse file
FROM foo:7-slim
#  An extra space after the env value should be no problem
ENV container="false container2=true"
ENV A="a.sh" \
    D="c B=installDBBinaries.sh"
ENV X="\"Y\" Z"
ENV DOG="Rex The Dog CAT=Top Cat"
ENV DOCKER_TLS_CERTDIR=""
ENV foo a="afoo bar bazqu\"z"
ENV BASE_PATH="/var/spool/apt-mirror"
    1.Dockerfile
FROM scratch
RUN set -ex; apt-get update; if ! which gpg; then apt-get install -y --no-install-recommends gnupg; fi; if ! gpg --version | grep -q '^gpg (GnuPG) 1\.'; then apt-get install -y --no-install-recommends dirmngr; fi; rm -rf /var/lib/apt/lists/*
ONBUILD ENV RUNNER_CMD_EXEC="${RUNNER_CMD_EXEC:-java \$JAVA_OPTS -jar /runtime/server.jar \$JAR_OPTS}"
ENV BUNDLE_WITHOUT="${bundle_without:-development test}"
    2.Dockerfile
    3.Dockerfile FAILED [1]
    4.Dockerfile FAILED [2]
    5.Dockerfile FAILED [3]
  escape character detection logic
    ensure the pretty printer respects escape pragmas FAILED [4]
    ensure escape character '\' is used as default FAILED [5]
    ensure the printer ignores escape pragmas in the wrong place FAILED [6]
  parse text
    1.Dockerfile
    2.Dockerfile
    3.Dockerfile FAILED [7]
    4.Dockerfile FAILED [8]
    5.Dockerfile FAILED [9]
    1.Dockerfile crlf
    2.Dockerfile crlf
    3.Dockerfile crlf FAILED [10]
    4.Dockerfile crlf FAILED [11]
    5.Dockerfile crlf FAILED [12]
Language.Docker.ParsePragma
  parse # pragma
    # escape = \
    #escape=`
    # escape=`
    #escape =`
    #escape= `
    # escape =`
    #escape = `
    # escape = `
    # Escape = `
    # ESCAPE = `
    #syntax=docker/dockerfile:1.0
    # syntax=docker/dockerfile:1.0
    #syntax =docker/dockerfile:1.0
    #syntax= docker/dockerfile:1.0
    # syntax =docker/dockerfile:1.0
    #syntax = docker/dockerfile:1.0
    # syntax= docker/dockerfile:1.0
    # syntax = docker/dockerfile:1.0
    # Syntax = docker/dockerfile:1.0
    # SYNTAX = docker/dockerfile:1.0
Language.Docker.Parser
  parse ARG
    no default
    no default with =
    with default
  parse FROM
    parse untagged image
    parse tagged image
    parse digested image
    parse digested image with tag
    parse image with spaces at the end
  parse aliased FROM
    parse untagged image
    parse tagged image
    parse diggested image
  parse FROM with platform
    parse untagged image with platform
    parse tagged image with platform
  parse FROM with registry
    registry without port
    parse with port and tag
    Not a registry if no TLD
  parse LABEL
    parse label
    parse space separated label
    parse quoted labels
    parses multiline labels
  parse ENV
    parses unquoted pair
    parse with space between key and value
    parse with more then one (white)space between key and value
    parse quoted value pair
    parse multiple unquoted pairs
    parse multiple quoted pairs
    env works before cmd
    parse with two spaces between
    have envs on multiple lines
    parses long env over multiple lines
    parse single var list
    parses many env lines with an equal sign in the value
    parses many env lines in mixed style
    parses many env with backslashes
    parses env with % in them
    parses env with % in them
  parse RUN
    escaped with space before
    does not choke on unmatched brackets
    Distinguishes between text and a list
    Accepts spaces inside the brackets
  parse CMD
    one line cmd
    cmd over several lines
    quoted command params
    Parses commas correctly
  parse SHELL
    quoted shell params
  parse HEALTHCHECK
    parse healthcheck with interval
    parse healthcheck with retries
    parse healthcheck with timeout
    parse healthcheck with start-period
    parse healthcheck with all flags
    parse healthcheck with no flags
  parse MAINTAINER
    maintainer of untagged scratch image
    maintainer with mail
    maintainer only mail after from
  parse # comment
    multiple comments before run
    multiple comments after run
    empty comment
    many escaped lines
    accepts backslash inside string
    tolerates spaces after a newline escape
    Correctly joins blank lines starting with comments
  expose
    should handle number ports
    should handle many number ports
    should handle ports with protocol
    should handle ports with protocol and variables
    should handle port ranges
    should handle udp port ranges
    should handle multiline variables
  syntax
    should handle lowercase instructions (#7 - https://github.com/beijaflor-io/haskell-language-dockerfile/issues/7)
  ADD
    simple ADD
    multifiles ADD
    list of quoted files
    with chown flag
    with chmod flag
    with chown and chmod flag
    with chown and chmod flag other order
    list of quoted files and chown
  COPY
    simple COPY
    multifiles COPY
    list of quoted files
    with chown flag
    with chmod flag
    with from flag
    with all three flags
    with all three flags in different order
    supports windows paths
    does not get confused with trailing whitespace
  RUN with experimental flags
    --mount=type=bind and target
    --mount default to bind
    --mount=type=bind all modifiers
    --mount=type=cache with target
    --mount=type=cache with all modifiers
    --mount=type=tmpfs
    --mount=type=ssh
    --mount=type=ssh,required=false
    --mount=type=ssh,required=False
    --mount=type=secret,required=true
    --mount=type=secret,required=True
    --mount=type=ssh all modifiers
    --mount=type=ssh all modifiers, required explicit
    --mount=type=secret all modifiers
    --mount=type=secret all modifiers, required explicit
    --network=none
    --network=host
    --network=default
    --security=insecure
    --security=sandbox
    allows all flags
Language.Docker.PrettyPrint
  pretty print ADD
    with just copy
    with just chown
    with just chmod
    with both chown and chmod
  pretty print COPY
    with just copy
    with just chown
    with just chmod
    with source baseimage
    with both chown and chmod
    with all three: from, chown and chmod
  pretty print # escape
    # escape = \
    # escape = `
  pretty print # syntax
    # syntax = docker/dockerfile:1.0

Failures:

  test/Language/Docker/IntegrationSpec.hs:27:5:
  1) Language.Docker.Integration, parse file, 3.Dockerfile
       uncaught exception: IOException of type NoSuchThing
       test/fixtures/3.Dockerfile: openBinaryFile: does not exist (No such file or directory)

  To rerun use: --match "/Language.Docker.Integration/parse file/3.Dockerfile/"

  test/Language/Docker/IntegrationSpec.hs:33:5:
  2) Language.Docker.Integration, parse file, 4.Dockerfile
       uncaught exception: IOException of type NoSuchThing
       test/fixtures/4.Dockerfile: openBinaryFile: does not exist (No such file or directory)

  To rerun use: --match "/Language.Docker.Integration/parse file/4.Dockerfile/"

  test/Language/Docker/IntegrationSpec.hs:39:5:
  3) Language.Docker.Integration, parse file, 5.Dockerfile
       uncaught exception: IOException of type NoSuchThing
       test/fixtures/5.Dockerfile: openBinaryFile: does not exist (No such file or directory)

  To rerun use: --match "/Language.Docker.Integration/parse file/5.Dockerfile/"

  test/Language/Docker/IntegrationSpec.hs:46:5:
  4) Language.Docker.Integration, escape character detection logic, ensure the pretty printer respects escape pragmas
       uncaught exception: IOException of type NoSuchThing
       test/fixtures/6.Dockerfile: openFile: does not exist (No such file or directory)

  To rerun use: --match "/Language.Docker.Integration/escape character detection logic/ensure the pretty printer respects escape pragmas/"

  test/Language/Docker/IntegrationSpec.hs:55:5:
  5) Language.Docker.Integration, escape character detection logic, ensure escape character '\' is used as default
       uncaught exception: IOException of type NoSuchThing
       test/fixtures/7.Dockerfile: openFile: does not exist (No such file or directory)

  To rerun use: --match "/Language.Docker.Integration/escape character detection logic/ensure escape character '\\' is used as default/"

  test/Language/Docker/IntegrationSpec.hs:64:5:
  6) Language.Docker.Integration, escape character detection logic, ensure the printer ignores escape pragmas in the wrong place
       uncaught exception: IOException of type NoSuchThing
       test/fixtures/8.Dockerfile: openFile: does not exist (No such file or directory)

  To rerun use: --match "/Language.Docker.Integration/escape character detection logic/ensure the printer ignores escape pragmas in the wrong place/"

  test/Language/Docker/IntegrationSpec.hs:86:5:
  7) Language.Docker.Integration, parse text, 3.Dockerfile
       uncaught exception: IOException of type NoSuchThing
       test/fixtures/3.Dockerfile: openFile: does not exist (No such file or directory)

  To rerun use: --match "/Language.Docker.Integration/parse text/3.Dockerfile/"

  test/Language/Docker/IntegrationSpec.hs:92:5:
  8) Language.Docker.Integration, parse text, 4.Dockerfile
       uncaught exception: IOException of type NoSuchThing
       test/fixtures/4.Dockerfile: openFile: does not exist (No such file or directory)

  To rerun use: --match "/Language.Docker.Integration/parse text/4.Dockerfile/"

  test/Language/Docker/IntegrationSpec.hs:98:5:
  9) Language.Docker.Integration, parse text, 5.Dockerfile
       uncaught exception: IOException of type NoSuchThing
       test/fixtures/5.Dockerfile: openFile: does not exist (No such file or directory)

  To rerun use: --match "/Language.Docker.Integration/parse text/5.Dockerfile/"

  test/Language/Docker/IntegrationSpec.hs:116:5:
  10) Language.Docker.Integration, parse text, 3.Dockerfile crlf
       uncaught exception: IOException of type NoSuchThing
       test/fixtures/3.Dockerfile: openFile: does not exist (No such file or directory)

  To rerun use: --match "/Language.Docker.Integration/parse text/3.Dockerfile crlf/"

  test/Language/Docker/IntegrationSpec.hs:122:5:
  11) Language.Docker.Integration, parse text, 4.Dockerfile crlf
       uncaught exception: IOException of type NoSuchThing
       test/fixtures/4.Dockerfile: openFile: does not exist (No such file or directory)

  To rerun use: --match "/Language.Docker.Integration/parse text/4.Dockerfile crlf/"

  test/Language/Docker/IntegrationSpec.hs:128:5:
  12) Language.Docker.Integration, parse text, 5.Dockerfile crlf
       uncaught exception: IOException of type NoSuchThing
       test/fixtures/5.Dockerfile: openFile: does not exist (No such file or directory)

  To rerun use: --match "/Language.Docker.Integration/parse text/5.Dockerfile crlf/"

Randomized with seed 1785490773

Finished in 0.0141 seconds
159 examples, 12 failures
Test suite hspec: FAIL
Test suite logged to: dist/test/language-docker-10.0.0-hspec.log
0 of 1 test suites (0 of 1 test cases) passed.

Wrong escaping of `\` when parsing ENV instructions

When parsing a Dockerfile with an ENV instruction containing a \ in the value of an environment variable, this is not escaped correctly:

ENV DOCKER_PASSWORD="aaa\aaa"

is parsed to

[InstructionPos {instruction = Env [("DOCKER_PASSWORD","aaa\\aaa")], sourcename = "./test.dockerfile", lineNumber = 1}]

This shows two \\ in the parsed value while I would expect there to be none as the \ is here used to (uselessly) escape the a.

src/Language/Docker/PrettyPrint.hs:91:25: error: Not in scope: 'fail'

Trying to build 4.0.1 here with ghc 8.0.1, and seeing this issue:

./setup build
Building language-docker-4.0.1...
Preprocessing library language-docker-4.0.1...
[ 1 of 11] Compiling Paths_language_docker ( dist/build/autogen/Paths_language_docker.hs, dist/build/Paths_language_docker.o )
[ 2 of 11] Compiling Language.Docker.Syntax ( src/Language/Docker/Syntax.hs, dist/build/Language/Docker/Syntax.o )
[ 3 of 11] Compiling Language.Docker.Syntax.Lift ( src/Language/Docker/Syntax/Lift.hs, dist/build/Language/Docker/Syntax/Lift.o )
[ 4 of 11] Compiling Language.Docker.PrettyPrint ( src/Language/Docker/PrettyPrint.hs, dist/build/Language/Docker/PrettyPrint.o )

src/Language/Docker/PrettyPrint.hs:91:25: error:
    Not in scope: ‘fail’
    Perhaps you want to add ‘fail’ to the import list in the import of
    ‘Prelude’ (src/Language/Docker/PrettyPrint.hs:(15,1)-(17,18)).
[ 5 of 11] Compiling Language.Docker.Normalize ( src/Language/Docker/Normalize.hs, dist/build/Language/Docker/Normalize.o )
[ 6 of 11] Compiling Language.Docker.Lexer ( src/Language/Docker/Lexer.hs, dist/build/Language/Docker/Lexer.o )
[ 7 of 11] Compiling Language.Docker.Parser ( src/Language/Docker/Parser.hs, dist/build/Language/Docker/Parser.o )
[ 8 of 11] Compiling Language.Docker.EDSL.Types ( src/Language/Docker/EDSL/Types.hs, dist/build/Language/Docker/EDSL/Types.o )

Test files missing from release tarball

Tests can't be executed from the hackage sdist due to missing the following files:

  • test/fixtures/Dockerfile.bom.utf32be
  • test/fixtures/Dockerfile.bom.utf32le
  • test/fixtures/Dockerfile.bom.utf16be
  • test/fixtures/Dockerfile.bom.utf16le
  • test/fixtures/Dockerfile.bom.utf8

GHC 8.10.1 build issues

Currently, language-docker-0.3.6.0 does not build GHC 8.10.1. This issue aims to document the underlying issues.

  1. The first issue you run into is this error:

    [ 7 of 10] Compiling Language.Docker.Syntax.Lift ( src/Language/Docker/Syntax/Lift.hs, interpreted )
    
    src/Language/Docker/Syntax/Lift.hs:16:1: error:
        Illegal kind signature: ‘a_a8rK’
          Perhaps you intended to use KindSignatures
        In an instance declaration
       |
    16 | deriveLift ''Fixed
       | ^^^^^^^^^^^^^^^^^^
    
    src/Language/Docker/Syntax/Lift.hs:16:1: error:
        Unexpected kind variable ‘k_a8rJ’
        Perhaps you intended to use PolyKinds
        In an instance declaration
       |
    16 | deriveLift ''Fixed
       | ^^^^^^^^^^^^^^^^^^
    

    This is because Fixed is poly-kinded as of base-4.14. A simple fix is to enable PolyKinds at the top of Language.Docker.Syntax.Lift.

  2. The next issue involves a missing Lift Text instance:

    [ 7 of 10] Compiling Language.Docker.Syntax.Lift ( src/Language/Docker/Syntax/Lift.hs, interpreted )
    
    src/Language/Docker/Syntax/Lift.hs:23:1: error:
        • No instance for (Lift Data.Text.Internal.Text)
            arising from a use of ‘lift’
        • In the second argument of ‘Language.Haskell.TH.Lib.Internal.appE’, namely
            ‘(lift x0_akQJ)’
          In the expression:
            (Language.Haskell.TH.Lib.Internal.appE
               (Language.Haskell.TH.Lib.Internal.conE
                  ((Language.Haskell.TH.Syntax.Name
                      (Language.Haskell.TH.Syntax.mkOccName "PortStr"))
                     (((Language.Haskell.TH.Syntax.NameG
                          Language.Haskell.TH.Syntax.DataName)
                         (Language.Haskell.TH.Syntax.mkPkgName
                            "language-docker-8.1.0-inplace"))
                        (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
              (lift x0_akQJ)
          In a case alternative:
              PortStr x0_akQJ
                -> (Language.Haskell.TH.Lib.Internal.appE
                      (Language.Haskell.TH.Lib.Internal.conE
                         ((Language.Haskell.TH.Syntax.Name
                             (Language.Haskell.TH.Syntax.mkOccName "PortStr"))
                            (((Language.Haskell.TH.Syntax.NameG
                                 Language.Haskell.TH.Syntax.DataName)
                                (Language.Haskell.TH.Syntax.mkPkgName
                                   "language-docker-8.1.0-inplace"))
                               (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
                     (lift x0_akQJ)
       |
    23 | deriveLift ''Port
       | ^^^^^^^^^^^^^^^^^
    
    src/Language/Docker/Syntax/Lift.hs:27:1: error:
        • No instance for (Lift Data.Text.Internal.Text)
            arising from a use of ‘lift’
        • In the second argument of ‘Language.Haskell.TH.Lib.Internal.appE’, namely
            ‘(lift x0_akSf)’
          In the expression:
            (Language.Haskell.TH.Lib.Internal.appE
               (Language.Haskell.TH.Lib.Internal.conE
                  ((Language.Haskell.TH.Syntax.Name
                      (Language.Haskell.TH.Syntax.mkOccName "Registry"))
                     (((Language.Haskell.TH.Syntax.NameG
                          Language.Haskell.TH.Syntax.DataName)
                         (Language.Haskell.TH.Syntax.mkPkgName
                            "language-docker-8.1.0-inplace"))
                        (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
              (lift x0_akSf)
          In a case alternative:
              Registry x0_akSf
                -> (Language.Haskell.TH.Lib.Internal.appE
                      (Language.Haskell.TH.Lib.Internal.conE
                         ((Language.Haskell.TH.Syntax.Name
                             (Language.Haskell.TH.Syntax.mkOccName "Registry"))
                            (((Language.Haskell.TH.Syntax.NameG
                                 Language.Haskell.TH.Syntax.DataName)
                                (Language.Haskell.TH.Syntax.mkPkgName
                                   "language-docker-8.1.0-inplace"))
                               (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
                     (lift x0_akSf)
       |
    27 | deriveLift ''Registry
       | ^^^^^^^^^^^^^^^^^^^^^
    
    src/Language/Docker/Syntax/Lift.hs:29:1: error:
        • No instance for (Lift Data.Text.Internal.Text)
            arising from a use of ‘lift’
        • In the second argument of ‘Language.Haskell.TH.Lib.Internal.appE’, namely
            ‘(lift x1_akSS)’
          In the expression:
            (Language.Haskell.TH.Lib.Internal.appE
               ((Language.Haskell.TH.Lib.Internal.appE
                   (Language.Haskell.TH.Lib.Internal.conE
                      ((Language.Haskell.TH.Syntax.Name
                          (Language.Haskell.TH.Syntax.mkOccName "Image"))
                         (((Language.Haskell.TH.Syntax.NameG
                              Language.Haskell.TH.Syntax.DataName)
                             (Language.Haskell.TH.Syntax.mkPkgName
                                "language-docker-8.1.0-inplace"))
                            (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
                  (lift x0_akSR)))
              (lift x1_akSS)
          In a case alternative:
              Image x0_akSR x1_akSS
                -> (Language.Haskell.TH.Lib.Internal.appE
                      ((Language.Haskell.TH.Lib.Internal.appE
                          (Language.Haskell.TH.Lib.Internal.conE
                             ((Language.Haskell.TH.Syntax.Name
                                 (Language.Haskell.TH.Syntax.mkOccName "Image"))
                                (((Language.Haskell.TH.Syntax.NameG
                                     Language.Haskell.TH.Syntax.DataName)
                                    (Language.Haskell.TH.Syntax.mkPkgName
                                       "language-docker-8.1.0-inplace"))
                                   (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
                         (lift x0_akSR)))
                     (lift x1_akSS)
       |
    29 | deriveLift ''Image
       | ^^^^^^^^^^^^^^^^^^
    
    src/Language/Docker/Syntax/Lift.hs:31:1: error:
        • No instance for (Lift Data.Text.Internal.Text)
            arising from a use of ‘lift’
        • In the second argument of ‘Language.Haskell.TH.Lib.Internal.appE’, namely
            ‘(lift x0_akTx)’
          In the expression:
            (Language.Haskell.TH.Lib.Internal.appE
               (Language.Haskell.TH.Lib.Internal.conE
                  ((Language.Haskell.TH.Syntax.Name
                      (Language.Haskell.TH.Syntax.mkOccName "ImageAlias"))
                     (((Language.Haskell.TH.Syntax.NameG
                          Language.Haskell.TH.Syntax.DataName)
                         (Language.Haskell.TH.Syntax.mkPkgName
                            "language-docker-8.1.0-inplace"))
                        (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
              (lift x0_akTx)
          In a case alternative:
              ImageAlias x0_akTx
                -> (Language.Haskell.TH.Lib.Internal.appE
                      (Language.Haskell.TH.Lib.Internal.conE
                         ((Language.Haskell.TH.Syntax.Name
                             (Language.Haskell.TH.Syntax.mkOccName "ImageAlias"))
                            (((Language.Haskell.TH.Syntax.NameG
                                 Language.Haskell.TH.Syntax.DataName)
                                (Language.Haskell.TH.Syntax.mkPkgName
                                   "language-docker-8.1.0-inplace"))
                               (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
                     (lift x0_akTx)
       |
    31 | deriveLift ''ImageAlias
       | ^^^^^^^^^^^^^^^^^^^^^^^
    
    src/Language/Docker/Syntax/Lift.hs:33:1: error:
        • No instance for (Lift Data.Text.Internal.Text)
            arising from a use of ‘lift’
        • In the second argument of ‘Language.Haskell.TH.Lib.Internal.appE’, namely
            ‘(lift x0_akU9)’
          In the expression:
            (Language.Haskell.TH.Lib.Internal.appE
               (Language.Haskell.TH.Lib.Internal.conE
                  ((Language.Haskell.TH.Syntax.Name
                      (Language.Haskell.TH.Syntax.mkOccName "Tag"))
                     (((Language.Haskell.TH.Syntax.NameG
                          Language.Haskell.TH.Syntax.DataName)
                         (Language.Haskell.TH.Syntax.mkPkgName
                            "language-docker-8.1.0-inplace"))
                        (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
              (lift x0_akU9)
          In a case alternative:
              Tag x0_akU9
                -> (Language.Haskell.TH.Lib.Internal.appE
                      (Language.Haskell.TH.Lib.Internal.conE
                         ((Language.Haskell.TH.Syntax.Name
                             (Language.Haskell.TH.Syntax.mkOccName "Tag"))
                            (((Language.Haskell.TH.Syntax.NameG
                                 Language.Haskell.TH.Syntax.DataName)
                                (Language.Haskell.TH.Syntax.mkPkgName
                                   "language-docker-8.1.0-inplace"))
                               (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
                     (lift x0_akU9)
       |
    33 | deriveLift ''Tag
       | ^^^^^^^^^^^^^^^^
    
    src/Language/Docker/Syntax/Lift.hs:35:1: error:
        • No instance for (Lift Data.Text.Internal.Text)
            arising from a use of ‘lift’
        • In the second argument of ‘Language.Haskell.TH.Lib.Internal.appE’, namely
            ‘(lift x0_akUL)’
          In the expression:
            (Language.Haskell.TH.Lib.Internal.appE
               (Language.Haskell.TH.Lib.Internal.conE
                  ((Language.Haskell.TH.Syntax.Name
                      (Language.Haskell.TH.Syntax.mkOccName "Digest"))
                     (((Language.Haskell.TH.Syntax.NameG
                          Language.Haskell.TH.Syntax.DataName)
                         (Language.Haskell.TH.Syntax.mkPkgName
                            "language-docker-8.1.0-inplace"))
                        (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
              (lift x0_akUL)
          In a case alternative:
              Digest x0_akUL
                -> (Language.Haskell.TH.Lib.Internal.appE
                      (Language.Haskell.TH.Lib.Internal.conE
                         ((Language.Haskell.TH.Syntax.Name
                             (Language.Haskell.TH.Syntax.mkOccName "Digest"))
                            (((Language.Haskell.TH.Syntax.NameG
                                 Language.Haskell.TH.Syntax.DataName)
                                (Language.Haskell.TH.Syntax.mkPkgName
                                   "language-docker-8.1.0-inplace"))
                               (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
                     (lift x0_akUL)
       |
    35 | deriveLift ''Digest
       | ^^^^^^^^^^^^^^^^^^^
    
    src/Language/Docker/Syntax/Lift.hs:37:1: error:
        • No instance for (Lift Data.Text.Internal.Text)
            arising from a use of ‘lift’
        • In the second argument of ‘Language.Haskell.TH.Lib.Internal.appE’, namely
            ‘(lift x4_akVr)’
          In the expression:
            (Language.Haskell.TH.Lib.Internal.appE
               ((Language.Haskell.TH.Lib.Internal.appE
                   ((Language.Haskell.TH.Lib.Internal.appE
                       ((Language.Haskell.TH.Lib.Internal.appE
                           ((Language.Haskell.TH.Lib.Internal.appE
                               (Language.Haskell.TH.Lib.Internal.conE
                                  ((Language.Haskell.TH.Syntax.Name
                                      (Language.Haskell.TH.Syntax.mkOccName "BaseImage"))
                                     (((Language.Haskell.TH.Syntax.NameG
                                          Language.Haskell.TH.Syntax.DataName)
                                         (Language.Haskell.TH.Syntax.mkPkgName
                                            "language-docker-8.1.0-inplace"))
                                        (Language.Haskell.TH.Syntax.mkModName
                                           "Language.Docker.Syntax")))))
                              (lift x0_akVn)))
                          (lift x1_akVo)))
                      (lift x2_akVp)))
                  (lift x3_akVq)))
              (lift x4_akVr)
          In a case alternative:
              BaseImage x0_akVn x1_akVo x2_akVp x3_akVq x4_akVr
                -> (Language.Haskell.TH.Lib.Internal.appE
                      ((Language.Haskell.TH.Lib.Internal.appE
                          ((Language.Haskell.TH.Lib.Internal.appE
                              ((Language.Haskell.TH.Lib.Internal.appE
                                  ((Language.Haskell.TH.Lib.Internal.appE
                                      (Language.Haskell.TH.Lib.Internal.conE
                                         ((Language.Haskell.TH.Syntax.Name
                                             (Language.Haskell.TH.Syntax.mkOccName "BaseImage"))
                                            (((Language.Haskell.TH.Syntax.NameG
                                                 Language.Haskell.TH.Syntax.DataName)
                                                (Language.Haskell.TH.Syntax.mkPkgName
                                                   "language-docker-8.1.0-inplace"))
                                               (Language.Haskell.TH.Syntax.mkModName
                                                  "Language.Docker.Syntax")))))
                                     (lift x0_akVn)))
                                 (lift x1_akVo)))
                             (lift x2_akVp)))
                         (lift x3_akVq)))
                     (lift x4_akVr)
       |
    37 | deriveLift ''BaseImage
       | ^^^^^^^^^^^^^^^^^^^^^^
    
    src/Language/Docker/Syntax/Lift.hs:41:1: error:
        • Could not deduce (Lift Data.Text.Internal.Text)
            arising from a use of ‘lift’
          from the context: Lift args
            bound by the instance declaration
            at src/Language/Docker/Syntax/Lift.hs:41:1-24
        • In the second argument of ‘Language.Haskell.TH.Lib.Internal.appE’, namely
            ‘(lift x0_akYg)’
          In the expression:
            (Language.Haskell.TH.Lib.Internal.appE
               (Language.Haskell.TH.Lib.Internal.conE
                  ((Language.Haskell.TH.Syntax.Name
                      (Language.Haskell.TH.Syntax.mkOccName "User"))
                     (((Language.Haskell.TH.Syntax.NameG
                          Language.Haskell.TH.Syntax.DataName)
                         (Language.Haskell.TH.Syntax.mkPkgName
                            "language-docker-8.1.0-inplace"))
                        (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
              (lift x0_akYg)
          In a case alternative:
              User x0_akYg
                -> (Language.Haskell.TH.Lib.Internal.appE
                      (Language.Haskell.TH.Lib.Internal.conE
                         ((Language.Haskell.TH.Syntax.Name
                             (Language.Haskell.TH.Syntax.mkOccName "User"))
                            (((Language.Haskell.TH.Syntax.NameG
                                 Language.Haskell.TH.Syntax.DataName)
                                (Language.Haskell.TH.Syntax.mkPkgName
                                   "language-docker-8.1.0-inplace"))
                               (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
                     (lift x0_akYg)
       |
    41 | deriveLift ''Instruction
       | ^^^^^^^^^^^^^^^^^^^^^^^^
    
    src/Language/Docker/Syntax/Lift.hs:43:1: error:
        • Could not deduce (Lift Filename) arising from a use of ‘lift’
          from the context: Lift args
            bound by the instance declaration
            at src/Language/Docker/Syntax/Lift.hs:43:1-27
        • In the second argument of ‘Language.Haskell.TH.Lib.Internal.appE’, namely
            ‘(lift x1_al0d)’
          In the first argument of ‘Language.Haskell.TH.Lib.Internal.appE’, namely
            ‘((Language.Haskell.TH.Lib.Internal.appE
                 ((Language.Haskell.TH.Lib.Internal.appE
                     (Language.Haskell.TH.Lib.Internal.conE
                        ((Language.Haskell.TH.Syntax.Name
                            (Language.Haskell.TH.Syntax.mkOccName "InstructionPos"))
                           (((Language.Haskell.TH.Syntax.NameG
                                Language.Haskell.TH.Syntax.DataName)
                               (Language.Haskell.TH.Syntax.mkPkgName
                                  "language-docker-8.1.0-inplace"))
                              (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
                    (lift x0_al0c)))
                (lift x1_al0d))’
          In the expression:
            (Language.Haskell.TH.Lib.Internal.appE
               ((Language.Haskell.TH.Lib.Internal.appE
                   ((Language.Haskell.TH.Lib.Internal.appE
                       (Language.Haskell.TH.Lib.Internal.conE
                          ((Language.Haskell.TH.Syntax.Name
                              (Language.Haskell.TH.Syntax.mkOccName "InstructionPos"))
                             (((Language.Haskell.TH.Syntax.NameG
                                  Language.Haskell.TH.Syntax.DataName)
                                 (Language.Haskell.TH.Syntax.mkPkgName
                                    "language-docker-8.1.0-inplace"))
                                (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
                      (lift x0_al0c)))
                  (lift x1_al0d)))
              (lift x2_al0e)
       |
    43 | deriveLift ''InstructionPos
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    src/Language/Docker/Syntax/Lift.hs:45:1: error:
        • No instance for (Lift Data.Text.Internal.Text)
            arising from a use of ‘lift’
        • In the second argument of ‘Language.Haskell.TH.Lib.Internal.appE’, namely
            ‘(lift x0_al12)’
          In the expression:
            (Language.Haskell.TH.Lib.Internal.appE
               (Language.Haskell.TH.Lib.Internal.conE
                  ((Language.Haskell.TH.Syntax.Name
                      (Language.Haskell.TH.Syntax.mkOccName "SourcePath"))
                     (((Language.Haskell.TH.Syntax.NameG
                          Language.Haskell.TH.Syntax.DataName)
                         (Language.Haskell.TH.Syntax.mkPkgName
                            "language-docker-8.1.0-inplace"))
                        (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
              (lift x0_al12)
          In a case alternative:
              SourcePath x0_al12
                -> (Language.Haskell.TH.Lib.Internal.appE
                      (Language.Haskell.TH.Lib.Internal.conE
                         ((Language.Haskell.TH.Syntax.Name
                             (Language.Haskell.TH.Syntax.mkOccName "SourcePath"))
                            (((Language.Haskell.TH.Syntax.NameG
                                 Language.Haskell.TH.Syntax.DataName)
                                (Language.Haskell.TH.Syntax.mkPkgName
                                   "language-docker-8.1.0-inplace"))
                               (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
                     (lift x0_al12)
       |
    45 | deriveLift ''SourcePath
       | ^^^^^^^^^^^^^^^^^^^^^^^
    
    src/Language/Docker/Syntax/Lift.hs:47:1: error:
        • No instance for (Lift Data.Text.Internal.Text)
            arising from a use of ‘lift’
        • In the second argument of ‘Language.Haskell.TH.Lib.Internal.appE’, namely
            ‘(lift x0_al1E)’
          In the expression:
            (Language.Haskell.TH.Lib.Internal.appE
               (Language.Haskell.TH.Lib.Internal.conE
                  ((Language.Haskell.TH.Syntax.Name
                      (Language.Haskell.TH.Syntax.mkOccName "TargetPath"))
                     (((Language.Haskell.TH.Syntax.NameG
                          Language.Haskell.TH.Syntax.DataName)
                         (Language.Haskell.TH.Syntax.mkPkgName
                            "language-docker-8.1.0-inplace"))
                        (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
              (lift x0_al1E)
          In a case alternative:
              TargetPath x0_al1E
                -> (Language.Haskell.TH.Lib.Internal.appE
                      (Language.Haskell.TH.Lib.Internal.conE
                         ((Language.Haskell.TH.Syntax.Name
                             (Language.Haskell.TH.Syntax.mkOccName "TargetPath"))
                            (((Language.Haskell.TH.Syntax.NameG
                                 Language.Haskell.TH.Syntax.DataName)
                                (Language.Haskell.TH.Syntax.mkPkgName
                                   "language-docker-8.1.0-inplace"))
                               (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
                     (lift x0_al1E)
       |
    47 | deriveLift ''TargetPath
       | ^^^^^^^^^^^^^^^^^^^^^^^
    
    src/Language/Docker/Syntax/Lift.hs:49:1: error:
        • No instance for (Lift Data.Text.Internal.Text)
            arising from a use of ‘lift’
        • In the second argument of ‘Language.Haskell.TH.Lib.Internal.appE’, namely
            ‘(lift x0_al2g)’
          In the expression:
            (Language.Haskell.TH.Lib.Internal.appE
               (Language.Haskell.TH.Lib.Internal.conE
                  ((Language.Haskell.TH.Syntax.Name
                      (Language.Haskell.TH.Syntax.mkOccName "Chown"))
                     (((Language.Haskell.TH.Syntax.NameG
                          Language.Haskell.TH.Syntax.DataName)
                         (Language.Haskell.TH.Syntax.mkPkgName
                            "language-docker-8.1.0-inplace"))
                        (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
              (lift x0_al2g)
          In a case alternative:
              Chown x0_al2g
                -> (Language.Haskell.TH.Lib.Internal.appE
                      (Language.Haskell.TH.Lib.Internal.conE
                         ((Language.Haskell.TH.Syntax.Name
                             (Language.Haskell.TH.Syntax.mkOccName "Chown"))
                            (((Language.Haskell.TH.Syntax.NameG
                                 Language.Haskell.TH.Syntax.DataName)
                                (Language.Haskell.TH.Syntax.mkPkgName
                                   "language-docker-8.1.0-inplace"))
                               (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
                     (lift x0_al2g)
       |
    49 | deriveLift ''Chown
       | ^^^^^^^^^^^^^^^^^^
    
    src/Language/Docker/Syntax/Lift.hs:51:1: error:
        • No instance for (Lift Data.Text.Internal.Text)
            arising from a use of ‘lift’
        • In the second argument of ‘Language.Haskell.TH.Lib.Internal.appE’, namely
            ‘(lift x0_al2S)’
          In the expression:
            (Language.Haskell.TH.Lib.Internal.appE
               (Language.Haskell.TH.Lib.Internal.conE
                  ((Language.Haskell.TH.Syntax.Name
                      (Language.Haskell.TH.Syntax.mkOccName "CopySource"))
                     (((Language.Haskell.TH.Syntax.NameG
                          Language.Haskell.TH.Syntax.DataName)
                         (Language.Haskell.TH.Syntax.mkPkgName
                            "language-docker-8.1.0-inplace"))
                        (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
              (lift x0_al2S)
          In a case alternative:
              CopySource x0_al2S
                -> (Language.Haskell.TH.Lib.Internal.appE
                      (Language.Haskell.TH.Lib.Internal.conE
                         ((Language.Haskell.TH.Syntax.Name
                             (Language.Haskell.TH.Syntax.mkOccName "CopySource"))
                            (((Language.Haskell.TH.Syntax.NameG
                                 Language.Haskell.TH.Syntax.DataName)
                                (Language.Haskell.TH.Syntax.mkPkgName
                                   "language-docker-8.1.0-inplace"))
                               (Language.Haskell.TH.Syntax.mkModName "Language.Docker.Syntax")))))
                     (lift x0_al2S)
       |
    51 | deriveLift ''CopySource
       | ^^^^^^^^^^^^^^^^^^^^^^^
    

    #50 incorrectly attempted to fix this by limiting the build plan to only GHC 8.8 or later. However, that is insufficient, as GHC 8.10.1 bundles text-1.2.3.2, which does not define a Lift Text instance. (See here for more discussion on this.)

    I think the best way to solve this problem would be to depend on th-lift-instances, which backports the Lift Text instance to older versions of text. Since language-dockerfile already depends on this library, this doesn't seem like that radical of a change. If we did this, then language-docker could even theoretically support older versions of GHC again, although I will leave that choice to the maintainers of this library.

Inaccurate version bounds

As can be seen at

there were a few issues due to inaccurate and/or missing version bounds which affect reverse dependencies of language-docker. I've already manually fixed up those up for you via Hackage metadata revision, see e.g.

and you can review the resulting report at

Going forward, we need your help! Please help us ensure a good user experience for users of Hackage/Cabal by the use of the PVP mandated lower&upper bounds in order to reduce the penalty on the Hackage infrastructure as well as to avoid unnecessary extra work for you as well as for us Hackage Trustees!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.