stack install: Setup.hs: does not exist - haskell

I put stack.exe v0.1.2.2 in one of my PATH dirs, then install ghc-7.8.4 via stack setup.
I trying to install ghc-mod and obtain strange error Setup.hs: does not exist:
stack install ghc-mod
Using resolver: lts-2.21 from global config file: C:\Users\martynov_p\AppData\Roaming\stack\global\stack.yaml
ghc-paths-0.1.0.9: configure
data-default-class-0.0.1: configure
dlist-0.7.1.1: configure
ansi-terminal-0.6.2.1: configure
hscolour-1.22: configure
extra-1.1: configure
mtl-2.1.3.1: configure
cmdargs-0.10.13: configure
Progress: 8/54
-- While building package cmdargs-0.10.13 using:
C:\\Users\\martynov_p\\appdata\\Local\\Programs\\stack\\x86_64-windows\\ghc-7.8.4\\bin\\runhaskell.exe -package=Cabal-1.18.1.5 -clear-package-db -global-package-db -package-db=C:\Users\martynov_p\AppData\Roaming\stack\snapshots\x86_64-windows\lts-2.21\7.8.4\pkgdb\ C:\Users\MARTYN~1\AppData\Local\Temp\stack12088\Setup.hs --builddir=.stack-work\dist\x86_64-windows\Cabal-1.18.1.5\ configure --user --package-db=clear --package-db=global --package-db=C:\Users\martynov_p\AppData\Roaming\stack\snapshots\x86_64-windows\lts-2.21\7.8.4\pkgdb\ --constraint=base==4.7.0.2 --constraint=filepath==1.3.0.2 --constraint=process==1.2.0.0 --constraint=template-haskell==2.9.0.0 --constraint=transformers==0.3.0.0 --libdir=C:\Users\martynov_p\AppData\Roaming\stack\snapshots\x86_64-windows\lts-2.21\7.8.4\lib --bindir=C:\Users\martynov_p\AppData\Roaming\stack\snapshots\x86_64-windows\lts-2.21\7.8.4\bin --datadir=C:\Users\martynov_p\AppData\Roaming\stack\snapshots\x86_64-windows\lts-2.21\7.8.4\share --docdir=C:\Users\martynov_p\AppData\Roaming\stack\snapshots\x86_64-windows\lts-2.21\7.8.4\doc\cmdargs-0.10.13 --htmldir=C:\Users\martynov_p\AppData\Roaming\stack\snapshots\x86_64-windows\lts-2.21\7.8.4\doc\cmdargs-0.10.13 --haddockdir=C:\Users\martynov_p\AppData\Roaming\stack\snapshots\x86_64-windows\lts-2.21\7.8.4\doc\cmdargs-0.10.13
Process exited with code: ExitFailure 1
Logs have been written to: "C:\\Users\\martynov_p\\AppData\\Roaming\\stack\\global\\.stack-work\\logs\\cmdargs-0.10.13.log"
Configuring cmdargs-0.10.13...
Setup.hs: does not exist

This is probably due to a bug in cabal, and is resolved by upgrading your cabal version or switching to a newer stackage resolver. See
https://github.com/haskell/cabal/issues/1733
https://github.com/commercialhaskell/stack/issues/943

Related

Using Build-Tools (Alex) with Stack and GHCjs

