rikvdkleij / intellij-haskell

IntelliJ plugin for Haskell
https://rikvdkleij.github.io/intellij-haskell/
Apache License 2.0
1.31k stars 94 forks source link

Creation of new project fails #503

Closed mnn closed 4 years ago

mnn commented 4 years ago

There is something wrong with --stack-root path:

null\rikvdkleij\intellij-haskell\cache\lts-13
...
option --stack-root: InvalidAbsDir "null\\rikvdkleij\\intellij-haskell\\cache\\lts-13"
28/01/2020
21:31   Executing `C:/Users/Xxx/AppData/Roaming/local/bin/stack.exe --system-ghc -j1 --stack-root null\rikvdkleij\intellij-haskell\cache\lts-13 --resolver lts-13 --local-bin-path null\rikvdkleij\intellij-haskell\cache\lts-13\bin install hlint` failed: C:/Users/Xxx/AppData/Roaming/local/bin/stack.exe --system-ghc -j1 --stack-root null\rikvdkleij\intellij-haskell\cache\lts-13 --resolver lts-13 --local-bin-path null\rikvdkleij\intellij-haskell\cache\lts-13\bin install hlint:
            option --stack-root: InvalidAbsDir "null\\rikvdkleij\\intellij-haskell\\cache\\lts-13"
            Usage: stack.exe [--help] [--version] [--numeric-version]
            [--hpack-numeric-version] [--docker*] [--nix*]
            ([--verbosity VERBOSITY] | [-v|--verbose] | [--silent])
            [--[no-]time-in-log] [--stack-root STACK-ROOT]
            [--work-dir WORK-DIR] [--[no-]system-ghc] [--[no-]install-ghc]
            [--arch ARCH] [--ghc-variant VARIANT] [--ghc-build BUILD]
            ... (show balloon)

21:31   Executing `C:/Users/Xxx/AppData/Roaming/local/bin/stack.exe --system-ghc -j1 --stack-root null\rikvdkleij\intellij-haskell\cache\lts-13 --resolver lts-13 --local-bin-path null\rikvdkleij\intellij-haskell\cache\lts-13\bin install hoogle` failed: C:/Users/Xxx/AppData/Roaming/local/bin/stack.exe --system-ghc -j1 --stack-root null\rikvdkleij\intellij-haskell\cache\lts-13 --resolver lts-13 --local-bin-path null\rikvdkleij\intellij-haskell\cache\lts-13\bin install hoogle:
            option --stack-root: InvalidAbsDir "null\\rikvdkleij\\intellij-haskell\\cache\\lts-13"
            Usage: stack.exe [--help] [--version] [--numeric-version]
            [--hpack-numeric-version] [--docker*] [--nix*]
            ([--verbosity VERBOSITY] | [-v|--verbose] | [--silent])
            [--[no-]time-in-log] [--stack-root STACK-ROOT]
            [--work-dir WORK-DIR] [--[no-]system-ghc] [--[no-]install-ghc]
            [--arch ARCH] [--ghc-variant VARIANT] [--ghc-build BUILD]
            ... (show balloon)

