HSlice icon indicating copy to clipboard operation
HSlice copied to clipboard

can't compile extcuraengine

Open l29ah opened this issue 3 years ago • 5 comments

ghc-8.10.1 and implicitcad from git here

Building executable 'extcuraengine' for hslice-0.0.1..
[1 of 1] Compiling Main             ( programs/extcuraengine.hs, /tmp/hslice/dist-newstyle/build/x86_64-linux/ghc-8.10.1/hslice-0.0.1/x/extcuraengine/build/extcuraengine/extcuraengine-tmp/Main.o )

programs/extcuraengine.hs:438:29: error:
    • Couldn't match expected type ‘IO (VarLookup, b0)’
                  with actual type ‘Bool
                                    -> IO
                                         (VarLookup,
                                          [Graphics.Implicit.ExtOpenScad.Definitions.Message])’
    • In a stmt of a 'do' block:
        (settings, messages) <- addConstants $ settingOpts args
      In the expression:
        do let args = rawArgs
               inFile = fromMaybe "in.stl" $ inputFileOpt args
           stl <- readFile inFile
           (settings, messages) <- addConstants $ settingOpts args
           let printer = printerFromSettings settings
               buildarea = buildArea printer
               ....
           ....
      In an equation for ‘run’:
          run rawArgs
            = do let args = ...
                     ....
                 stl <- readFile inFile
                 (settings, messages) <- addConstants $ settingOpts args
                 ....
            where
                printerFromSettings :: VarLookup -> Printer
                printerFromSettings vars
                  = Printer
                      (getPrintBed vars) (defaultBuildArea vars) (defaultExtruder vars)
                  where
                      maybeX (lookupVarIn "machine_width" -> Just (ONum width))
                        = Just width
                      maybeX _ = Nothing
                      maybeY (lookupVarIn "machine_depth" -> Just (ONum depth))
                        = Just depth
                      maybeY _ = Nothing
                      ....
                printFromSettings :: VarLookup -> Print
                printFromSettings vars
                  = Print
                      (fromMaybe 2 $ maybeWallLineCount vars)
                      (fromMaybe 1 $ maybeInfillAmount vars)
                      (fromMaybe 0.2 $ maybeLayerHeight vars)
                      (fromMaybe 0.8 $ maybeTopBottomThickness vars)
                      (fromMaybe False $ maybeSupport vars)
                      (fromMaybe 0.6 $ maybeInfillLineWidth vars)
                      (fromMaybe False $ maybeOuterWallBeforeInner vars)
                      (fromMaybe 60 $ maybeInfillSpeed vars)
                  where
                      maybeLayerHeight
                        (lookupVarIn "layer_height" -> Just (ONum thickness))
                        = Just thickness
                      maybeLayerHeight _ = Nothing
                      maybeInfillAmount
                        (lookupVarIn "infill_sparse_density" -> Just (ONum amount))
                        = Just (amount / 100)
                      maybeInfillAmount _ = Nothing
                      ....
                ....
    |
438 |     (settings, messages) <- addConstants $ settingOpts args
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

programs/extcuraengine.hs:516:101: error:
    • Couldn't match type ‘text-1.2.3.2:Data.Text.Internal.Lazy.Text’
                     with ‘[ghc-prim-0.6.1:GHC.Types.Char]’
      Expected type: String
        Actual type: text-1.2.3.2:Data.Text.Internal.Lazy.Text
    • In the first argument of ‘fromString’, namely ‘startGCode’
      In the expression: fromString startGCode
      In an equation for ‘startingGCode’:
          startingGCode
            (lookupVarIn "machine_start_gcode" -> Just (OString startGCode))
            = fromString startGCode
    |
516 |         startingGCode (lookupVarIn "machine_start_gcode" -> Just (OString startGCode)) = fromString startGCode
    |                                                                                                     ^^^^^^^^^^

programs/extcuraengine.hs:532:95: error:
    • Couldn't match type ‘text-1.2.3.2:Data.Text.Internal.Lazy.Text’
                     with ‘[ghc-prim-0.6.1:GHC.Types.Char]’
      Expected type: String
        Actual type: text-1.2.3.2:Data.Text.Internal.Lazy.Text
    • In the first argument of ‘fromString’, namely ‘endGCode’
      In the expression: fromString endGCode
      In an equation for ‘endingGCode’:
          endingGCode
            (lookupVarIn "machine_end_gcode" -> Just (OString endGCode))
            = fromString endGCode
    |
532 |         endingGCode (lookupVarIn "machine_end_gcode" -> Just (OString endGCode)) = fromString endGCode
    |                                                                                               ^^^^^^^^

l29ah avatar Jul 08 '20 02:07 l29ah