-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
In the Wasmtime meeting today, we discussed some challenges around semver support for component model packages.
Specifically, we identified two issues:
- Right now Wasmtime's semver support is overly permissive, in that it makes symbols available in all semver-compatible versions, not just starting with the version they were introduced in.
- How do we support preview/draft releases of upcoming semver-compatible versions, including treating them as semver-compatible with the last stable version? (Assuming the draft version isn't semver breaking.)
During the meeting, I proposed an approach that'd involve maintaining a side-table of symbols to add to the linker under aliases, where for each minor version we'd add all current contents of the side table to the linker aliased for that version, and additionally add all symbols introduced by that version to the table (and the linker.)
I think we could abstract that away by introducing methods on the linker along the lines of
start_semver_rangeadd_to_semver_range(which would invokeadd_to_linker)end_semver_range
As a concrete example, say we want to support versions 0.2.0, 0.2.1-DRAFT, 0.2.1, and 0.2.2 of a package. (Setting aside the question of whether we'd ever want to support a -DRAFT version in parallel to the respective stable version or any higher minor versions.) This approach would have us follow these steps:
- Call
start_semver_range - Call
add_to_semver_rangefor each symbol in0.2.0 - Call
add_to_linker(❗) for symbol in0.2.1-DRAFT - Call
add_to_semver_rangefor each symbol in0.2.1 - Call
add_to_semver_rangefor each symbol in0.2.2
I'm not particularly familiar with the workings of Wasmtime's linker, so this might not work all that well in practice—but maybe it does?