chore: support MoonBit 0.10.10 - #69
Merged
Merged
Conversation
`moonbitlang/protobuf@0.1.1` and `moonbitlang/async@0.19.0` no longer parse under moonc 0.10.10: loop-`else` was renamed to `nobreak` (four E3002 errors in the protobuf reader) and a function-local `struct` declaration no longer parses (seven errors in `js_async`, so the js target only). Move to `protobuf@0.1.2` and `async@0.21.1` and bump the pinned CI toolchain from 0.10.6 to 0.10.10. `moonbitlang/async/http` 0.21 keys headers by `CaseInsensitiveString`. Convert at the `@http` boundary so the `OtlpHttpClient` trait keeps plain `Map[String, String]`, and read `Retry-After` from the response with a case-insensitive lookup instead of probing two literal casings. Clear the new 0.10.10 diagnostics: E0092 `fragile_catch_all` on the three catch-all-then-reraise scope guards, and E0020 on `StringBuilder::new`. The guards now release with `defer`, so state restore and span exit also run on the async cancellation paths a catch-all will stop capturing. `errdefer` binds no error value, so `span_async` keeps a `catch` to record the error message and suppresses the lint locally. `moon info` reports no `.mbti` change. Checks pass with `--deny-warn` on native, js, wasm-gc and wasm.
Merged
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.
Why
The repo does not compile under moonc 0.10.10. Two dependencies stopped parsing, for two separate undocumented language changes:
elsewas renamed tonobreak.moonbitlang/protobuf@0.1.1usesfor ... elseinreader.mbtandasync_reader.mbt→ fourE3002parse errors.structdeclaration no longer parses.moonbitlang/async@0.19.0declares one injs_async.mbt:116→ seven errors, js only, so a native-only check would have hidden it. js is a CI target.Changes
Dependencies and toolchain
moonbitlang/protobuf0.1.1 → 0.1.2 andmoonbitlang/async0.19.0 → 0.21.1. Upstream protobuf is already at 0.1.3, but mooncakes only publishes through 0.1.2, which compiles clean and needs no call-site changes.The pinned CI toolchain in
.github/scripts/setup-moonbit.shmoves 0.10.6 →0.10.10+f8a486b6f, with digests computed from the archives. The script's layout assumptions still hold on the new tarball (nomoonxbinary shipped, so theln -sdoes not collide;internal/tccpresent) and bothmoon bundlesteps were run against it locally.HTTP headers
moonbitlang/async/http0.21 keys headers byCaseInsensitiveString, soMap[String, String]no longer type-checks at@http.post_streamor onResponse::headers. A key converts implicitly fromString; a wholeMapdoes not. Addedto_http_headersat the@httpboundary so the publicOtlpHttpClienttrait keeps plainMap[String, String].Retry-Afteris now read straight off the case-insensitive map instead of going throughparse_retry_after_ms, which probed the two literal casingsretry-afterandRetry-After. Casings such asRetry-afterare now honored.parse_retry_after_ms(Map[String, String])stays public and unchanged for callers holding a plain map.New 0.10.10 diagnostics
E0092 fragile_catch_allflagged three catch-all handlers that cleaned up and re-raised. All three now release withdefer, so state restore and span exit also run on the async cancellation paths a catch-all will stop capturing in a future compiler:span_asynccannot go all the way:errdeferruns on error and on cancellation but binds no error value, so recording the message needs acatch. The cleanup moved todefer, the handler now only inspectserr, and the lint is suppressed locally with#warnings("-fragile_catch_all")and a comment.E0020onStringBuilder::new→StringBuilder(), two sites.Audit
Nothing else in the 0.10.7 → 0.10.10 range reaches this repo. No
@immut/*,BigInt,from_octets,Deque,@diff,Iter2,Char::length,is_prefix/is_suffix,nocancelidentifier,@debug.to_repr, or:embedprebuild.@json.parseappears only in tests, over payloads we generate. Thetrim(chars=)SIMD bug needs an empty character set;env_filter's is the non-empty ASCII constant" \t\r\n".The default backend changing to wasm is a non-event here:
moon.modsetspreferred_target = "native", and CI passes--targetexplicitly. The@fscreate_modedefault flip does not reach us either — everywrite_file/opencall passescreate_modeexplicitly, and the removedcreate/truncateparameters were unused.W0079 implicit_impl_as_methodhas 98 hits behind--warn-list +implicit_impl_as_method, all onderive(...)declarations. It is disabled by default and nothing breaks yet; migrating to explicitextendblocks is left out of this change.Verification
moon check --deny-warnon native, js, wasm-gc and wasm: 0 warnings, 0 errors.moon test: native 293/293, js 280/280, wasm-gc 265/265.moon build --target native --releasegreen.moon infoproduces no.mbtidiff — the public API is unchanged.moon fmtidempotent.client_test.mbtnow has its test server sendRetry-after, a casing the old two-literal probe would have missed, so the existingretry_after_ms == Some(2000)assertion exercises the case-insensitive lookup against a live@http.Server.