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

Fix error swallowing bug #113

Merged
merged 8 commits into from
Dec 10, 2024
Merged

Fix error swallowing bug #113

merged 8 commits into from
Dec 10, 2024

Conversation

bhelx
Copy link
Contributor

@bhelx bhelx commented Dec 4, 2024

Fixes #109

Just a test to repro for now. I tried to upgrade quickjs. Did some other house cleaning while in here. It appears that the problem may be in rquickjs, but maybe we are holding it wrong. Will look with Zach today.

zshipko and others added 3 commits December 5, 2024 14:46
Fixes #109

Just a test to repro for now. I tried to upgrade quickjs. Did some other
house cleaning while in here. It appears that the problem may be in
rquickjs, but maybe we are holding it wrong. Will look with Zach today.
@zshipko zshipko force-pushed the fix-error-swallowing-bug branch from 8914d7b to 0caed1a Compare December 5, 2024 22:53
@zshipko zshipko marked this pull request as ready for review December 5, 2024 22:53
@zshipko zshipko self-requested a review as a code owner December 5, 2024 22:53
@zshipko
Copy link
Contributor

zshipko commented Dec 5, 2024

I was finally able to fix this 🎊 - it came down to using check_exception (https://github.com/extism/js-pdk/pull/113/files#diff-3df137e08da293bebdb5cbe1b81fcae6af75992a24c583f47e8040baecbf123aR18) to convert QuickJS errors/exceptions into anyhow::Errors

The commit also includes some fixes for warnings about static mutable values on newer versions of rustc

@bhelx
Copy link
Contributor Author

bhelx commented Dec 10, 2024

Sorry i missed that you got this @zshipko ! gonna try it out

Comment on lines +53 to +65
# ifeq ($(OS),Windows_NT)
# @python3 -m venv ./.venv && \
# ./.venv/Scripts/activate.bat && \
# pip install -r examples/host_funcs/requirements.txt && \
# python examples/host_funcs/host.py examples/host_funcs.wasm && \
# ./.venv/Scripts/deactivate.bat
# else
# @python3 -m venv ./.venv && \
# . ./.venv/bin/activate && \
# pip install -r examples/host_funcs/requirements.txt && \
# python3 examples/host_funcs/host.py examples/host_funcs.wasm && \
# deactivate
# endif
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm gonna leave this uncommented and merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chrisdickinson no rush, but could you chime in as to how to fix this or when another sdk release will happen? i don't recall we had a definitive reason why we were still getting the failure to import here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I wasn't able to replicate the extism_sys issue on my machine – I ran into a similar issue with extism-cli but I solved it by upgrading my virtualenv. I think it could be a virtualenv issue – looking back at the error you posted, it doesn't look like you had the target virtualenv active when you uninstalled extism_sys and installed a newer version. The CI looks like it was failing for a different reason, though?

Copy link
Contributor

Choose a reason for hiding this comment

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

This must have been some kind of caching issue, the tests are passing now: #116

@bhelx bhelx merged commit 55a56ca into main Dec 10, 2024
6 checks passed
@bhelx bhelx deleted the fix-error-swallowing-bug branch December 10, 2024 15:41
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.

JavaScript exception being swallowed?
3 participants