tbarnetlamb / hyphen

hyphen - access Haskell modules from Python
GNU General Public License v2.0
91 stars 9 forks source link

build-extn.py runtime error: Could not find module ‘Kind’ #10

Closed hellandhansen closed 4 years ago

hellandhansen commented 4 years ago

Hi!

It's possible this is obvious to the experienced, but I've gone back and forth and can't seem to resolve this issue, even when modifying the cabal file to expose Kind.

Here's the error trace.

Insights would be much appreciated. I've read through every haskell-from-python site out there...

Kind regards


[11 of 12] Compiling HyphenGHC        ( /Users/kodiak/haskell/hyphen-master/hyphen/lowlevel_src/HyphenGHC.hs, /Users/kodiak/haskell/hyphen-master/hyphen/lowlevel_inter/HyphenGHC.o )

/Users/kodiak/haskell/hyphen-master/hyphen/lowlevel_src/HyphenGHC.hs:44:1: error:
    Could not find module ‘Kind’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
44 | import qualified Kind        as GHCKind
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Traceback (most recent call last):
  File "/Users/kodiak/haskell/hyphen-master/hyphen/build-extn.py", line 130, in <module>
    subprocess.check_call(invocation + ['-no-link'])
  File "/Users/kodiak/anaconda3/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ghc', '-dynamic', '-shared', '-fPIC', '-no-hs-main', '-fwarn-unused-imports', '-cpp', '/Users/kodiak/haskell/hyphen-master/hyphen/lowlevel_src/Hyphen.hs', '/Users/kodiak/haskell/hyphen-master/hyphen/lowlevel_src/hyphen_c.c', '-i/Users/kodiak/haskell/hyphen-master/hyphen/lowlevel_src', '-hidir', '/Users/kodiak/haskell/hyphen-master/hyphen/lowlevel_inter', '-odir', '/Users/kodiak/haskell/hyphen-master/hyphen/lowlevel_inter', '-I/Users/kodiak/anaconda3/include/python3.6m', '-package', 'ghc', '-lHSrts_thr-ghc8.10.1\n', '-lpython3.6', '-no-link']' returned non-zero exit status 1.
(base) MacBook-Pro:testhyphen kodiak$ 
tbarnetlamb commented 4 years ago

I'll be happy to take a look when I can, likely in the next few days.

In the meantime, could I ask you to provide the output of ghc --version?

hellandhansen commented 4 years ago

Hi! Good to hear from you. It's

The Glorious Glasgow Haskell Compilation System, version 8.10.1

tbarnetlamb commented 4 years ago

Ok. I suspect that that's the issue; the most recent version I tested against was 8.8. hyphen accesses some GHC internals and they do tend to move around from major release to major release. I have to make occasional commits like https://github.com/tbarnetlamb/hyphen/commit/69bd64c0b872fcd418fa67155910e951ce32afdd to keep up! I will try to update the code for 8.10 (hopefully within days not weeks), but in the meantime, you might consider downgrading to 8.8 and seeing if that solves your problem.

tbarnetlamb commented 4 years ago

I looked into it some more and I realized that 8.10 is pretty bleeding edge. It's not yet supported by haskell stack (which is my go-to way of installing new haskell versions). How important is it to you to have access to that particular version? I guess I would prefer to wait until 8.10 is a little more widely supported (by stack at least) before I add support in hyphen, but if it's really important to you I can try to support it a bit early. (I might ask you how you installed ghc in that case, so that I can use the same installer to minimize the chance that it works differently for me that for you!)

hellandhansen commented 4 years ago

Hi!

Thanks for being willing to go the second mile with this.

Having the bleeding edge doesn’t really matter to me. It’s something that got installed by default. I’ll try and find out how to use an earlier version.

If this is all just a version issue then nobody’s happier than me!

I’ll get back to you once I’ve downgraded.

Kind regards.

På 16. mai 2020 kl. 01:55:38, tbarnetlamb (notifications@github.com) skrev:

I looked into it some more and I realized that 8.10 is pretty bleeding edge. It's not yet supported by haskell stack (which is my go-to way of installing new haskell versions). How important is it to you to have access to that particular version? I guess I would prefer to wait until 8.10 is a little more widely supported (by stack at least) before I add support in hyphen, but if it's really important to you I can try to support it a bit early. (I might ask you how you installed ghc in that case, so that I can use the same installer to minimize the chance that it works differently for me that for you!)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

hellandhansen commented 4 years ago

That was indeed the issue. Using 8.6, no problems.s

Hyphen rocks, heads and heels above the other implementations I've seen.

Keep up the good work ;-)