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

Fixing js binding #206

Merged
merged 5 commits into from
Jan 2, 2025
Merged

Fixing js binding #206

merged 5 commits into from
Jan 2, 2025

Conversation

jurajsic
Copy link
Member

@jurajsic jurajsic commented Jan 1, 2025

This PR fixes building of JS binding with more detailed readme.
It seems to be working, however some tests fail, because either they want to use model/proof generation which is by default disabled in noodler, or there is a timeout, and I do not know why it timeouts (the tests are very simple).

@jurajsic jurajsic marked this pull request as ready for review January 1, 2025 22:53
@jurajsic jurajsic requested a review from vhavlena January 1, 2025 22:53
@vhavlena
Copy link
Collaborator

vhavlena commented Jan 2, 2025

I tried it and I am a bit stuck. After npm run build:wasm I got the following error:

wasm-ld: error: ../../../build/libz3.a(ca_str_constr.cpp.o): undefined symbol: mata::nfa::Nfa::get_words(unsigned int) const
emcc: error: '/opt/homebrew/Cellar/emscripten/3.1.74/libexec/llvm/bin/wasm-ld @/var/folders/k8/vb71jppj43x35pc3qvksjy4w0000gn/T/emscripten_u_l4r1au.rsp.utf-8' failed (returned 1)
Process exited with status 1

Built against the current mata.

@jurajsic
Copy link
Member Author

jurajsic commented Jan 2, 2025

I tried it and I am a bit stuck. After npm run build:wasm I got the following error:

wasm-ld: error: ../../../build/libz3.a(ca_str_constr.cpp.o): undefined symbol: mata::nfa::Nfa::get_words(unsigned int) const
emcc: error: '/opt/homebrew/Cellar/emscripten/3.1.74/libexec/llvm/bin/wasm-ld @/var/folders/k8/vb71jppj43x35pc3qvksjy4w0000gn/T/emscripten_u_l4r1au.rsp.utf-8' failed (returned 1)
Process exited with status 1

Built against the current mata.

Did you follow the steps exactly the same? Mainly if you are usingemscripten from emsdk, because it looks like you are using the installed emscripten trough brew (you might need to uninstall emscripten trough brew, otherwise it can clash).

@vhavlena
Copy link
Collaborator

vhavlena commented Jan 2, 2025

It is working now (even with the brew-installed usingemscripten ). The problem was that I have installed a different version of mata using emsdk than the one installed by the regular means (make). It seems that you have to use the very same version of mata for both installs.

Copy link
Collaborator

@vhavlena vhavlena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! It remains to fix the failing tests and we are there.

@jurajsic
Copy link
Member Author

jurajsic commented Jan 2, 2025

It seems the failing tests are either because we turn off model generation by default (while in Z3 it is always turned on), or because there are quantifiers (and string solver is initialized, which leads to error) => the binding should work correctly

@jurajsic jurajsic merged commit b6435e5 into devel Jan 2, 2025
2 checks passed
@jurajsic jurajsic deleted the working-js branch January 2, 2025 19:46
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

Successfully merging this pull request may close these issues.

2 participants