yesod-core fails to build on Mavericks - macos

I have a Homebrew-installed Haskell platform version 2013.2.0.0 with GHC 7.6.3 and an up-to-date cabal install. I try to install yesod-core - it grabs version 1.2.6.4, and I get this compilation error:
[11 of 20] Compiling Yesod.Core.Class.Yesod ( Yesod/Core/Class/Yesod.hs, dist/dist-sandbox-74f8d9fc/build/Yesod/Core/Class/Yesod.o )
Yesod/Core/Class/Yesod.hs:519:81:
Could not deduce (aeson-0.7.0.0:Data.Aeson.Types.Class.ToJSON
Network.HTTP.Types.Method.Method)
arising from a use of `.='
from the context (Yesod site)
bound by the type signature for
defaultErrorHandler :: Yesod site =>
ErrorResponse -> HandlerT site IO TypedContent
at Yesod/Core/Class/Yesod.hs:439:24-83
Possible fix:
add an instance declaration for
(aeson-0.7.0.0:Data.Aeson.Types.Class.ToJSON
Network.HTTP.Types.Method.Method)
In the expression: "method" .= m
In the first argument of `object', namely
`["message" .= ("Bad method" :: Text), "method" .= m]'
In the second argument of `($)', namely
`object ["message" .= ("Bad method" :: Text), "method" .= m]'
... which looks like an actual bug in the Yesod code. Any suggestions on how to proceed?

Looks like this is a build dependency issue in yesod-core, The developers on the irc channel are aware of the issue. To work around this trying installing yesod-core with this command
cabal install aeson-0.6.2.1 yesod-core
This will force the use of the previous version of aeson which works on my system in a fresh cabal sandbox.

Related

Why does Fabric tell me that I have the wrong version installed?

This is what it says in the console
[13:53:46] [main/INFO] (FabricLoader/GameProvider) Loading Minecraft 1.19 with Fabric Loader 0.14.9
[13:53:46] [main/WARN] (FabricLoader/Resolution) Mod resolution failed
[13:53:46] [main/INFO] (FabricLoader/Resolution) Immediate reason: [HARD_DEP_NO_CANDIDATE example 1.0.0 {depends fabric-api # [*]}, ROOT_FORCELOAD_SINGLE example 1.0.0]
[13:53:46] [main/INFO] (FabricLoader/Resolution) Reason: [HARD_DEP example 1.0.0 {depends fabric-api # [*]}]
[13:53:46] [main/INFO] (FabricLoader/Resolution) Fix: add [add:fabric-api 1 ([(-∞,∞)])], remove [], replace []
[13:53:46] [main/ERROR] (FabricLoader) Incompatible mod set!
net.fabricmc.loader.impl.FormattedException: Mod resolution encountered an incompatible mod set!
A potential solution has been determined:
- Install fabric-api, any version.
Unmet dependency listing:
- Mod 'Example Mod' (example) 1.0.0 requires any version of fabric-api, which is missing!
at net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:190) ~[fabric-loader-0.14.9.jar:?]
at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:148) ~[fabric-loader-0.14.9.jar:?]
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:68) [fabric-loader-0.14.9.jar:?]
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) [fabric-loader-0.14.9.jar:?]
at net.fabricmc.devlaunchinjector.Main.main(Main.java:86) [dev-launch-injector-0.2.1+build.8.jar:?]
Process finished with exit code 1
when I try to run it as a minecraft client, a fabric-api window opens with this error message
Incompatible mod set!
net.fabricmc.loader.impl.FormattedException: Mod resolution encountered an incompatible mod set!
A potential solution has been determined:
- Install fabric-api, any version.
Unmet dependency listing:
- Mod 'Example Mod' (example) 1.0.0 requires any version of fabric-api, which is missing!
at net.fabricmc.loader.impl.FabricLoaderImpl.load(FabricLoaderImpl.java:190)
at net.fabricmc.loader.impl.launch.knot.Knot.init(Knot.java:148)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:68)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
at net.fabricmc.devlaunchinjector.Main.main(Main.java:86)
I have installed the right version of fabric-api after I got that error, and I re-opened the project and tried it again but it didnt work.
As logs said, you need the Fabric API in any version.
This requirement is made by your plugin, in your fabric.mod.json file.

Weird Haskell 'stack' error: "can't load .so/.DLL" "not a writable segment"

I am trying to install ghc-mod so that I can use ide-haskell in Atom.
The instructions say to use stack build ghc-mod. It seems that GHC 8.2+ is not supported by ghc-mod, so I set my resolver to lts-9.21.
When running stack build ghc-mod, I keep getting this error (emphasis mine; not using code formatting because line wrap helps readability):
aeson > : can't load .so/.DLL for: /Users/timoffex/.stack/snapshots/x86_64-osx/db354248ca37308313a93487c93190e1d5b819629b60b38b68871c9a691e52b9/8.0.2/lib/x86_64-osx-ghc-8.0.2/libHStime-locale-compat-0.1.1.3-KZ1jqNx8uhlHjmuPPj6V1Y-ghc8.0.2.dylib (dlopen(/Users/timoffex/.stack/snapshots/x86_64-osx/db354248ca37308313a93487c93190e1d5b819629b60b38b68871c9a691e52b9/8.0.2/lib/x86_64-osx-ghc-8.0.2/libHStime-locale-compat-0.1.1.3-KZ1jqNx8uhlHjmuPPj6V1Y-ghc8.0.2.dylib, 5): REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB has segment 2 which is not a writable segment (__LINKEDIT) in /Users/timoffex/.stack/snapshots/x86_64-osx/db354248ca37308313a93487c93190e1d5b819629b60b38b68871c9a691e52b9/8.0.2/lib/x86_64-osx-ghc-8.0.2/libHStime-locale-compat-0.1.1.3-KZ1jqNx8uhlHjmuPPj6V1Y-ghc8.0.2.dylib)
... (later)
-- While building package aeson-1.1.2.0 using:
/Users/timoffex/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.2.0 build --ghc-options ""
Process exited with code: ExitFailure 1
Progress 1/4
Here's a snippet from the above that looks weird to me:
REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB has segment 2 which is not a writable segment
I am running macOS Catalina 10.15.3.
I can't find any mention of this online except for this open GitHub issue: https://github.com/facebook/duckling/issues/446
I also tried lts-7.24. I get the exact same error, except it happens while building profunctors.
What could be the problem? Where can I file a bug?
I had the same error in a project using resolver: lts-9.17.
What fixed it for me is to update stack.yaml and use this line:
resolver: lts-10.9

RStudio package "digest" cannot be used, loaded, or installed

trying to follow the quanteda tutorial, I'm running into problems here with the programme; executing the following code, I get error messages hinting at problems with packages I cannot resolve.
> require(quanteda)
> require(quanteda.corpora)
> require(ggplot2)
> corp_tweets <- download(url = 'https://www.dropbox.com/s/846skn1i5elbnd2/data_corpus_sampletweets.rds?dl=1')
Error in loadNamespace(name) : there is no package called ‘digest’
As the package seems to be missing, I tried loading it and get:
> require("digest")
Loading required package: digest
Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called ‘digest’
Now, I try installing it - again, without success.
> install.packages("digest")
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/digest_0.6.20.zip'
Content type 'application/zip' length 223139 bytes (217 KB)
downloaded 217 KB
package ‘digest’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘digest’
The downloaded binary packages are in
C:\Users\my_username\AppData\Local\Temp\Rtmpaunnzu\downloaded_packages
Does anyone know how to take it from here? Help is much appreciated.
P.S.: This (unanswered) question did not help me either.
The only "solution" I could find was to re-install RStudio.

Unable to use libcurl with cffi on Windows 10

I am playing with the CFFI tutorial on Windows 10 and have installed the libcurl-devel package using msys2. I found a file libcurl.dll.a in the directory c:\msys2\usr\lib\ and added this directory to *foreign-library-directories* using:
(pushnew #P"c:/msys64/usr/lib/" *foreign-library-directories*
:test #'equal)
But if I try (use-foreign-library libcurl) I get the following error:
Unable to load foreign library (LIBCURL).
Error opening shared object "libcurl.dll"
What am I missing? I tried to point to libcurl.dll.a directly but the error stays the same:
(define-foreign-library libcurl
(:darwin (:or "libcurl.3.dylib" "libcurl.dylib"))
(:unix (:or "libcurl.so.3" "libcurl.so"))
(t "libcurl.dll.a"))
Here is the complete code as given in the tutorial:
(asdf:load-system :cffi)
;;; Nothing special about the "CFFI-USER" package. We're just
;;; using it as a substitute for your own CL package.
(defpackage :cffi-user
(:use :common-lisp :cffi))
(in-package :cffi-user)
(pushnew #P"c:/msys64/usr/lib/" *foreign-library-directories*
:test #'equal)
(define-foreign-library libcurl
(:darwin (:or "libcurl.3.dylib" "libcurl.dylib"))
(:unix (:or "libcurl.so.3" "libcurl.so"))
(t (:default "libcurl")))
(use-foreign-library libcurl)
EDIT
I am using SBCL 1.4.16 from the portacle package.
EDIT 2
Just for the sake of completeness. If I change define-foreign-library to
(define-foreign-library libcurl
(:darwin (:or "libcurl.3.dylib" "libcurl.dylib"))
(:unix (:or "libcurl.so.3" "libcurl.so"))
(t "libcurl.dll.a"))
the errors changes:
Unable to load foreign library (LIBCURL).
Error opening shared object "c:\\msys64\\usr\\lib\\libcurl.dll.a":
%1 ist keine zulässige Win32-Anwendung.
As far as I understand at least the file is found but seems not to be in the right format. I didn't find any further information about the difference between dynamic (.dll) and static (.dll.a) files with respect to cffi and don't have the resources at the moment to further investigate this.
Instead of using use-foreign-library, try loading load-foreign-library. It is lower level code, but it will allow you to experiment with files and paths.
Also use cygcheck to figure out what libcurl.dll depends on. Then make sure you have the components installed, and that they are in PATH.
Finally, check where libcurl.dll lives in your MSYS2. On my system it is in /c/msys64/mingw64/bin/libcurl-4.dll

Cryptic Clojure error: java.lang.UnsupportedOperationException: nth not supported on this type: Symbol

I am trying to make leiningen work. I am using Windows 7. When I run in the command window
C:\lein new app my-app
I get the following error. Does anyone know what this means and where the error is occuring?
There is an explanation of the error message here but I did not understand if there is a fix or what causes the error.
C:\Users\a\work>lein new app my-app
java.lang.UnsupportedOperationException: nth not supported on this type: Symbol
at clojure.lang.RT.nthFrom(RT.java:857)
at clojure.lang.RT.nth(RT.java:807)
at leiningen.core.project$dep_key.invoke(project.clj:175)
at leiningen.core.project$reduce_dep_step.invoke(project.clj:183)
at clojure.lang.ArrayChunk.reduce(ArrayChunk.java:58)
at clojure.core.protocols$fn__6041.invoke(protocols.clj:98)
at clojure.core.protocols$fn__6005$G__6000__6014.invoke(protocols.clj:19
)
at clojure.core.protocols$seq_reduce.invoke(protocols.clj:31)
at clojure.core.protocols$fn__6024.invoke(protocols.clj:60)
at clojure.core.protocols$fn__5979$G__5974__5992.invoke(protocols.clj:13
)
at clojure.core$reduce.invoke(core.clj:6177)
at leiningen.core.project$meta_merge.invoke(project.clj:391)
at clojure.core$merge_with$merge_entry__4279.invoke(core.clj:2698)
at clojure.core$reduce1.invoke(core.clj:896)
at clojure.core$merge_with$merge2__4281.invoke(core.clj:2701)
at clojure.core$reduce1.invoke(core.clj:896)
at clojure.core$reduce1.invoke(core.clj:887)
at clojure.core$merge_with.doInvoke(core.clj:2702)
at clojure.lang.RestFn.invoke(RestFn.java:439)
at leiningen.core.project$meta_merge.invoke(project.clj:395)
at leiningen.core.project$apply_profiles$fn__1009.invoke(project.clj:417
)
at clojure.lang.ArrayChunk.reduce(ArrayChunk.java:58)
at clojure.core.protocols$fn__6041.invoke(protocols.clj:98)
at clojure.core.protocols$fn__6005$G__6000__6014.invoke(protocols.clj:19
)
at clojure.core.protocols$seq_reduce.invoke(protocols.clj:31)
at clojure.core.protocols$fn__6026.invoke(protocols.clj:54)
at clojure.core.protocols$fn__5979$G__5974__5992.invoke(protocols.clj:13
)
at clojure.core$reduce.invoke(core.clj:6177)
at leiningen.core.project$apply_profiles.invoke(project.clj:415)
at leiningen.core.project$init_profiles.doInvoke(project.clj:603)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at leiningen.core.main$_main$fn__1332.invoke(main.clj:257)
at leiningen.core.main$_main.doInvoke(main.clj:252)
at clojure.lang.RestFn.invoke(RestFn.java:436)
at clojure.lang.Var.invoke(Var.java:423)
at clojure.lang.AFn.applyToHelper(AFn.java:167)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.core$apply.invoke(core.clj:617)
at clojure.main$main_opt.invoke(main.clj:335)
at clojure.main$main.doInvoke(main.clj:440)
at clojure.lang.RestFn.invoke(RestFn.java:482)
at clojure.lang.Var.invoke(Var.java:431)
at clojure.lang.AFn.applyToHelper(AFn.java:178)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.main.main(main.java:37)
C:\Users\a\work
As requested, here's my comment transferred into an answer. I suggested reinstalling Leiningen because apparently a broken Leiningen installation was the source of the problem.
As a little background explanation, I'm using Leiningen on both Linux and Windows, and I've made the experience myself that the primary method for installing Leiningen recommended on its homepage, the lein resp. lein.bat script, just works, whereas the alternative
installation methods (Linux package managers, Windows installer) often produce broken installations.
I think it's highly unlikely that this is essentially a leiningen error, since I can reproduce it without leiningen being involved in any way:
user=> (let [[foo bar] :froboz] (list foo bar))
UnsupportedOperationException nth not supported on this type: Keyword clojure.lang.RT.nthFrom (RT.java:857)

Resources