21:31   Executing `C:/Users/Xxx/AppData/Roaming/local/bin/stack.exe --system-ghc -j1 --stack-root null\rikvdkleij\intellij-haskell\cache\lts-13 --resolver lts-13 --local-bin-path null\rikvdkleij\intellij-haskell\cache\lts-13\bin install stylish-haskell` failed: C:/Users/Xxx/AppData/Roaming/local/bin/stack.exe --system-ghc -j1 --stack-root null\rikvdkleij\intellij-haskell\cache\lts-13 --resolver lts-13 --local-bin-path null\rikvdkleij\intellij-haskell\cache\lts-13\bin install stylish-haskell:
            option --stack-root: InvalidAbsDir "null\\rikvdkleij\\intellij-haskell\\cache\\lts-13"
            Usage: stack.exe [--help] [--version] [--numeric-version]
            [--hpack-numeric-version] [--docker*] [--nix*]
            ([--verbosity VERBOSITY] | [-v|--verbose] | [--silent])
            [--[no-]time-in-log] [--stack-root STACK-ROOT]
            [--work-dir WORK-DIR] [--[no-]system-ghc] [--[no-]install-ghc]
            [--arch ARCH] [--ghc-variant VARIANT] [--ghc-build BUI... (show balloon)

21:31   Executing `C:/Users/Xxx/AppData/Roaming/local/bin/stack.exe --system-ghc -j1 --stack-root null\rikvdkleij\intellij-haskell\cache\lts-13 --resolver lts-13 --local-bin-path null\rikvdkleij\intellij-haskell\cache\lts-13\bin install hindent` failed: C:/Users/Xxx/AppData/Roaming/local/bin/stack.exe --system-ghc -j1 --stack-root null\rikvdkleij\intellij-haskell\cache\lts-13 --resolver lts-13 --local-bin-path null\rikvdkleij\intellij-haskell\cache\lts-13\bin install hindent:
            option --stack-root: InvalidAbsDir "null\\rikvdkleij\\intellij-haskell\\cache\\lts-13"
            Usage: stack.exe [--help] [--version] [--numeric-version]
            [--hpack-numeric-version] [--docker*] [--nix*]
            ([--verbosity VERBOSITY] | [-v|--verbose] | [--silent])
            [--[no-]time-in-log] [--stack-root STACK-ROOT]
            [--work-dir WORK-DIR] [--[no-]system-ghc] [--[no-]install-ghc]
            [--arch ARCH] [--ghc-variant VARIANT] [--ghc-build BUILD]
            ... (show balloon)

Windows 10, plugin beta57

rikvdkleij commented 4 years ago

Thanks for reporting!

Looks like a bug in https://github.com/soc/directories-jvm. That directory which starts with null is obtained via this library.

mnn commented 4 years ago

You are right, it looks like this issue. It seems some JDK changes are responsible.

Maybe try the suggested workaround?

Calling System.setProperty("jdk.lang.Process.allowAmbiguousCommands", "true") before the calls to directories-jvm seems to fix the issue \o/

mnn commented 4 years ago

After some stumbling I managed to build the master and the null path issue seems to be fixed. Unfortunately we (I am helping a friend with Windows) only got one step further. Project looks to be created (directory structure, few hs files), but the plugin (or other tool ran by the plugin) has some problem with running the compiler.

Messages panel:

Error:Found an invalid compiler at "C:\\Users\\Xxx\\AppData\\Local\\Programs\\stack\\x86_64-windows\\ghc-8.6.5\\bin\\ghc-8.6.5.EXE": Received ExitFailure 1 when running

Event log panel:

04/02/2020
08:33   Project won't be built because building its dependencies failed

08:33   [global-stack-repl] Stack REPL couldn't be started within 30 seconds

08:33   [global-stack-repl] stty: 'standard input': Inappropriate ioctl for device

08:34   [project-stack-repl-Haskell-playground:lib] Stack REPL couldn't be started within 30 seconds

08:34   [project-stack-repl-Haskell-playground:lib] stty: 'standard input': Inappropriate ioctl for device

08:34   [global-stack-repl] Stack REPL couldn't be started within 30 seconds

08:34   [global-stack-repl] stty: 'standard input': Inappropriate ioctl for device

08:34   [global-stack-repl] Stack REPL couldn't be started within 30 seconds

08:34   [global-stack-repl] stty: 'standard input': Inappropriate ioctl for device

08:34   Executing `ghc-pkg dump` failed

08:34   Hoogle database doesn't exist. Hoogle features can be enabled by menu option `Haskell`/`(Re)Build Hoogle database`

08:34   [global-stack-repl] Stack REPL couldn't be started within 30 seconds

08:34   [global-stack-repl] stty: 'standard input': Inappropriate ioctl for device

08:34   [global-stack-repl] Stack REPL couldn't be started within 30 seconds

08:34   [global-stack-repl] stty: 'standard input': Inappropriate ioctl for device

Interestingly, the binary file exists and looks fine (as in returns expected output when run with --version). I noticed the error message states a file extension as upper case, but in Total Commander it was in lower case. It shouldn't matter on Windows, unless something is expecting fs to be case-sensitive.

Any ideas what to try next?

rikvdkleij commented 4 years ago

Maybe this issue helps https://github.com/rikvdkleij/intellij-haskell/issues/450

rikvdkleij commented 4 years ago

Please reopen if still an issue.