stack-run icon indicating copy to clipboard operation
stack-run copied to clipboard

stack-run-0.1.1.4 failing to build on linux ghc 8.2

Open intronic opened this issue 7 years ago • 6 comments

Hi,

stack install stack-run fails for me with ghc 8.2.2, and its also not building with 8.2 for any version of stack-run apparently:

https://matrix.hackage.haskell.org/package/stack-run

cheers

intronic avatar Feb 20 '18 22:02 intronic

Also fails for me on macOS High Sierra version 10.13.3.

Log file:

Configuring stack-run-0.1.1.4... Preprocessing executable 'stack-run' for stack-run-0.1.1.4.. Building executable 'stack-run' for stack-run-0.1.1.4..

[;1munix/System/Console/Questioner.hs:4:14: [;1m[35mwarning:[0m[0m[;1m[0m[0m[;1m -XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS[0m[0m [;1m[34m |[0m[0m [;1m[34m4 |[0m[0m {-# LANGUAGE [;1m[35mOverlappingInstances[0m[0m #-} [;1m[34m |[0m[0m[;1m[35m ^^^^^^^^^^^^^^^^^^^^[0m[0m [0m[0m[0m[1 of 5] Compiling System.Console.Questioner.Autocomplete ( unix/System/Console/Questioner/Autocomplete.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/stack-run/stack-run-tmp/System/Console/Questioner/Autocomplete.o ) [2 of 5] Compiling System.Console.Questioner.Util ( unix/System/Console/Questioner/Util.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/stack-run/stack-run-tmp/System/Console/Questioner/Util.o ) [3 of 5] Compiling System.Console.Questioner.ProgressIndicators ( unix/System/Console/Questioner/ProgressIndicators.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/stack-run/stack-run-tmp/System/Console/Questioner/ProgressIndicators.o ) [4 of 5] Compiling System.Console.Questioner ( unix/System/Console/Questioner.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/stack-run/stack-run-tmp/System/Console/Questioner.o ) [5 of 5] Compiling Main ( src/Main.hs, .stack-work/dist/x86_64-osx/Cabal-2.0.1.0/build/stack-run/stack-run-tmp/Main.o )

[;1msrc/Main.hs:63:15: [;1m[31merror:[0m[0m[;1m[0m[0m[;1m • Couldn't match type ‘Distribution.Types.UnqualComponentName.UnqualComponentName’ with ‘[Char]’ Expected type: IO String Actual type: IO Distribution.Types.UnqualComponentName.UnqualComponentName • In the expression: findDefault' pr In a stmt of a 'do' block: if e then readFile (pr </> ".stack-work" </> ".stack-run-default") else findDefault' pr In the expression: do pr <- fromMaybe (error "No project root found") <$> getCabalProjectRootCurrent e <- doesFileExist (pr </> ".stack-work" </> ".stack-run-default") if e then readFile (pr </> ".stack-work" </> ".stack-run-default") else findDefault' pr[0m[0m [;1m[34m |[0m[0m [;1m[34m63 |[0m[0m else [;1m[31mfindDefault' pr[0m[0m [;1m[34m |[0m[0m[;1m[31m ^^^^^^^^^^^^^^^[0m[0m [0m[0m[0m [;1msrc/Main.hs:84:5: [;1m[31merror:[0m[0m[;1m[0m[0m[;1m • Couldn't match type ‘Distribution.Types.UnqualComponentName.UnqualComponentName’ with ‘[Char]’ Expected type: IO [String] Actual type: IO [Distribution.Types.UnqualComponentName.UnqualComponentName] • In a stmt of a 'do' block: return $ getExecutables pkgParseResult In the expression: do pr <- fromMaybe (error "No project root found") <$> getCabalProjectRootCurrent cfp <- fromMaybe (error "No cabal file found") <$> (find ((== ".cabal") . takeExtension) <$> getDirectoryContents pr) pkgParseResult <- getPackageDescription (pr </> cfp) return $ getExecutables pkgParseResult In an equation for ‘getExecutables’: getExecutables = do pr <- fromMaybe (error "No project root found") <$> getCabalProjectRootCurrent cfp <- fromMaybe (error "No cabal file found") <$> (find ((== ".cabal") . takeExtension) <$> getDirectoryContents pr) pkgParseResult <- getPackageDescription (pr </> cfp) .... where getPackageDescription p = parsePackageDescription <$> readFile p getExecutables (ParseFailed _) = error "Failed to parse cabal file" getExecutables (ParseOk _ gpd) = case condExecutables gpd of [] -> error "No executables found" ds -> map fst ds[0m[0m [;1m[34m |[0m[0m [;1m[34m84 |[0m[0m [;1m[31mreturn $ getExecutables pkgParseResult[0m[0m [;1m[34m |[0m[0m[;1m[31m ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^[0m[0m [0m[0m[0m

 

simax avatar Mar 23 '18 11:03 simax

This fails both on my Windows 10 Pro box and on my Ubuntu 17.10 box with the above mentioned error.

mattias avatar Apr 04 '18 06:04 mattias

I second this, can't get stack-run to build globally with ghc8.2.2

[5 of 5] Compiling Main             ( src/Main.hs, .stack-work/dist/x86_64-linux-nopie/Cabal-2.0.1.0/build/stack-run/stack-run-tmp/Main.o )

/tmp/stack16388/stack-run-0.1.1.4/src/Main.hs:63:15: error:
    * Couldn't match type `Distribution.Types.UnqualComponentName.UnqualComponentName'
                     with `[Char]'
      Expected type: IO String
        Actual type: IO
                       Distribution.Types.UnqualComponentName.UnqualComponentName
    * In the expression: findDefault' pr
      In a stmt of a 'do' block:
        if e then
            readFile (pr </> ".stack-work" </> ".stack-run-default")
        else
            findDefault' pr
      In the expression:
        do pr <- fromMaybe (error "No project root found")
                   <$> getCabalProjectRootCurrent
           e <- doesFileExist (pr </> ".stack-work" </> ".stack-run-default")
           if e then
               readFile (pr </> ".stack-work" </> ".stack-run-default")
           else
               findDefault' pr
   |
63 |          else findDefault' pr
   |               ^^^^^^^^^^^^^^^

/tmp/stack16388/stack-run-0.1.1.4/src/Main.hs:84:5: error:
    * Couldn't match type `Distribution.Types.UnqualComponentName.UnqualComponentName'
                     with `[Char]'
      Expected type: IO [String]
        Actual type: IO
                       [Distribution.Types.UnqualComponentName.UnqualComponentName]
    * In a stmt of a 'do' block: return $ getExecutables pkgParseResult
      In the expression:
        do pr <- fromMaybe (error "No project root found")
                   <$> getCabalProjectRootCurrent
           cfp <- fromMaybe (error "No cabal file found")
                    <$>
                      (find ((== ".cabal") . takeExtension) <$> getDirectoryContents pr)
           pkgParseResult <- getPackageDescription (pr </> cfp)
           return $ getExecutables pkgParseResult
      In an equation for `getExecutables':
          getExecutables
            = do pr <- fromMaybe (error "No project root found")
                         <$> getCabalProjectRootCurrent
                 cfp <- fromMaybe (error "No cabal file found")
                          <$>
                            (find ((== ".cabal") . takeExtension) <$> getDirectoryContents pr)
                 pkgParseResult <- getPackageDescription (pr </> cfp)
                 ....
            where
                getPackageDescription p = parsePackageDescription <$> readFile p
                getExecutables (ParseFailed _) = error "Failed to parse cabal file"
                getExecutables (ParseOk _ gpd)
                  = case condExecutables gpd of
                      [] -> error "No executables found"
                      ds -> map fst ds
   |
84 |     return $ getExecutables pkgParseResult

gcholette avatar Apr 18 '18 16:04 gcholette

I have the same problem building QuickCheck while trying to install intero for what it's wort, I had to run sudo apt-get install libncurses-dev to fix earlier errors.

dougfort@pop-os:~$ stack install QuickCheck stack-run
stack-run-0.1.1.4: configure
stack-run-0.1.1.4: build

--  While building custom Setup.hs for package stack-run-0.1.1.4 using:
      /home/dougfort/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.0.1.0 build --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/dougfort/.stack/global-project/.stack-work/logs/stack-run-0.1.1.4.log

    Configuring stack-run-0.1.1.4...
    Preprocessing executable 'stack-run' for stack-run-0.1.1.4..
    Building executable 'stack-run' for stack-run-0.1.1.4..

dougfort avatar May 26 '18 14:05 dougfort

fyi, or if anyone finds this thread, I found a workaround that works on macos at least: https://github.com/yamadapc/stack-run/issues/17#issuecomment-427545735

XertroV avatar Oct 06 '18 04:10 XertroV

Please check if pull request #22 fixes your problem.

Magicloud avatar Feb 26 '19 15:02 Magicloud