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

python runtime compiling failed #157

Open
Saibo-creator opened this issue Mar 22, 2023 · 1 comment
Open

python runtime compiling failed #157

Saibo-creator opened this issue Mar 22, 2023 · 1 comment

Comments

@Saibo-creator
Copy link

Hello,
I got the following error while compiling python runtime from the source. It seems there is a function signature mimatch.

Error Reproduction

Go inside runtime/python/

python setup.py build

Error Message

pypgf.c:1740:77: error: too many arguments to function call, expected 6, have 7
                pgf_complete(self->concr, type, sentence, prefix, prefix_bind, parse_err, pyres->pool);
                ~~~~~~~~~~~~                                                              ^~~~~~~~~~~
/usr/local/include/pgf/pgf.h:253:1: note: 'pgf_complete' declared here
pgf_complete(PgfConcr* concr, PgfType* type, GuString string, 
^

Fix

Change line 1740 in pypgf.c
pgf_complete(self->concr, type, sentence, prefix, prefix_bind, parse_err, pyres->pool);

to
pgf_complete(self->concr, type, sentence, prefix, parse_err, pyres->pool);

@Saibo-creator
Copy link
Author

Saibo-creator commented Mar 22, 2023

After a close look, it seems that this is caused by the mismatch between the installed C runtime and python code.

In the commit a42cec2 on Jul 16, 2022, the interface of pgf_complete has been changed.

The pgf_complete in the current commit is aligned with the line 1740 in pypgf.c
https://github.com/GrammaticalFramework/gf-core/blob/master/src/runtime/c/pgf/pgf.h#L254
, where pgf_complete takes 7 arguments, including prefix_bind

However, if the c-runtime was installed from assets here https://github.com/GrammaticalFramework/gf-core/releases/tag/3.11 (my case)
then the mismatch happens, due to the fact that the assets were compiled from the old code(before commit a42cec2)

So I guess it may not be a bug, but just a caveat for beginners.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant