-
Notifications
You must be signed in to change notification settings - Fork 1
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
update kernel and add missing functions #8
base: main
Are you sure you want to change the base?
Conversation
@@ -2,6 +2,7 @@ import { toByteArray } from "base64-js"; | |||
import { initialize } from "esbuild"; | |||
import { sha256 } from "js-sha256"; | |||
|
|||
// @ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why I am getting a "No base constructor has the specified number of type arguments.ts(2508)" error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe related, the dataview constructor has 3 arguments https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView/DataView
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm, that doesn't seem to fix it. To be clear, it builds fine, the only one complaining is the linter
I can confirm that this works with the most recent released version of c-pdk (1.1.0). Thanks! |
I've just tried to actually exercise some of the logging and am running into some issues with that:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am seeing some issues with this version using the c-pdk higher-level input loading function extism_load_input()
.
As far as I can tell, this is because extism_input_length()
!= extism_length(extism_input_offset())
and it is relying on this being the case.
These are defined in c-pdk to use wasm imports:
extism_input_length
->input_length
extism_length
->length_unsafe
extism_input_offset
->input_offset
In a particular invocation of my plugin with the updated pg_extism on this branch, I am getting:
extism_input_length()
: 13extism_input_offset()
: 0extism_length(extism_input_offset())
: 0
Ah-ha! I think this may be because of a special case in the extism wasm runtime So I guess an offset of 0 is not supposed to be a valid value? |
I believe my suggested fixes (e.g. #8 (review)) will address this issue. |
Interesting, we probably should fix the c-pdk to remove that check, @zshipko what do you think? |
To be clear, the check is being done in the core extism runtime, not in c-pdk. It looks like the idea is that MemoryRoot is initialized with It seems like the issue here may be that |
@jrandall oh yeah! pg_extism is not yet using the newer input functions and handles it outside the kernel. Will fix that! |
@jrandall thank you very much for pointing out the issue, it should be good now! |
Fixes #7