I depend on a package that needs alex to build, i also need ghcjs.
When i try to run stack ghci:
language-java-0.2.8: configure (lib)
Error:
-- While building package language-java-0.2.8 using:
<long command>
Process exited with code: ExitFailure 1
Logs have been written to: /Users/LeanderK/Documents/Haskell/exemplator-java_parser/.stack-work/logs/language-java-0.2.8.log
Configuring language-java-0.2.8...
Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9007019_ghc-8.0.1: The program
'alex' version >=3.1.3 is required but it could not be found.
Warning: Build failed, but optimistically launching GHCi anyway
The following GHC options are incompatible with GHCi and have not been passed to it: -threaded
Configuring GHCi with the following packages: exemplator-client
Using main module: 1. Package `exemplator-client' component exe:exemplator-client-exe with main-is file: ..../app/Main.hs
Progress: 1/2<command line>: cannot satisfy -package language-java-0.2.8
(use -v for more information)
I've tried: stack build alex (just returns, don't have any output. Might work), stack install alex (doesn't work).
Output of stack install alex
Couldn't find executable alex in directory .../.stack/snapshots/x86_64-osx/lts-7.19/ghcjs-0.2.1.9007019_ghc-8.0.1/bin/
For reference: This is the cabal file of the dependency, unfortunately only found on github. This is my stack and my cabal file. There is also a reddit discussion that didn't go anywhere.

Stack can't find libgfortran-3.dll when trying to build with hmatrix

I am trying to setup hmatrix on my Windows 10 machine with GHC 8.0.2.
I was following the answer here but when I try to build it says that it cannot find libgfortran-3.dll although I am sure I added it to the bin folder in the BLAS directory.
My code is in here
I run stack build and this is what I get:
hmatrix-0.18.0.0: configure
Progress: 1/2
-- While building package hmatrix-0.18.0.0 using:
C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_1.24.2.0_ghc-8.0.2.exe --builddir=.stack-work\dist\ca59d0ab configure "--with-ghc=C:\\Program Files\\Haskell Platform\\8.0.2\\bin\\ghc.EXE" "--with-ghc-pkg=C:\\Program Files\\Haskell Platform\\8.0.2\\bin\\ghc-pkg.EXE" --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\b201cfe6\pkgdb --package-db=D:\Haskell\networks\.stack-work\install\65995373\pkgdb --libdir=D:\Haskell\networks\.stack-work\install\65995373\lib --bindir=D:\Haskell\networks\.stack-work\install\65995373\bin --datadir=D:\Haskell\networks\.stack-work\install\65995373\share --libexecdir=D:\Haskell\networks\.stack-work\install\65995373\libexec --sysconfdir=D:\Haskell\networks\.stack-work\install\65995373\etc --docdir=D:\Haskell\networks\.stack-work\install\65995373\doc\hmatrix-0.18.0.0 --htmldir=D:\Haskell\networks\.stack-work\install\65995373\doc\hmatrix-0.18.0.0 --haddockdir=D:\Haskell\networks\.stack-work\install\65995373\doc\hmatrix-0.18.0.0 --dependency=array=array-0.5.1.1 --dependency=base=base-4.9.1.0 --dependency=binary=binary-0.8.3.0 --dependency=bytestring=bytestring-0.10.8.1 --dependency=deepseq=deepseq-1.4.2.0 --dependency=random=random-1.1-9tceXaeYIMZ4JrKq20Egog --dependency=split=split-0.2.3.1-FWyXC6nhV0H3AfM8IzrEFk --dependency=storable-complex=storable-complex-0.2.2-G9QzpmZTKvgKKVagrcRWdL --dependency=vector=vector-0.11.0.0-HhutbadagxHIONIkSRJEug -fopenblas --extra-include-dirs=C:\OpenBLAS-v0.2.19-Win64-int32\include --extra-include-dirs=C:\Users\Yotam\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include --extra-lib-dirs=C:\OpenBLAS-v0.2.19-Win64-int32\bin --extra-lib-dirs=C:\Users\Yotam\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib
Process exited with code: ExitFailure 1
Logs have been written to: D:\Haskell\networks\.stack-work\logs\hmatrix-0.18.0.0.log
Configuring hmatrix-0.18.0.0...
Cabal-simple_Z6RU0evB_1.24.2.0_ghc-8.0.2.exe: Missing dependency on a foreign
library:
* Missing C library: libgfortran-3
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
D:\OpenBLAS-v0.2.19-Win64-int32\bin includes both libopenblas.dll and libgfortran-3.dll and the blas directory was taken from this url
Thanks for any help
I've managed to install it as follows.
In yourpath\to\stack\x86_64-windows\msys2-20150512, open a msys2 shell by double-clicking on msys2_shell.bat.
In the shell, type:
pacman -S mingw-w64-x86_64-toolchain
Then add these "extra" in stack.yaml:
extra-include-dirs:
- yourpath\to\OpenBLAS\include
extra-lib-dirs:
- yourpath\to\OpenBLAS\lib
- yourpath\to\stack\x86_64-windows\msys2-20150512\usr\lib\gcc\x86_64-pc-msys\6.3.0
- yourpath\to\stack\x86_64-windows\msys2-20150512\mingw64\bin

'cabal copy' failed during `stack build` in cifs directory

I'm following these instructions. I successfully did stack new and stack setup but stack build fails.
I found a git issue that this may be due to extra files listed in the cabal file, but removing them didn't fix the issue (and I'm just using the new-template without any changes). I am on Ubuntu 14.04 and installed stack using the script. Is there anything else I can look into?
It appears that this might be due to me trying to build inside of a cifs directory. Is there anything I can do to handle this?
# stack build
ehri-haskell-0.1.0.0: configure (lib + exe)
Configuring ehri-haskell-0.1.0.0...
ehri-haskell-0.1.0.0: build (lib + exe)
Preprocessing library ehri-haskell-0.1.0.0...
Preprocessing executable 'ehri-haskell-exe' for ehri-haskell-0.1.0.0...
ehri-haskell-0.1.0.0: copy/register
Installing library in
/mnt/docs/RubymineProjects/ehri-haskell/.stack-work/install/x86_64-linux/lts-8.6/8.0.2/lib/x86_64-linux-ghc-8.0.2/ehri-haskell-0.1.0.0-Kh3VLZPfbij7EgcL22QBMN
Installing executable(s) in
/mnt/docs/RubymineProjects/ehri-haskell/.stack-work/install/x86_64-linux/lts-8.6/8.0.2/bin
/mnt/docs/RubymineProjects/ehri-haskell/.stack-work/install/x86_64-linux/lts-8.6/8.0.2/bin/.copyFile5965166491189641421.tmp:
copyFile: does not exist (Host is down)
'cabal copy' failed. Error message:
-- While building package ehri-haskell-0.1.0.0 using:
/root/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.24.2.0 copy
Process exited with code: ExitFailure 1
One possible cause of this issue is:
* No module named "Main". The 'main-is' source file should usually have a header indicating that it's a 'Main' module.
# stack --version
Version 1.4.0, Git revision e714f1dd3fade19496d91bd6a017e435a96a6bcd (4640 commits) x86_64 hpack-0.17.0
Looks like the issue is caused by the depth of the folder where the project lives (Windows 10, x64). From the moment the depth exceeds some threshold, described error appears. So try moving the project folder up in directories tree.

Error installing the shuffle library with stack

Using stack 1.2.0 and LTS 7.0 I'm getting the following error installing the shuffle library:
$ cabal get shuffle
$ cd shuffle-0.1.3.3
$ stack build
...
/tmp/shuffle-0.1.3.3/Setup.hs:2:1: error:
Failed to load interface for ‘Distribution.Simple.UUAGC’
Perhaps you meant
Distribution.Simple.UHC (from Cabal-1.24.0.0)
Distribution.Simple.GHC (from Cabal-1.24.0.0)
Distribution.Simple.JHC (from Cabal-1.24.0.0)
Use -v to see a list of the files searched for.
/tmp/shuffle-0.1.3.3/Setup.hs:3:1: error:
Failed to load interface for ‘UU.UUAGC’
Use -v to see a list of the files searched for.
-- While building package shuffle-0.1.3.3 using:
/usr/local/bin/ghc --make -odir /tmp/shuffle-0.1.3.3/.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/setup -hidir /tmp/shuffle-0.1.3.3/.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/setup -i -i. -package=Cabal-1.24.0.0 -clear-package-db -global-package-db -package-db=/home/asr/.stack/snapshots/x86_64-linux/lts-7.0/8.0.1/pkgdb /tmp/shuffle-0.1.3.3/Setup.hs -o /tmp/shuffle-0.1.3.3/.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/setup/setup
Process exited with code: ExitFailure 1
I'm using the following stack.yaml file:
resolver: lts-7.0
# Local packages, usually specified by relative directory name
packages:
- '.'
extra-deps:
- logict-state-0.1.0.2
- pqueue-1.3.1.1
- uhc-util-0.1.6.6
- uuagc-0.9.52.1
- uuagc-cabal-1.0.6.0
- uulib-0.9.22
Do I need to add/change something in the library or in stack.yaml? (I had no problems using cabal-install).
I was able to get this to work by adding the following to stack.yaml:
explicit-setup-deps:
shuffle: true
For more information, see: https://docs.haskellstack.org/en/stable/yaml_configuration/#explicit-setup-deps
It appears that this package requires you to have installed uuagc-cabal to build it. Starting after Cabal-1.23 these kinds of package dependencies for Setup.hs files can be captured in the custom-setup section of a cabal file.
There are tickets about this functionality for stack that seem to be interlinked from here:
Setup.hs cannot use local snapshot dependencies WAS stack failing to resolve local dependencies of multiple package project #897

GHC could not execute gcc.exe in Yesod Installation

I followed "Yesod quick start guide" to install Yesod in Windows 10.
But, when I issued the stack build command, it failed.
Environment
Windows 10 (64bits)
stack-0.1.5 (for Windows10 64bits)
No Haskell Platform
I executed these commands
stack new my-project yesod-sqlite && cd my-project
stack install yesod-bin cabal-install --install-ghc
stack setup
stack build <--- the error occured
In 'stack build' command, the package installations were done. But, when it build the project, the error occured.
Command Prompt
>stack build
Setting codepage to UTF-8 (65001) to ensure correct output from GHC
my-project-0.0.0: build
Preprocessing library my-project-0.0.0...
In-place registering my-project-0.0.0...
Preprocessing executable 'my-project' for my-project-0.0.0...
Linking .stack-work\dist\x86_64-windows\Cabal-1.22.4.0\build\my-project\my-project.exe ...
ghc.exe: could not execute: C:\Users\xxxxx\AppData\Local\Programs\stack\x86_64-windows\ghc-7.10.2\lib/../mingw/bin/gcc.exe
-- While building package my-project-0.0.0 using:
C:\Users\xxxxx\AppData\Roaming\local\bin\stack-0.1.5.0\setup-exe-cache\setup-Simple-Cabal-1.22.4.0-x86_64-windows-ghc-7.10.2.exe --builddir=.stack-work\dist\x86_64-windows\Cabal-1.22.4.0\ build lib:my-project exe:my-project --ghc-options -ddump-hi -ddump-to-file
Process exited with code: ExitFailure 1
This is caused by the argument length limit on Windows. Starting in GHC 7.10.3, GHC will support response files for sending linker arguments in order to bypass this limitation. In the meanwhile, a workaround is to manually make the path to your stack root shorter by setting the STACK_ROOT environment variable.
For more information, see https://www.fpcomplete.com/blog/2015/08/stack-ghc-windows

Resources