So I suppose the problem I'm really trying to solve is that when I run ghc-mod I get this error:
CabalHelper/Licenses.hs|53 col 18 error| error: Ambiguous occurrence ‘lookupInstalledPackageId’
I found this relevant issue:
https://github.com/DanielG/ghc-mod/issues/772
Where it suggests installing ghc-mod from github,
I'd like to do everything via stack if possible (just to avoid mixing too many environments), but I couldn't find a way to specify either a version or how to specify a github repo with stack install.
I also continually run into errors from stack saying that it found version x when version y was required, but I can't seem to figure out how to get it to install version x anyways.
Anyone know how I can install the latest version of ghc-mod? Preferably with stack.
This was implemented recently. https://github.com/commercialhaskell/stack/issues/2028
Just use:
stack install ghc-mod-5.0.0
or any other version you like.
Related
I am currently trying to install stack to utilise the software Taiji. I have been able to run 'stack setup', but get an error when I run stack install:
C:\Users\My Name\Taiji-1.2.1>stack install
Error: While constructing the build plan, the following exceptions were encountered:
In the dependencies for shelly-1.8.1:
unix needed, but the stack configuration has no specified version (latest matching version is 2.7.2.2)
needed due to Taiji-1.2.1 -> shelly-1.8.1
Some different approaches to resolving this:
* Recommended action: try adding the following to your extra-deps in C:\Users\My Name\Taiji-1.2.1\stack.yaml:
- unix-2.7.2.2#sha256:9e93f93cc5a065248120136e83a0a6d1ce93d6eb5ef2a2543f9593e93e164d24,3496
Plan construction failed.
I am guessing I'll have to install another package of some sort and put it into the Taiji-1.2.1 folder, but am not exactly sure how(I am completely new to stack/programming). Is anyone able to help me with this issue? Thanks kindly.
When you see this error, you will need to open stack.yaml (the error message contains the full path), find the line saying # extra-deps: [], and replace it with the line shown in the error message:
extra-deps:
- unix-2.7.2.2#sha256:9e93f93cc5a065248120136e83a0a6d1ce93d6eb5ef2a2543f9593e93e164d24,3496
(If you already have something listed in extra-deps, then you can just add that line to the end of extra-deps rather than replacing the whole thing.)
Now, this is usually enough. But you’ve got a further problem: you are using Windows, but you’re trying to compile a program which depends on the unix package — a package which is not available on Windows. Due to this, you will not be able to compile your program on Windows.
(As for why all that extra-deps stuff is needed: basically, Stack maintains a list of package versions known to work with each other, but occasionally you will run into a package which isn’t in that list. In that case you will need to list that package version in extra-deps to tell Stack which version to use.)
In my Haskell project when I stack run, it is showing the following, but still runs. What warning is this? How can I get rid of it?
Stack has not been tested with GHC versions above 8.6, and using 8.8.2, this may fail
Stack has not been tested with Cabal versions above 2.4, but version 3.0.1.0 was found, this may fail
This is just a compatibility warning. The next stack version should be tested with GHC 8.8 and this warning should be gone. Until then there's probably little you can do unless you want to modify the source.
As the others said, this can be most likely be ignored. If you want to be on the super-safe side, edit your stack.yaml and downgrade the resolver back to 14.x (latest at this point is 14.27).
You can specify a resolver when creating a project to get rid of this warning:
stack new hello-world simple --resolver=lts-14.27
This may cause other warnings you actually care about to be suppressed, but if you run stack --verbosity error or stack --silent you won't see these warnings. For example
stack --verbosity error exec <your program>
I've been trying to build my Haskell project for the last couple days using stack and I'm getting an access violation error. From what I understand I have the latest stack version and GHC.
This was all originally working until I added a library to my cabal file. I've now removed it but the error still occurs. I've also reverted back to when my code was definitely working so I'm sure this is something caused by stack.
I've tried uninstalling stack, deleting .stack-work and reinstalling. Then doing a stack setup. I've tried many variations of commands but no results.
I've now also tried creating a new project with Stack and building it and I get the same issue.
stack build
Building all executables for `haskell-project' once. After a successful build of all of them, only specified executables will be rebuilt.
haskell-project-0.1.0.0: configure (exe)
Access violation in generated code when reading 000000000e58391a
-- While building custom Setup.hs for package haskell-project-0.1.0.0 using:
C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.0.1.0_ghc-8.2.2.exe --builddir=.stack-work\dist\5c8418a7 configure --with-ghc=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc.EXE --with-ghc-pkg=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\ghc-8.2.2\bin\ghc-pkg.EXE --user --package-db=clear --package-db=global --package-db=C:\sr\snapshots\13cecb13\pkgdb --package-db=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\pkgdb --libdir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\lib --bindir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\bin --datadir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\share --libexecdir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\libexec --sysconfdir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\etc --docdir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\doc\haskell-project-0.1.0.0 --htmldir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\doc\haskell-project-0.1.0.0 --haddockdir=C:\Users\Michael\Desktop\haskell-project\.stack-work\install\ccbce92a\doc\haskell-project-0.1.0.0 --dependency=base=base-4.10.1.0 --dependency=containers=containers-0.5.10.2 --dependency=mtl=mtl-2.2.1-DscMMmDQUE6GBfOSl4qMUH --dependency=parsec=parsec-3.1.11-3BgBURmbRiVF8fgoxhAiBa --dependency=pretty-simple=pretty-simple-2.0.1.0-J3QTM6x6LHL5fhqavYvVhJ --dependency=text=text-1.2.2.2-9VTsh6V7U7hpagw2HDvpZ --extra-include-dirs=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include --extra-lib-dirs=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin --extra-lib-dirs=C:\Users\Michael\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib --enable-tests --enable-benchmarks
Process exited with code: ExitFailure 1
What would be the steps to fix this or likely causes?
I managed to find a temporary solution for anybody who is having the same issue.
I downgraded cabal to version 1.24.0.2 and changed the resolver to using GHC version 8.0.1 (resolver: ghc-8.0.1).
After then running stack solver I'm now able to build.
The issue #3765 on the stack tracker has some workarounds for this, in addition to Michael's answer.
The best solution, it seems, is to unset __COMPAT_LAYER, which when set to INSTALLER can reproduce the bug.
C:\>set __COMPAT_LAYER=
The cause might be a bug in some versions of GHC, which is catching exceptions it ought to propagate to the user. If this is the case, there is an underlying problem, and this bug is hiding it.
Do please add a comment on the aforementioned issue, as it will help the maintainers track the prevalence of this problem.
I'm pretty new to node.js and its package management system and its require. I'm having trouble with the following runtime error I'm getting after having installed a bunch of packages with npm install:
ERROR: Couldn't initialise framework "wdio-mocha-framework".
Error: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found
(required by <path>.../node_modules/fibers/bin/linux-ia32-v8-5.0/fibers.node)
at Error (native)
My understanding of the error is that the binary fibers.node was compiled with a newer libstdc++ than the one available at runtime.
It appears to me like the npm install did compile a fibers.node:
> fibers#1.0.13 install <path>.../node_modules/fibers
> node build.js || nodejs build.js
make[1]: Entering directory `<path>.../node_modules/fibers/build'
<snip some output, including warnings, here that I don't deem relevant>
Installed in `<path>.../node_modules/fibers/bin/linux-ia32-v8-3.14/fibers.node`
However, I see that the fibers.node that is throwing the error at runtime is not the same one as was compiled, and I assume that's the source of the problem.
Compiled:
.../linux-ia32-v8-3.14/fibers.node
Used at runtime and fails:
.../linux-ia32-v8-5.0/fibers.node
So I'm guessing and hoping that if I could convince wdio-mocha-framework to use the locally-compiled fibers.node, it would work. My questions are thus:
Would that fix it?
If so, how do I achieve that?
If not, what's the correct direction to take to further understand and fix this error? Perhaps instead of getting 3.14 to be used at runtime, I should be convincing 5.0 to be compiled at install-time? Or ... other?
Your help is most sincerely appreciated.
Update/Edit:
I think I solved this on my own, in case anyone ever finds this poor, dusty old question lying forgotten on the back of a shelf somewhere...
The problem was apparently due to multiple versions of node/node-gyp that were installed in my environment in parallel, and the build process, even though it was started with a newer version of node, was finding node-gyp in the $PATH and that's apparently what caused the old version of fibers to be built. At least, I think so.
Just had this problem recently. I managed to solve it just by uninstalling the current version of Node.JS (I had the most recent, in this case 9.5.0) and installing the recommended, in this case 8.9.4. and the issue is gone. hope this helps someone.
I have a Haskell desktop application that uses Snap. This application has been building for years now and is an everyday part of our fielded solution. I upgraded to a new development machine some months ago, running Windows 10 with version 7.10.3 of the GHC and 1.22.3.0 of the cabal library with 1.22.4.0 of cabal-install. I have installed version 0.9.8.0 of snap-core and version 0.9.5.1 of snap-server.
When I try and build my application in this environment, it get the following error:
Could not find module `Snap.Internal.Http.Server.Exception'
Perhaps you meant
Snap.Internal.Http.Server.Backend
Snap.Internal.Http.Server.Config
Snap.Internal.Http.Server.Date
I cannot find this module in Hackage. Did something change in Snap since I last built this code? Please, any advice will be appreciated.
Dave
P.S. Here are links to the output of the ghc-pkg list command and to the cabal file for this project.
http://zelda.designacourse.com/dave/ghc-pkg_list.txt
http://zelda.designacourse.com/dave/PreviewWrapper.cabal
With the help of, and gratitude to, epsilonhalbe we found a solution to this problem. I still do not know why the import of Snap.Internal.Http.Server.Exception started to throw an error from the compiler. However, removing that import and adding a type declaration to the variable now allows the code to build without error. i.e. catch ((_ :: IOException) -> return True).