flycheck / flycheck-haskell

Improved Haskell support for Flycheck
GNU General Public License v3.0
67 stars 25 forks source link

`flycheck-haskell-setup` signals error on Windows #102

Closed sheepduke closed 4 years ago

sheepduke commented 4 years ago

Overview

I am using flycheck-haskell on Windows Emacs.

While calling (flycheck-haskell-setup), it enters debugger with the following trace:

Debugger entered--Lisp error: (error "Invalid escape character syntax")
  read(#<buffer  *temp*-372678>)
  flycheck-haskell--read-configuration-with-helper(("d:/Software/Stack/stack.exe" "--verbosity" "silent" "runghc" "--no-ghc-package-path" "--" "-i" "-packageCabal" "-packagebase" "-packagebytestring" "-packagecontainers" "-packageprocess" "-packagedirectory" "-packagefilepath" "d:/Home/.emacs.d/elpa/flycheck-haskell-20190907.2035/get-cabal-configuration.hs" "--cabal-file" "d:/Home/projects/haskell/Hello/Hello.cabal"))
  flycheck-haskell-read-cabal-configuration("d:/Home/projects/haskell/Hello/Hello.cabal")
  flycheck-haskell-read-and-cache-configuration("d:/Home/projects/haskell/Hello/Hello.cabal")
  flycheck-haskell-get-configuration("d:/Home/projects/haskell/Hello/Hello.cabal")
  flycheck-haskell-configure()
  flycheck-haskell-setup()
  eval((flycheck-haskell-setup) nil)
  eval-expression((flycheck-haskell-setup) nil nil 127)
  funcall-interactively(eval-expression (flycheck-haskell-setup) nil nil 127)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

Environment

Emacs version: GNU Emacs 26.3 (build 1, x86_64-w64-mingw32) of 2019-08-29

flycheck-haskell version: 20190907.2035

sergv commented 4 years ago

Thanks for reporting! Could you please share the contents of the d:/Home/projects/haskell/Hello/Hello.cabal file you experience the problem with?

sheepduke commented 4 years ago

It is automatically generated by Stack.

You may try to reproduce it using a project newly created using Stack.

The following is my Hello.cabal file:

cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.31.2.
--
-- see: https://github.com/sol/hpack
--
-- hash: 5456e70a8c95766c0508c54cd50a5d1477de0a486fc1581951be941921a46185

name:           Hello
version:        0.1.0.0
description:    Please see the README on GitHub at <https://github.com/githubuser/Hello#readme>
homepage:       https://github.com/githubuser/Hello#readme
bug-reports:    https://github.com/githubuser/Hello/issues
author:         Author name here
maintainer:     example@example.com
copyright:      2020 Author name here
license:        BSD3
license-file:   LICENSE
build-type:     Simple
extra-source-files:
    README.md
    ChangeLog.md

source-repository head
  type: git
  location: https://github.com/githubuser/Hello

library
  exposed-modules:
      Lib
  other-modules:
      Paths_Hello
  hs-source-dirs:
      src
  build-depends:
      base >=4.7 && <5
  default-language: Haskell2010

executable Hello-exe
  main-is: Main.hs
  other-modules:
      Paths_Hello
  hs-source-dirs:
      app
  ghc-options: -threaded -rtsopts -with-rtsopts=-N
  build-depends:
      Hello
    , base >=4.7 && <5
  default-language: Haskell2010

test-suite Hello-test
  type: exitcode-stdio-1.0
  main-is: Spec.hs
  other-modules:
      Paths_Hello
  hs-source-dirs:
      test
  ghc-options: -threaded -rtsopts -with-rtsopts=-N
  build-depends:
      Hello
    , base >=4.7 && <5
  default-language: Haskell2010
sergv commented 4 years ago

I think I fixed this, please give it a spin.

sheepduke commented 4 years ago

Confirmed. Thank you.