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

Update to GHC 8.4, and LTS 11.2 #8

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions HaPy-haskell/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.stack-work
2 changes: 1 addition & 1 deletion HaPy-haskell/Foreign/HaPy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ toForeignExp _ exp = fail "conversion failed: unknown type!"

makeFunction :: (String -> String) -> (Name -> [FType] -> ClauseQ) -> ([FType] -> TypeQ) -> Name -> DecsQ
makeFunction changeName makeClause makeType origName = do
VarI _ t _ _ <- reify origName
VarI _ t _ <- reify origName
mgajda marked this conversation as resolved.
Show resolved Hide resolved
let types = map fromHaskellType $ toTypeList t
name = mkName . changeName . nameBase $ origName
cl = makeClause origName types
Expand Down
6 changes: 3 additions & 3 deletions HaPy-haskell/HaPy.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: HaPy
version: 0.1.1.1
version: 0.3.0.0
synopsis: Haskell bindings for Python
description: Call Haskell functions from Python!
homepage: https://github.com/sakana/HaPy
Expand All @@ -18,6 +18,6 @@ library
Foreign.HaPy.Internal
extensions: TemplateHaskell
c-sources: HaPy_init.c
build-depends: base >= 4.5 && < 4.9,
build-depends: base >= 4.5 && < 4.12,
th-lift >= 0.5 && < 0.8,
template-haskell >= 2.7.0.0 && < 2.11.0.0
template-haskell >= 2.11.0.0 && < 2.14.0.0
3 changes: 3 additions & 0 deletions HaPy-haskell/stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resolver: lts-12.4
packages:
- .
2 changes: 2 additions & 0 deletions HaPy-python/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.pyc
*.pyo
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,14 @@ Common Errors:
* Error: `Missing C library: HSrts-ghc7.8.2` (or similar) --> The version of the GHC RTS library that you specified in your cabal file doesn't match the version of GHC you're running.
* When running your Python project:
* `Symbol not found: _stg_IND_STATIC_info` or `undefined symbol: stg_forkOnzh` --> The GHC RTS library isn't specified as one of the extra-libraries in the cabal file of your Haskell project. See the [General Installation and Usage](#os-xgeneral-installation-and-usage) section above.
* ImportError on HaPy --> You need to install HaPy Python library to your PYTHONPATH.
* Cannot find ExampleModule error --> You probably need to put libHSExampleModule*.dylib or .so on your path or in this directory by symlink:
```
$ ln -s `find ../ -iname '*.dylib'` .
```
* dlopen error on `_stg_*` symbol --> Please check that `extra-libs:` section in `../haskell/*.cabal` file contains proper GHC RTS library reference (name varies between GHC versions.)
* Anything else: please make an issue and I'll take a look!


FAQ:
-----
None yet! Feel free to start an issue if there's something you don't understand.
Expand Down
2 changes: 2 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0.1.1.3 Jul 30 2018
* Update to GHC 8.4, and Stack LTS 11.2
2 changes: 1 addition & 1 deletion example/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endif
@echo
endif
@echo '>>> sudo pip install hapy-ffi'
@sudo pip install hapy-ffi
@pip install hapy-ffi
@echo
@$(MAKE) -C haskell all
@echo
Expand Down
1 change: 1 addition & 0 deletions example/haskell/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.stack-work
9 changes: 7 additions & 2 deletions example/haskell/ExampleModule.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ cabal-version: >=1.10
library
exposed-modules: ExampleModule, Export
other-extensions: ForeignFunctionInterface, TemplateHaskell
build-depends: base >=4.6 && <4.8, HaPy == 0.1.*
build-depends: base >=4.6 && <4.12, HaPy == 0.2.*
default-language: Haskell2010

-- *** change this to your GHC version ***
-- the make script will do this automatically
extra-libraries: HSrts-ghc7.8.2
--extra-libraries: HSrts-ghc
--extra-libraries: HSrts_l
extra-libraries: HSrts
--ghc-options: -fPIC -pie -dynamic -shared -dylib-install-name=ExampleModule
ghc-options: -shared
-- Mac: -fPIC
4 changes: 4 additions & 0 deletions example/haskell/stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resolver: lts-12.4
packages:
- .
- ../../HaPy-haskell