Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
intronic opened this issue Feb 20, 2018 · 6 comments
Open

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

intronic opened this issue Feb 20, 2018 · 6 comments

Comments

@intronic
Copy link

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

@simax
Copy link

simax commented Mar 23, 2018

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

 

@mattias
Copy link

mattias commented Apr 4, 2018

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

@gcholette
Copy link

gcholette commented Apr 18, 2018

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

@dougfort
Copy link

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..

@XertroV
Copy link

XertroV commented Oct 6, 2018

fyi, or if anyone finds this thread, I found a workaround that works on macos at least: #17 (comment)

@Magicloud
Copy link

Please check if pull request #22 fixes your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants