Closed allComputableThings closed 4 years ago
I'm sorry. There's a mistake above. The latest master checkout has the error. The latest pip package seems fine:
$ pip install pyswip
Collecting pyswip
Using cached https://files.pythonhosted.org/packages/e4/f3/2b1462c4379b089426dbedb29d8d903e63baf37857ccf6e87f168b786019/pyswip-0.2.9-py2.py3-none-any.whl
Installing collected packages: pyswip
Successfully installed pyswip-0.2.9
$ python -c 'import pyswip; p = pyswip.Prolog(); p.assertz("father(michael,john)")'
# Success
# Go to latest clone of master
$ cd soft/pyswip/
$ python -c 'import pyswip; p = pyswip.Prolog(); p.assertz("father(michael,john)")'
[Thread 1 (main) at Wed Jun 17 19:49:26 2020] /build/swi-prolog-IR7kdY/swi-prolog-8.2.0-1-g7c05cf19b/src/pl-fli.c:2510: PL_put_chars: Assertion failed: 0
C-stack trace labeled "assert_fail":
[0] PL_strtod() at ??:? [0x7fc4306a44b8]
[1] __assert_fail() at ??:? [0x7fc4306627d7]
[2] PL_put_chars() at ??:? [0x7fc4305c0ec9]
[3] ffi_call_unix64() at ??:? [0x7fc4318f9dae]
[4] ffi_call() at ??:? [0x7fc4318f971f]
[5] _ctypes_callproc() at ??:? [0x7fc431b0d944]
[6] _ctypes_callproc() at ??:? [0x7fc431b0e0d4]
[7] python(_PyObject_FastCallKeywords+0x4eb) [0x5d96db]
[8] python(_PyEval_EvalFrameDefault+0x4679) [0x551e89]
[9] python(+0xd2165) [0x4d2165]
[10] python(+0x155976) [0x555976]
[11] python(_PyMethodDef_RawFastCallKeywords+0x1b3) [0x5d7ef3]
[12] python(_PyEval_EvalFrameDefault+0x42a4) [0x551ab4]
[13] python(_PyEval_EvalCodeWithName+0x252) [0x54b302]
[14] python(_PyFunction_FastCallKeywords+0x482) [0x5d8bd2]
[15] python(+0x14a880) [0x54a880]
[16] python(_PyEval_EvalFrameDefault+0x43f8) [0x551c08]
[17] python(_PyEval_EvalCodeWithName+0x252) [0x54b302]
[18] python(PyRun_StringFlags+0xaf) [0x530aef]
[19] python(PyRun_SimpleStringFlags+0x3d) [0x63138d]
[20] python(+0x25473d) [0x65473d]
[21] python(_Py_UnixMain+0x2e) [0x65486e]
[22] __libc_start_main() at /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344 [0x7fc43369eb97]
[23] python(_start+0x2a) [0x5df80a]
Aborted (core dumped)
Its turns our there are breaking changed in SWI-Prolog.h with PL_STRING (!) I'll submit a PR.
NB. The 8.xxx apt prior to 8.2.0 seems to be no-longer available. There's no option to stay compatible with that release, so upgrade is mandatory!
Resolved here: https://github.com/yuce/pyswip/pull/93
@stuz5000 Thanks for the fix for 8.2.0. Both Ubuntu 18.04 and 20.04 seem to be on SWI 7.6.4 in the official repos, so accepting the PR will break it for users (at least) on those platforms. So, we have to either (1) support both SWI 7 and 8 in the same package or (2) maintain another fork/package for SWI 8.There is a refactored PySwip living in a private repo which makes it easier to do (1), but it's notready for prime time yet.
Is using SWI 7 for the time being an option for you? What are the most important features you use from SWI 8?
Hmm... that makes sense. I followed the SWI instructions and installed from the ppa. I’m using tabling and dict’s from 8.
On Thu, Jun 18, 2020 at 8:24 PM Yüce Tekol notifications@github.com wrote:
@stuz5000 https://github.com/stuz5000 Thanks for the fix for 8.2.0. Both Ubuntu 18.04 and 20.04 seem to be on SWI 7.6.4 in the official repos, so accepting the PR will break it for users (at least) on those platforms. So, we have to either (1) support both SWI 7 and 8 in the same package or (2) maintain another fork/package for SWI 8.There is a refactored PySwip living in a private repo which makes it easier to do (1), but it's notready for prime time yet.
Is using SWI 7 for the time being an option for you? What are the most important features you use from SWI 8?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/yuce/pyswip/issues/92#issuecomment-646413955, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3QJLGYQBWC5EGL3MGOGHTRXLK53ANCNFSM4OBB3FPA .
I could refactor the PR so it detects the version and correctly sets the constants. Is it worth if there’s another version cooking?
On Thu, Jun 18, 2020 at 8:29 PM Stuart Reynolds stuart@stuartreynolds.net wrote:
Hmm... that makes sense. I followed the SWI instructions and installed from the ppa. I’m using tabling and dict’s from 8.
On Thu, Jun 18, 2020 at 8:24 PM Yüce Tekol notifications@github.com wrote:
@stuz5000 https://github.com/stuz5000 Thanks for the fix for 8.2.0. Both Ubuntu 18.04 and 20.04 seem to be on SWI 7.6.4 in the official repos, so accepting the PR will break it for users (at least) on those platforms. So, we have to either (1) support both SWI 7 and 8 in the same package or (2) maintain another fork/package for SWI 8.There is a refactored PySwip living in a private repo which makes it easier to do (1), but it's notready for prime time yet.
Is using SWI 7 for the time being an option for you? What are the most important features you use from SWI 8?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/yuce/pyswip/issues/92#issuecomment-646413955, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3QJLGYQBWC5EGL3MGOGHTRXLK53ANCNFSM4OBB3FPA .
I think it definitely worths it. The other version is not coming out soon, and when it does it will still need to check for the version.
OK -- I've checked in a fix to provide back compatibility.
I've been having this issue for a week or more:
I've checked out the latest pyswip master and:
... gets the above error. I was having the same error also with earlier versions. I suspect SWI-Prolog.h has somehow become incompatible with core.py. It suspect if has been happening since the apt swi-prolog version went to 8.2.0. I don't seem to be able to load earlier versions from the ppa either.
Can anyone confirm this? I should be straightforward to reproduce