-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Serialize and deserialize compilation artifacts. #2020
Serialize and deserialize compilation artifacts. #2020
Conversation
Subscribe to Label Actioncc @bnjbvr, @peterhuene
This issue or pull request has been labeled: "cranelift", "wasmtime:api"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
Subscribe to Label Actioncc @peterhuene
This issue or pull request has been labeled: "wasmtime:c-api"
Thus the following users have been cc'd because of the following labels:
To subscribe or unsubscribe from this label, edit the |
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.
Nice!
I think that we'll want to expand the documentation on these functions as well. I'd probably pick one of serialize/deserialize and add a bunch of docs there, referencing these docs from the other function instead of duplication as well.
In terms of documentation contents I think we'll want to document how the bytes are intended to be used, for example they're only usable by one version of the wasmtime
crate, they're not intended to be long-lived artifacts. Also we'll probably want a small example in the documentation of serializing/deserializing.
Can you be sure to add some Rust tests as well?
faa08c0
to
ac6c064
Compare
e9b619f
to
3b1cb69
Compare
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.
Sorry missed the updates here but this all looks good to me now!
Fixes #1779
This is final patch in series to allow direct access to the compiled code.
compile_and_serialize
API function that allows to saveCompilationArtifacts
object in binary format (+target/config fingerprint)Module::deserialize
API function that allows to read the above data and createModule
object. Marked unsafe since it does not provide any guarantees for safety of the ingested code.Config
s must have the same host triple, codegen flags, andTunables
. (Can we ignoreCompilerStrategy
?)PR opened for feedback.