demoscene icon indicating copy to clipboard operation
demoscene copied to clipboard

Problem with compiling on windows

Open Xantshmeshnilnon opened this issue 6 months ago • 0 comments

I tried to compile it on windows, it went to 59/61 and failed at lambdacube-gl giving a couple of errors and warnings.

Error: [S-7282]
       Stack failed to execute the build plan.

       While executing the build plan, Stack encountered the error:

       [S-7011]
       While building package lambdacube-gl-0.2.2 (scroll up to its section to see the error) using:
       C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_9p6GVs8J_3.10.1.0_ghc-9.6.3.exe --verbose=1 --builddir=.stack-work\dist\6c8505b4 build --ghc-options " -fdiagnostics-color=always"
       Process exited with code: ExitFailure 1

Initially when trying to build I had an error which I solved using command 'stack --resolver lts build' which selected resolver: lts-22.4. Without it compilation wouldn't even start. Perhaps should use older stack version?

Error: [S-5973]
       Stack does not support Cabal versions before 1.24, but version 1.22.5.0 was found. To fix this, consider updating the snapshot to lts-7.0 or later or to
       nightly-2016-05-26 or later.

Is there a known simple way to make it compile successfully without making changes to the source code? I am a very beginner in Haskell and thought digging into a code of a demoscene prod would be a good idea to learn some good practices but perhaps the bar is yet too high for me ;-)

the whole console output with errors:

