judah / terminfo

Haskell bindings to the terminfo API.
BSD 3-Clause "New" or "Revised" License
10 stars 10 forks source link

Fix calls to varargs C function tparm #41

Closed nrdmn closed 3 years ago

nrdmn commented 3 years ago

The ccall calling convention doesn't support varargs functions, so switch to capi instead. See https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/ffi.html#varargs-not-supported-by-ccall-calling-convention

minoki commented 3 years ago

I've encountered an issue with haskeline on Apple Silicon Mac, where Ctrl-a (moveToStart) doesn't move the cursor properly. Fortunately, this PR seems to fix it, so I want this to be merged soon.

bgamari commented 3 years ago

Great catch, @nrdmn!

@judah , it would be great to have this fixed soon so we can ship the fix with GHC 9.0.2 and 9.2.1.

judah commented 3 years ago

@bgamari I've released this as terminfo-0.4.1.5.

steerio commented 2 years ago

Could someone summarize for mere mortals (who simply just use ghcup and expect things to work) how we can get this fix? It might be possible that upgrading GHC will cut it, but...

onnoeberhard commented 2 years ago

How can I install the new version of terminfo? I tried cabal install terminfo-0.4.1.5, which apparently succeeds, but checking cabal info terminfo or ghc-pkg list it still says my installed version is terminfo-0.4.1.4...

sjakobi commented 2 years ago

@onnoeberhard

If you have a .cabal file, you can add terminfo >= 0.4.1.5 to the build-depends. If you don't actually need a direct dependency on terminfo, you can add the constraint to your cabal.project file, i.e.

constraints: terminfo >= 0.4.1.5

For cabal repl, just add the option --constraint 'terminfo >= 0.4.1.5'.

onnoeberhard commented 2 years ago

Thanks @sjakobi. I think I must be doing something wrong though. I tried cabal install terminfo --constraint 'terminfo >= 0.4.1.5', and it again "succeeded", but still cabal info terminfo shows me only that version 0.4.1.4 is installed. I want to install the new version to fix a bug with ghci, but maybe that is not possible and I just have to update ghc itself..

sjakobi commented 2 years ago

@onnoeberhard Yeah, I think cabal info simply shows the version that is bundled with your GHC installation.

To get a GHCi that is built with terminfo-0.4.1.5, it's probably easiest to install a GHC that bundles this version, e.g. GHC 9.2.* or 9.0.2. See https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history.