Stream: git-wasmtime

Topic: wasmtime / PR #7341 Restructure building the C API


view this post on Zulip Wasmtime GitHub notifications bot (Oct 23 2023 at 22:21):

alexcrichton opened PR #7341 from alexcrichton:lto-c-api to bytecodealliance:main:

This commit introduces a wrapper crate which is now the new "real" C API. The purpose of this change is to enable using LTO when building the C API. Currently LTO is disabled because one of the crate types of the C API is an "rlib" which means that it can't have LTO performed due to rustc limitations. The solution here is to remove the "cdylib" and "staticlib" crate types from the "wasmtime-c-api" crate and introduce a new crate 'wasmtime-c-api-artfact' which wraps the previous crate and reexports it.

This way LTO can be enabled when just building the artifacts and the use case from #6765 is still satisfied by having a crate that can be linked to from Rust. Locally this reduces the size of the C API artifact for me by nearly 1M.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Oct 23 2023 at 22:23):

alexcrichton updated PR #7341.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 23 2023 at 22:23):

alexcrichton has marked PR #7341 as ready for review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 23 2023 at 22:23):

alexcrichton requested wasmtime-core-reviewers for a review on PR #7341.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 23 2023 at 22:23):

alexcrichton requested pchickey for a review on PR #7341.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 23 2023 at 22:23):

alexcrichton requested wasmtime-default-reviewers for a review on PR #7341.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 23 2023 at 22:28):

alexcrichton updated PR #7341.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 23 2023 at 23:03):

pchickey submitted PR review:

Looks good to me, my only question is the naming - would it make more sense to rename the current wasmtime-c-api crate something like wasmtime-c-api-impl so that users of wasmtime-c-api, which becomes this new trivial facade, don't need to make any changes in order to benefit from this?

view this post on Zulip Wasmtime GitHub notifications bot (Oct 24 2023 at 14:30):

alexcrichton updated PR #7341.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 24 2023 at 14:31):

alexcrichton has enabled auto merge for PR #7341.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 24 2023 at 15:59):

alexcrichton merged PR #7341.


Last updated: Nov 22 2024 at 16:03 UTC