vzarytovskii / haskell-dev-env

A Dockerfile for Haskell Development, and DevContainer for VSCode, for installing GHC HLS (Haskell Language Server) and the required plugins
MIT License
56 stars 17 forks source link

ormolu plugin fails to build #2

Closed KenGrierson1 closed 2 years ago

KenGrierson1 commented 2 years ago

In currently latest build efd32ffcfa984a1ad008513e953556755f2839ab the ormolu plugin fails to build. The previous build from 15 October worked fine (thanks) so I can probably get it to work by experimenting with the versions of GHC, stack resolver and Cabal declared at the top of the Dockerfile. However, I am new to Haskell.

Version of Docker is 4.1.1 with Windows 11 and WSL 2

 > [25/28] RUN cabal install ormolu:
#28 3.521 Resolving dependencies...
#28 4.168 Build profile: -w ghc-8.10.7 -O1
#28 4.168 In order, the following will be built (use -v for more details):
#28 4.168  - Cabal-3.6.2.0 (lib) (requires build)
#28 4.168  - Diff-0.4.0 (lib) (requires download & build)
#28 4.168  - ghc-lib-parser-9.2.1.20211101 (lib) (requires download & build)
#28 4.168  - gitrev-1.3.1 (lib) (requires download & build)
#28 4.168  - ormolu-0.4.0.0 (lib) (requires download & build)
#28 4.168  - ormolu-0.4.0.0 (exe:ormolu) (requires download & build)
#28 4.169 Downloading  gitrev-1.3.1
#28 4.400 Starting     Cabal-3.6.2.0 (lib)
#28 4.817 Downloaded   gitrev-1.3.1
#28 4.817 Downloading  ghc-lib-parser-9.2.1.20211101
#28 4.822 Starting     gitrev-1.3.1 (lib)
#28 5.494 Building     Cabal-3.6.2.0 (lib)
#28 5.690 Downloaded   ghc-lib-parser-9.2.1.20211101
#28 5.690 Downloading  Diff-0.4.0
#28 5.953 Starting     ghc-lib-parser-9.2.1.20211101 (lib)
#28 6.007 Building     gitrev-1.3.1 (lib)
#28 6.347 Downloaded   Diff-0.4.0
#28 6.347 Downloading  ormolu-0.4.0.0
#28 6.355 Starting     Diff-0.4.0 (lib)
#28 6.857 Downloaded   ormolu-0.4.0.0
#28 7.158 Building     ghc-lib-parser-9.2.1.20211101 (lib)
#28 7.239 Installing   gitrev-1.3.1 (lib)
#28 7.593 Building     Diff-0.4.0 (lib)
#28 7.867 Completed    gitrev-1.3.1 (lib)
#28 10.31 Installing   Diff-0.4.0 (lib)
#28 10.90 Completed    Diff-0.4.0 (lib)
#28 279.5 Installing   Cabal-3.6.2.0 (lib)
#28 280.8 Completed    Cabal-3.6.2.0 (lib)
#28 280.9
#28 280.9 Failed to build ghc-lib-parser-9.2.1.20211101.
#28 280.9 Build log (
#28 280.9 /home/haskeller/.cabal/logs/ghc-8.10.7/ghc-lib-parser-9.2.1.20211101-7427952d5d66716c4348d5fbe98361103ae308a4934ef5ec6b096d0b96ae9327.log
#28 280.9 ):
#28 280.9 Warning: ghc-lib-parser.cabal:136:5: The field "autogen-modules" is available
#28 280.9 only since the Cabal specification version 2.0. This field will be ignored.
#28 280.9 Warning: ghc-lib-parser.cabal:1:22: Packages with 'cabal-version: 1.12' or
#28 280.9 later should specify a specific version of the Cabal spec of the form
#28 280.9 'cabal-version: x.y'. Use 'cabal-version: 1.22'.
#28 280.9 Configuring library for ghc-lib-parser-9.2.1.20211101..
#28 280.9 Preprocessing library for ghc-lib-parser-9.2.1.20211101..
#28 280.9 Building library for ghc-lib-parser-9.2.1.20211101..
#28 280.9 [  1 of 333] Compiling GHC.BaseDir      ( libraries/ghc-boot/GHC/BaseDir.hs, dist/build/GHC/BaseDir.o, dist/build/GHC/BaseDir.dyn_o )
#28 280.9 [  2 of 333] Compiling GHC.Data.SizedSeq ( libraries/ghc-boot/GHC/Data/SizedSeq.hs, dist/build/GHC/Data/SizedSeq.o, dist/build/GHC/Data/SizedSeq.dyn_o )
#28 280.9 [  3 of 333] Compiling GHC.Exts.Heap.ClosureTypes ( libraries/ghc-heap/GHC/Exts/Heap/ClosureTypes.hs, dist/build/GHC/Exts/Heap/ClosureTypes.o, dist/build/GHC/Exts/Heap/ClosureTypes.dyn_o )
#28 280.9 [  4 of 333] Compiling GHC.Exts.Heap.Constants ( dist/build/GHC/Exts/Heap/Constants.hs, dist/build/GHC/Exts/Heap/Constants.o, dist/build/GHC/Exts/Heap/Constants.dyn_o )
#28 280.9 [  5 of 333] Compiling GHC.Exts.Heap.FFIClosures ( libraries/ghc-heap/GHC/Exts/Heap/FFIClosures.hs, dist/build/GHC/Exts/Heap/FFIClosures.o, dist/build/GHC/Exts/Heap/FFIClosures.dyn_o )
#28 280.9
#28 280.9 libraries/ghc-heap/GHC/Exts/Heap/FFIClosures.hs:45:1: error:
#28 280.9     parse error on input `import'
#28 280.9    |
#28 280.9 45 | import GHC.Exts.Heap.FFIClosures_ProfilingDisabled as Reexport
#28 280.9    | ^^^^^^
#28 280.9 cabal: Failed to build ghc-lib-parser-9.2.1.20211101 (which is required by
#28 280.9 exe:ormolu from ormolu-0.4.0.0). See the build log above for details.
#28 280.9
------
executor failed running [/bin/sh -c cabal install ormolu]: exit code: 1
[3084074 ms] Command failed: docker build -f c:\Users\ken_g\tutorials\haskell1\.devcontainer\Dockerfile -t vsc-haskell1-dd26aa4cd8b70001a933c278e2e09d8a c:\Users\ken_g\tutorials\haskell1
vzarytovskii commented 2 years ago

Sorry, must've missed this issue. I'll look into it. Probably need to pin the version compatible with the GHC used.

vzarytovskii commented 2 years ago

It should be fixed now, apparently it was some temporary issue with ghc-heap (related to https://github.com/tweag/ormolu/issues/651 ?), I will try to not forget and pin packages versions for the given ghc.