litxio / ptghci

High-powered REPL for Haskell, inspired by IPython
Other
336 stars 6 forks source link

linking errors #21

Closed juhp closed 4 years ago

juhp commented 4 years ago

I tried to build ptghci today (from current HEAD f3c3882), and everything seemed to go well until:

:
Building executable 'ptghci' for ptghci-0.1.0.0..
[1 of 2] Compiling Main [Language.Haskell.PtGhci.Config changed]
[2 of 2] Compiling Paths_ptghci
Linking .stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/ptghci/ptghci ...
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):r2DzJ_info: error: undefined reference to 'Py_Main'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):r2DzK_info: error: undefined reference to 'PyRun_SimpleString'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):r2DzL_info: error: undefined reference to 'Py_Initialize'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):r2DzM_info: error: undefined reference to 'Py_Finalize'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):r2DzN_info: error: undefined reference to 'PyErr_SetInterrupt'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):r2DzO_info: error: undefined reference to 'PyErr_CheckSignals'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):r2DzP_info: error: undefined reference to 'PyErr_SetString'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):r2DzQ_info: error: undefined reference to 'Py_AddPendingCall'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):r2DzR_info: error: undefined reference to 'PyGILState_Ensure'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):r2DzS_info: error: undefined reference to 'PyGILState_Release'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):r2DzT_info: error: undefined reference to 'Py_GetVersion'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):r2DzU_info: error: undefined reference to 'Py_GetPath'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):s2DD4_info: error: undefined reference to 'Py_GetVersion'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):s2DD4_info: error: undefined reference to 'Py_GetPath'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):s2DDk_info: error: undefined reference to 'PyExc_EOFError'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):s2DDk_info: error: undefined reference to 'PyErr_SetString'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):r2DA3_info: error: undefined reference to 'PyGILState_Ensure'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):r2DA3_info: error: undefined reference to 'Py_AddPendingCall'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):r2DA3_info: error: undefined reference to 'PyGILState_Release'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):s2DFh_info: error: undefined reference to 'Py_Initialize'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):s2DFh_info: error: undefined reference to 'PyRun_SimpleString'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):s2DFh_info: error: undefined reference to 'Py_Finalize'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o):s2DFh_info: error: undefined reference to 'Py_Finalize'
/home/user/src/ptghci/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/libHSptghci-0.1.0.0-6NZdOqpUZLOJGaOa1athdc_p.a(StartPy.p_o)(.data+0x1078): error: undefined reference to 'PyExc_EOFError'
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
Completed 49 action(s).

--  While building package ptghci-0.1.0.0 using:
      /home/user/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.5 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1 build lib:ptghci exe:ptghci --ghc-options ""
    Process exited with code: ExitFailure 1
RichardWarfield commented 4 years ago

Hi Jens, thanks for reporting this. Could you let me know which platform you're on and which Python version you're linking against (e.g. what is the output of pkg-config --cflags python3?).

By the way, we met at the Haskell.SG event in February in Singapore :-) Good to hear from you.

juhp commented 4 years ago

Hi Richard, thanks, I remember that - nice to hear from you too.

I am building on Fedora 32, which has python 3.8.

$ pkg-config --cflags python3
-I/usr/include/python3.8 

Ah I see, I suppose this is a duplicate of #18. Okay I can try the python3.8 branch (building on Fedora 31 would probably also work).

RichardWarfield commented 4 years ago

Yes that would be my guess. Let me know if you have any further issues.

juhp commented 4 years ago

Thanks, wow very cool! I like it.

BTW any thoughts on handling of -Wall? I usually use it in my projects. It might be nice to filter out say:

<interactive>:594:5: warning: [-Wname-shadowing]
    This binding for ‘that’ shadows the existing binding
      defined at <interactive>:358:5

If you want and it makes sense I could open another issue for this.

RichardWarfield commented 4 years ago

Sure; I think it makes sense to open an issue for this. This is a tricky one: the "that" variable is meant to serve as a substitute for the "it" variable that in GHCi refers to the previous output (preserving "it" is basically impossible because I need to send additional commands to GHCi behind the scenes between user inputs and these commands overwrite "it"). So the shadowing is unavoidable as the variable is to be re-assigned each with each user input. I may just end up disabling -Wname-shadowing.

On Sat, May 2, 2020 at 1:46 PM Jens Petersen notifications@github.com wrote:

Thanks, wow very cool! I like it.

BTW any thoughts on handling of -Wall? I usually use it in my projects. It might be nice to filter out say:

:594:5: warning: [-Wname-shadowing] This binding for ‘that’ shadows the existing binding defined at :358:5 If you want and it makes sense I could open another issue for this. — You are receiving this because you commented. Reply to this email directly, view it on GitHub , or unsubscribe .
juhp commented 4 years ago

Sure, naively that sounds fine to me: I am not sure how useful warnings are really in ghci.