lambdacube-gl                    > Configuring lambdacube-gl-0.2.2...
lambdacube-gl                    > build
lambdacube-gl                    > Preprocessing library for lambdacube-gl-0.2.2..
lambdacube-gl                    > Building library for lambdacube-gl-0.2.2..
lambdacube-gl                    > [1 of 8] Compiling LambdaCube.GL.GLSLCodeGen
lambdacube-gl                    >
lambdacube-gl                    > src\lib\LambdaCube\GL\GLSLCodeGen.hs:438:25: error: [GHC-39999]
lambdacube-gl                    > [2 of 8] Compiling LambdaCube.GL.Type
lambdacube-gl                    >     * No instance for `MonadFail Data.Functor.Identity.Identity'
lambdacube-gl                    >         arising from a do statement
lambdacube-gl                    >         with the failable pattern `[lcE]'
lambdacube-gl                    >     * In a stmt of a 'do' block:
lambdacube-gl                    >         [lcE] <- codeGenExp' dag smpName env' (getBody lc)
lambdacube-gl                    >       In the second argument of `($)', namely
lambdacube-gl                    >         `do [lcE] <- codeGenExp' dag smpName env' (getBody lc)
lambdacube-gl                    >             addStmt (SelectionStatement (UnaryNot lcE) Break Nothing)
lambdacube-gl                    >             stE' <- codeGenExp' dag smpName env' (getBody st)
lambdacube-gl                    >             mapM_ addStmt $ zipWith assign stE stE'
lambdacube-gl                    >             ....'
lambdacube-gl                    >       In the expression:
lambdacube-gl                    >         (flip runState) ([], loopCGenState)
lambdacube-gl                    >           $ do [lcE] <- codeGenExp' dag smpName env' (getBody lc)
lambdacube-gl                    >                addStmt (SelectionStatement (UnaryNot lcE) Break Nothing)
lambdacube-gl                    >                stE' <- codeGenExp' dag smpName env' (getBody st)
lambdacube-gl                    >                mapM_ addStmt $ zipWith assign stE stE'
lambdacube-gl                    >                ....
lambdacube-gl                    >     |
lambdacube-gl                    > 438 |                         [lcE] <- codeGenExp' dag smpName env' (getBody lc)
lambdacube-gl                    >     |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lambdacube-gl                    >
lambdacube-gl                    > src\lib\LambdaCube\GL\GLSLCodeGen.hs:461:17: error: [GHC-39999]
lambdacube-gl                    >     * No instance for `MonadFail Data.Functor.Identity.Identity'
lambdacube-gl                    >         arising from a do statement
lambdacube-gl                    >         with the failable pattern `[p']'
lambdacube-gl                    >     * In a stmt of a 'do' block: [p'] <- codeGenExp' dag smpName env p
lambdacube-gl                    >       In the expression:
lambdacube-gl                    >         do [p'] <- codeGenExp' dag smpName env p
lambdacube-gl                    >            t' <- codeGenExp' dag smpName env t
lambdacube-gl                    >            e' <- codeGenExp' dag smpName env e
lambdacube-gl                    >            let branch a b = Selection p' a b
lambdacube-gl                    >            ....
lambdacube-gl                    >       In a case alternative:
lambdacube-gl                    >           Cond p t e
lambdacube-gl                    >             -> do [p'] <- codeGenExp' dag smpName env p
lambdacube-gl                    >                   t' <- codeGenExp' dag smpName env t
lambdacube-gl                    >                   e' <- codeGenExp' dag smpName env e
lambdacube-gl                    >                   ....
lambdacube-gl                    >     |
lambdacube-gl                    > 461 |                 [p'] <- codeGenExp' dag smpName env p
lambdacube-gl                    >     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lambdacube-gl                    >
lambdacube-gl                    > src\lib\LambdaCube\GL\GLSLCodeGen.hs:530:13: error: [GHC-39999]
lambdacube-gl                    >     * No instance for `MonadFail Data.Functor.Identity.Identity'
lambdacube-gl                    >         arising from a do statement
lambdacube-gl                    >         with the failable pattern `[sizeE']'
lambdacube-gl                    >     * In a stmt of a 'do' block: [sizeE'] <- genExp size
lambdacube-gl                    >       In the expression:
lambdacube-gl                    >         do a <- genExp pos
lambdacube-gl                    >            let [posE'] = a
lambdacube-gl                    >            [sizeE'] <- genExp size
lambdacube-gl                    >            clipE' <- concat <$> mapM genExp clips
lambdacube-gl                    >            ....
lambdacube-gl                    >       In an equation for `genSrc':
lambdacube-gl                    >           genSrc
lambdacube-gl                    >             = do a <- genExp pos
lambdacube-gl                    >                  let [posE'] = ...
lambdacube-gl                    >                  [sizeE'] <- genExp size
lambdacube-gl                    >                  ....
lambdacube-gl                    >     |
lambdacube-gl                    > 530 |             [sizeE'] <- genExp size
lambdacube-gl                    >     |             ^^^^^^^^^^^^^^^^^^^^^^^
lambdacube-gl                    >
lambdacube-gl                    > src\lib\LambdaCube\GL\GLSLCodeGen.hs:633:17: error: [GHC-39999]
lambdacube-gl                    >     * No instance for `MonadFail Data.Functor.Identity.Identity'
lambdacube-gl                    >         arising from a do statement
lambdacube-gl                    >         with the failable pattern `(primIdE : layerE : stPrimStVertCntVert)'
lambdacube-gl                    >     * In a stmt of a 'do' block:
lambdacube-gl                    >         (primIdE : layerE : stPrimStVertCntVert) <- genExp
lambdacube-gl                    >                                                       (V.singleton stPE) primBody
lambdacube-gl                    >       In the expression:
lambdacube-gl                    >         do (primIdE : layerE : stPrimStVertCntVert) <- genExp
lambdacube-gl                    >                                                          (V.singleton stPE) primBody
lambdacube-gl                    >            let (stPrimE', xsE)
lambdacube-gl                    >                  = splitAt (length primStateE) stPrimStVertCntVert
lambdacube-gl                    >                (stVertE, [vertCntE]) = splitAt (length xsE - 1) xsE
lambdacube-gl                    >                ....
lambdacube-gl                    >            mapM addStmt stVS
lambdacube-gl                    >            (_, varMapV) <- get
lambdacube-gl                    >            ....
lambdacube-gl                    >       In an equation for `primLoop':
lambdacube-gl                    >           primLoop
lambdacube-gl                    >             = do (primIdE : layerE : stPrimStVertCntVert) <- genExp
lambdacube-gl                    >                                                                (V.singleton stPE) primBody
lambdacube-gl                    >                  let (stPrimE', xsE) = ...
lambdacube-gl                    >                      ....
lambdacube-gl                    >                  mapM addStmt stVS
lambdacube-gl                    >                  ....
lambdacube-gl                    >     |
lambdacube-gl                    > 633 |                 (primIdE:layerE:stPrimStVertCntVert) <- genExp (V.singleton stPE) primBody
lambdacube-gl                    >     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lambdacube-gl                    >
lambdacube-gl                    > src\lib\LambdaCube\GL\GLSLCodeGen.hs:646:25: error: [GHC-39999]
lambdacube-gl                    >     * No instance for `MonadFail Data.Functor.Identity.Identity'
lambdacube-gl                    >         arising from a do statement
lambdacube-gl                    >         with the failable pattern `[sizeE]'
FontyFruity                      > [ 4 of 14] Compiling Graphics.Text.TrueType.Name
lambdacube-gl                    >     * In a stmt of a 'do' block: [sizeE] <- genVert sE
lambdacube-gl                    >       In the expression:
lambdacube-gl                    >         do let env = V.singleton stVE
lambdacube-gl                    >                genVert = genExp env
lambdacube-gl                    >            stVE' <- genVert stE
lambdacube-gl                    >            [posE] <- genVert pE
lambdacube-gl                    >            [sizeE] <- genVert sE
lambdacube-gl                    >            ....
lambdacube-gl                    >       In an equation for `genVertFun':
lambdacube-gl                    >           genVertFun
lambdacube-gl                    >             = do let env = ...
lambdacube-gl                    >                      ....
lambdacube-gl                    >                  stVE' <- genVert stE
lambdacube-gl                    >                  [posE] <- genVert pE
lambdacube-gl                    >                  ....
lambdacube-gl                    >     |
lambdacube-gl                    > 646 |                         [sizeE] <- genVert sE
lambdacube-gl                    >     |                         ^^^^^^^^^^^^^^^^^^^^^
lambdacube-gl                    >
lambdacube-gl                    > src\lib\LambdaCube\GL\Type.hs:12:1: warning: [-Wunused-imports]
lambdacube-gl                    >     The qualified import of `Data.Vector.Unboxed.Mutable' is redundant
lambdacube-gl                    >       except perhaps to import instances from `Data.Vector.Unboxed.Mutable'
lambdacube-gl                    >     To import instances alone, use: import Data.Vector.Unboxed.Mutable()
lambdacube-gl                    >    |
lambdacube-gl                    > 12 | import qualified Data.Vector.Unboxed.Mutable as MV
lambdacube-gl                    >    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FontyFruity                      > [ 5 of 14] Compiling Graphics.Text.TrueType.Types
FontyFruity                      > [ 6 of 14] Compiling Graphics.Text.TrueType.OffsetTable
lambdacube-gl                    > [3 of 8] Compiling LambdaCube.GL.Util
lambdacube-gl                    >
lambdacube-gl                    > src\lib\LambdaCube\GL\Util.hs:743:24: error:
lambdacube-gl                    >     Ambiguous occurrence `And'
lambdacube-gl                    >     It could refer to
lambdacube-gl                    >        either `Foreign.And',
lambdacube-gl                    >               imported from `Foreign' at src\lib\LambdaCube\GL\Util.hs:35:1-14
lambdacube-gl                    >               (and originally defined in `Data.Bits')
lambdacube-gl                    >            or `LambdaCube.Core.Type.And',
lambdacube-gl                    >               imported from `LambdaCube.Core.Type' at src\lib\LambdaCube\GL\Util.hs:311:1-27
lambdacube-gl                    >     |
lambdacube-gl                    > 743 | logicOperationToGLType And          = gl_AND
lambdacube-gl                    >     |                        ^^^
lambdacube-gl                    >
lambdacube-gl                    > src\lib\LambdaCube\GL\Util.hs:758:24: error:
lambdacube-gl                    >     Ambiguous occurrence `Xor'
lambdacube-gl                    >     It could refer to
lambdacube-gl                    >        either `Foreign.Xor',
lambdacube-gl                    >               imported from `Foreign' at src\lib\LambdaCube\GL\Util.hs:35:1-14
lambdacube-gl                    >               (and originally defined in `Data.Bits')
lambdacube-gl                    >            or `LambdaCube.Core.Type.Xor',
lambdacube-gl                    >               imported from `LambdaCube.Core.Type' at src\lib\LambdaCube\GL\Util.hs:311:1-27
lambdacube-gl                    >     |
lambdacube-gl                    > 758 | logicOperationToGLType Xor          = gl_XOR
lambdacube-gl                    >     |                        ^^^
FontyFruity                      > [ 7 of 14] Compiling Graphics.Text.TrueType.MaxpTable
FontyFruity                      > [ 8 of 14] Compiling Graphics.Text.TrueType.HorizontalInfo
FontyFruity                      > [ 9 of 14] Compiling Graphics.Text.TrueType.Header
FontyFruity                      > [10 of 14] Compiling Graphics.Text.TrueType.FontType
FontyFruity                      > [11 of 14] Compiling Graphics.Text.TrueType.Internal
FontyFruity                      > [12 of 14] Compiling Graphics.Text.TrueType.FontFolders
FontyFruity                      > [13 of 14] Compiling Graphics.Text.TrueType
FontyFruity                      > [14 of 14] Compiling Graphics.Text.TrueType.Bytecode
FontyFruity                      > copy/register
FontyFruity                      > Installing library in C:\sr\snapshots\564d247a\lib\x86_64-windows-ghc-9.6.3\FontyFruity-0.5.3.5-FO0Uq3XOnM2HMd0VNyZFBo
FontyFruity                      > Registering library for FontyFruity-0.5.3.5..
Progress 59/61

Error: [S-7282]
       Stack failed to execute the build plan.

       While executing the build plan, Stack encountered the error:

       [S-7011]
       While building package lambdacube-gl-0.2.2 (scroll up to its section to see the error) using:
       C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_9p6GVs8J_3.10.1.0_ghc-9.6.3.exe --verbose=1 --builddir=.stack-work\dist\6c8505b4 build --ghc-options " -fdiagnostics-color=always"
       Process exited with code: ExitFailure 1

Xantshmeshnilnon avatar Dec 30 '23 01:12 Xantshmeshnilnon