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 cannot build new project from template #4457

Closed
xenoexplorator opened this issue Dec 22, 2018 · 6 comments
Closed

Stack cannot build new project from template #4457

xenoexplorator opened this issue Dec 22, 2018 · 6 comments

Comments

@xenoexplorator
Copy link

General summary/comments

I'm trying out stack for the first time and I can't build the simple project created by the default template.
I'm working on Windows 10 Home edition.

Steps to reproduce

$ stack new project
$ cd project
$ stack build

Expected

The project is built successfully and the resulting executable can run.

Actual

stack build exits with status code 1 after outputting the following error message:

Building all executables for `project' once. After a successful build of all of them, only specified executables will be rebuilt.
project-0.1.0.0: configure (lib + exe)
Configuring project-0.1.0.0...
project-0.1.0.0: build (lib + exe)
Preprocessing library for project-0.1.0.0..
Building library for project-0.1.0.0..

<command-line>:0:13: error: lexical error (UTF-8 decoding error)


--  While building package client-0.1.0.0 using:
      C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.2.0.1_ghc-8.4.4.exe --builddir=.stack-work\dist\7d103d30 build lib:project exe:project-exe --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1

This error was reproduced in all shells on my machine (cmd.exe, PowerShell and GitBash).

Stack version

Stack version is 1.9.3, GCC version is 8.4.4

Method of installation

Stack was installed using the Windows 64-bit installer.

@contrerasmiguel
Copy link

I'm experiencing the same issue on an empty project.

SO: Windows 7 Professional (64-bit).
Stack version: 1.9.3

I also received a similar error while trying to execute:

stack install intero QuickCheck stack-run

Output:

base-orphans-0.8: configure
base-orphans-0.8: build
call-stack-0.1.0: configure
call-stack-0.1.0: build
blaze-builder-0.4.1.0: configure
blaze-builder-0.4.1.0: build
Cabal-2.4.1.0: configure
Cabal-2.4.1.0: build
Progress 4/43

--  While building package Cabal-2.4.1.0 using:
      C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.4.0.1_ghc-8.6                                                                                                                .3.exe --builddir=.stack-work\dist\e626a42b build --ghc-options " -ddump-hi -ddu                                                                                                                mp-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
    Logs have been written to: C:\sr\global-project\.stack-work\logs\Cabal-2.4.1                                                                                                                .0.log

    Configuring Cabal-2.4.1.0...
    Preprocessing library for Cabal-2.4.1.0..
    Building library for Cabal-2.4.1.0..

    <command-line>:0:23: error: lexical error (UTF-8 decoding error)



--  While building package blaze-builder-0.4.1.0 using:
      C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.4.0.1_ghc-8.6                                                                                                                .3.exe --builddir=.stack-work\dist\e626a42b build --ghc-options " -ddump-hi -ddu                                                                                                                mp-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
    Logs have been written to: C:\sr\global-project\.stack-work\logs\blaze-build                                                                                                                er-0.4.1.0.log

    Configuring blaze-builder-0.4.1.0...
    Preprocessing library for blaze-builder-0.4.1.0..
    Building library for blaze-builder-0.4.1.0..

    <command-line>:0:23: error: lexical error (UTF-8 decoding error)



--  While building package call-stack-0.1.0 using:
      C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.4.0.1_ghc-8.6                                                                                                                .3.exe --builddir=.stack-work\dist\e626a42b build --ghc-options " -ddump-hi -ddu                                                                                                                mp-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
    Logs have been written to: C:\sr\global-project\.stack-work\logs\call-stack-                                                                                                                0.1.0.log

    Configuring call-stack-0.1.0...
    Preprocessing library for call-stack-0.1.0..
    Building library for call-stack-0.1.0..

    <command-line>:0:23: error: lexical error (UTF-8 decoding error)



--  While building package base-orphans-0.8 using:
      C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.4.0.1_ghc-8.6                                                                                                                .3.exe --builddir=.stack-work\dist\e626a42b build --ghc-options " -ddump-hi -ddu                                                                                                                mp-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
    Logs have been written to: C:\sr\global-project\.stack-work\logs\base-orphan                                                                                                                s-0.8.log

    Configuring base-orphans-0.8...
    Preprocessing library for base-orphans-0.8..
    Building library for base-orphans-0.8..

    <command-line>:0:23: error: lexical error (UTF-8 decoding error)

@dbaynard
Copy link
Contributor

Hello. That error message is not coming from stack but from the underlying program. There has been some discussion of that particular error message online; typically it is associated with CPP errors (e.g. haskell/cabal#912).

It would be helpful to see the actual logs — would you be able to paste one here?

@contrerasmiguel
Copy link

Hello. That error message is not coming from stack but from the underlying program. There has been some discussion of that particular error message online; typically it is associated with CPP errors (e.g. haskell/cabal#912).

It would be helpful to see the actual logs — would you be able to paste one here?

$ stack -v install intero QuickCheck stack-run:

https://pastebin.com/D58Jh3A6

C:\sr\global-project.stack-work\logs\Cabal-2.4.1.0.log:

Configuring Cabal-2.4.1.0...
Preprocessing library for Cabal-2.4.1.0..
Building library for Cabal-2.4.1.0..

�[;1m<command-line>:0:23: �[;1m�[31merror:�[0m�[0m�[;1m�[0m�[0m�[;1m lexical error (UTF-8 decoding error)�[0m�[0m
�[0m�[0m�[0m

C:\sr\global-project.stack-work\logs\blaze-builder-0.4.1.0.log:

Configuring blaze-builder-0.4.1.0...
Preprocessing library for blaze-builder-0.4.1.0..
Building library for blaze-builder-0.4.1.0..

�[;1m<command-line>:0:23: �[;1m�[31merror:�[0m�[0m�[;1m�[0m�[0m�[;1m lexical error (UTF-8 decoding error)�[0m�[0m
�[0m�[0m�[0m

C:\sr\global-project.stack-work\logs\base-orphans-0.8.log:

Configuring base-orphans-0.8...
Preprocessing library for base-orphans-0.8..
Building library for base-orphans-0.8..

�[;1m<command-line>:0:23: �[;1m�[31merror:�[0m�[0m�[;1m�[0m�[0m�[;1m lexical error (UTF-8 decoding error)�[0m�[0m
�[0m�[0m�[0m

C:\sr\global-project.stack-work\logs\call-stack-0.1.0.log:

Configuring call-stack-0.1.0...
Preprocessing library for call-stack-0.1.0..
Building library for call-stack-0.1.0..

�[;1m<command-line>:0:23: �[;1m�[31merror:�[0m�[0m�[;1m�[0m�[0m�[;1m lexical error (UTF-8 decoding error)�[0m�[0m
�[0m�[0m�[0m

@dbaynard
Copy link
Contributor

Ah, I think I see the problem — it may be related to #4443 (and haskell/cabal#5795).

The C:\Users\Miguel Andr▒s lines indicate you have non-ascii characters on your path (I only noticed because it breaks pastebin). Would you try running this as a different user, or with a different base path?


Also, those symbols in the output are slightly worrying. I know you've said you use stack 1.9.3, but would you mind pasting the output of stack --version? This was in issue that was meant to be fixed in 1.9.

@contrerasmiguel
Copy link

contrerasmiguel commented Jan 16, 2019

Ah, I think I see the problem — it may be related to #4443 (and haskell/cabal#5795).

The C:\Users\Miguel Andr▒s lines indicate you have non-ascii characters on your path (I only noticed because it breaks pastebin). Would you try running this as a different user, or with a different base path?

Also, those symbols in the output are slightly worrying. I know you've said you use stack 1.9.3, but would you mind pasting the output of stack --version? This was in issue that was meant to be fixed in 1.9.

Sorry about the late answer.

I tried running it from C:\ and it did not work because it kept running scripts from a directory that's on my user account's path. However, running it from another user called "dummy" did work. Thanks for your help.

About the version:

$ stack --version
Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1

@dbaynard
Copy link
Contributor

Don't know why I tagged it FreeBSD…

Anyway, tldr non-ascii paths cause problems with GHC on windows.

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

No branches or pull requests

3 participants