Repository navigation
docs: correct what _WIT_VERSION does, and pin it to the release it describes - #276
Merged
Merged
Conversation
…scribes
The note said a mismatch "makes `get_export_index` return `None` and
every call fail". It does not, and the file itself was the
counter-example: `_WIT_VERSION` has been "3.3.0" while the pinned
v0.21.0 component exports `@3.4.0`, and it works — `version()` returns
3.4.
Measured against that component rather than reasoned about:
pin 3.0.0 / 3.3.0 / 3.4.0 / 3.5.0 / 3.11.0 -> instantiates, version() = 3.4
pin 2.4.0 / 4.0.0 -> WasmtimeError
Matching is by MAJOR, in either direction; only a different major fails.
And it fails on the IMPORT side at instantiation ("component imports
instance `rustledger:ledger/[email protected]`, but a match ..."), because
`_HOST` names the instance the linker offers — not on export lookup,
which is what the old note pointed at.
Why this matters beyond tidiness: the comment made the version string
look load-bearing for every bump, which is the wrong thing to check. A
minor bump does not require touching it. What a bump can genuinely break
is a new MANDATORY IMPORT, which no version string reveals — WIT 3.1 ->
3.2 added `host.decrypt` and made the component un-instantiable until
the linker grew the binding (#218). `update-rustledger.yml` already
holds any WIT change for human review; the question that review has to
answer is "what does the component import that `_define_host_interface`
does not define", answered with `wasm-tools component wit`, not by
comparing this constant.
Also sets the constant to 3.4.0, which is what the pinned release
actually ships. Behavior-neutral by the table above; it removes the
puzzle of why the two disagree and matches what the update workflow
would have written.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The note on
_WIT_VERSIONsaid a mismatchIt doesn't, and this file was its own counter-example:
_WIT_VERSIONhas been"3.3.0"while the pinned v0.21.0 component exports@3.4.0, and it works —version()returns3.4.Measured, not reasoned about
Against that component:
3.0.0,3.3.0,3.4.0,3.5.0,3.11.0version()= 3.42.4.0,4.0.0WasmtimeErrorMatching is by major, in either direction; only a different major fails. And
it fails on the import side at instantiation —
— because
_HOSTnames the instance the linker offers. Not on export lookup,which is where the old note pointed.
Why this is worth more than tidiness
The comment made the version string look load-bearing for every bump, which sends
a reviewer to check the wrong thing. A minor bump doesn't require touching it.
What a bump can genuinely break is a new mandatory import, which no version
string reveals: WIT 3.1 → 3.2 added
host.decryptand made the componentun-instantiable until the linker grew the binding (#218).
update-rustledger.ymlalready holds any WIT change for human review — the question that review has to
answer is "what does the component import that
_define_host_interfacedoesn'tdefine", answered with
wasm-tools component wit, not by comparing thisconstant.
Concretely: rustledger main is on WIT
3.11.0against this repo's3.4.0, whichlooks alarming under the old comment. Both import only
host, andhosthas thesame single
decryptfunction in both — so the gate will fire on that jump, butthe hazard it exists to catch isn't present.
Also
Sets the constant to
3.4.0, what the pinned release actually ships.Behaviour-neutral per the table above; it removes the puzzle of why the two
disagree and matches what the update workflow would have written.
Component-engine tests: 108 passed. Full suite unchanged at 665 passed / 1
skipped (the two locale failures reproduce on pristine
main— no compiled.mofiles when running fromsrc/).