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

Add an API to detect precompiled modules/components #6832

Merged
merged 1 commit into from
Aug 10, 2023

Conversation

alexcrichton
Copy link
Member

This commit adds a new Engine::detect_precompiled API to inspect some bytes and determine if they look like a precompiled artifact of either a core wasm module or component. This is something I'll be using soon in an upcoming refactor of the Wasmtime CLI to support components, but it's something we've also talked about before which can be useful for systems storing both precompiled modules and components.

Implementation-wise this looks at the ELF header of the input and determines if it's got all the right flags that Wasmtime sets for the various bits and bobs of our object format.

This commit adds a new `Engine::detect_precompiled` API to inspect some
bytes and determine if they look like a precompiled artifact of either a
core wasm module or component. This is something I'll be using soon in
an upcoming refactor of the Wasmtime CLI to support components, but it's
something we've also talked about before which can be useful for systems
storing both precompiled modules and components.

Implementation-wise this looks at the ELF header of the input and
determines if it's got all the right flags that Wasmtime sets for the
various bits and bobs of our object format.
@alexcrichton alexcrichton requested a review from a team as a code owner August 10, 2023 18:09
@alexcrichton alexcrichton requested review from pchickey and removed request for a team August 10, 2023 18:09
@alexcrichton alexcrichton added this pull request to the merge queue Aug 10, 2023
Merged via the queue into bytecodealliance:main with commit 137c6f6 Aug 10, 2023
@alexcrichton alexcrichton deleted the detect-precompiled branch August 10, 2023 21:01
eduardomourar pushed a commit to eduardomourar/wasmtime that referenced this pull request Aug 18, 2023
…#6832)

This commit adds a new `Engine::detect_precompiled` API to inspect some
bytes and determine if they look like a precompiled artifact of either a
core wasm module or component. This is something I'll be using soon in
an upcoming refactor of the Wasmtime CLI to support components, but it's
something we've also talked about before which can be useful for systems
storing both precompiled modules and components.

Implementation-wise this looks at the ELF header of the input and
determines if it's got all the right flags that Wasmtime sets for the
various bits and bobs of our object format.
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