Conversation
Bump every third-party dependency to its latest release and adapt the code to the toolchain and async API changes that broke the build: - moonbitlang/async 0.19.4 -> 0.22.1, moonbitlang/x 0.4.40 -> 0.5.5, bobzhang/toml 0.1.7 -> 0.4.3, mizchi/x 0.2.0 -> 0.6.1, mizchi/zlib 0.4.8 -> 0.4.9, mizchi/simd 0.4.1 -> 0.6.1, mizchi/llm 0.2.2 -> 0.3.2 (the old moonbitlang/x and toml releases no longer compile on the current compiler). - @http keys headers by CaseInsensitiveString: convert bit's plain String header maps at the transport boundary (bit_io_native, bit serve). - @fs.read_dir now returns an ArrayView: materialise it in the three RepoFileSystem::readdir implementations. - moonbitlang/core/strconv is empty now; use @string.parse_int / parse_int64 and drop the dead imports. - async cancellation is no longer an error and cannot be caught, so the `err if @async.is_cancellation_error(err) => raise err` guards are dead code (the function is deprecated and always returns false). Remove them and keep only the is_being_cancelled() checks. - Pin CI to the 0.10.13 compiler and bump the component pins to match. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018UDsHQQ4RZzjsqix2HYGBv
`pkf run check` runs moon check with --deny-warn, and the new compiler
adds a `fragile_catch_all` lint for `catch { err => raise err }` and for
cleanup done inside a catch-all handler (which no longer sees async
cancellation). Drop the 60 pure re-raise handlers, move the three
temp-dir / client cleanups to `errdefer`, and fix the fallout:
- two merge-state cleanup helpers no longer raise, so drop `raise Error`
- `@async.sleep` cannot fail any more, so the test doubles in
lfs_client_wbtest stop catching it
- bit_archive and bit_fast_import imported the now-empty strconv package
moon check --deny-warn --warn-list=-27-20-82 passes for native, js and
wasm.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018UDsHQQ4RZzjsqix2HYGBv
moonc 0.10.13's link-core pass overflows the default 8 MiB stack while building the debug configuration of modules/bit (an ICE reporting "Stack overflow"); the same step succeeds with `ulimit -s unlimited`, and the release build is unaffected. Apply that in the cmd-native-test job, which builds and tests cmd/bit in debug, and note it in AGENTS.md. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018UDsHQQ4RZzjsqix2HYGBv
moonc now emits `import` statements for the `#module("node:fs")` FFI
bindings that moonbitlang/x 0.5 uses, so the JS build of modules/bit is
an ES module and can no longer be loaded with `require` as bit.cjs
(js-build failed with "Cannot use import statement outside a module").
Copy the payload to npm/bit.mjs instead and import it from the ESM
wrapper (bit.js) and the bin script; update package.json exports/files,
.gitignore and the pkf task name (sync-npm-bit-mjs) to match.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018UDsHQQ4RZzjsqix2HYGBv
|
nix-build is red and I cannot fix it from this session. The job fails inside the moonbit-overlay dependency resolver with
Required fix, to be run by someone with Everything else on this PR is unaffected by the lock file. Generated by Claude Code |
The tree-shaken minimal lib bundle grew from ~163.5k to 174,458 raw / 40,265 gzip bytes with the new toolchain and dependency releases (moonbitlang/x 0.5, async 0.22); the exported surface is unchanged. Raise the raw and gzip ceilings to 180k / 44k, keeping the same kind of headroom the previous bumps left. The minimal/git-ops ratio guards are untouched (now 0.56 raw, 0.54 gzip against a 0.70 ceiling). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018UDsHQQ4RZzjsqix2HYGBv
|
cmd-native-test (cmd-bit-1) is red on The shard fails 2/242 on this branch:
The last CI run on Generated by Claude Code |
CLAUDE.md is a symlink to AGENTS.md, so the note was appended twice. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018UDsHQQ4RZzjsqix2HYGBv
The locked mooncakes index (2026-08-12) predates bobzhang/toml 0.4.3 and moonbitlang/async 0.22.1, so nix-build failed resolving the new dependency pins (`attribute '"0.4.3"' missing`). Advance moon-registry to today's index and moonbit-overlay to its current HEAD, which ships the v0.10.13+cbb11c36f toolchain the rest of CI is pinned to. moon-registry was relocked with `nix flake update`. The overlay entry was written from `nix flake prefetch` of the same revision over git (the sandbox blocks GitHub tarball downloads); the tree has no export attributes, so the NAR hash is the one the github fetcher produces. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018UDsHQQ4RZzjsqix2HYGBv
The new moonbit-overlay revision locks nixpkgs a831408e and treefmt-nix 27b3b12a; mirror them in the nested lock nodes so `nix build` does not have to rewrite flake.lock in CI. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018UDsHQQ4RZzjsqix2HYGBv
|
Update on nix-build: Generated by Claude Code |
Summary
The workspace no longer built on the current MoonBit toolchain (0.1.20260915 / moonc 0.10.13): the pinned
moonbitlang/x@0.4.40andbobzhang/toml@0.1.7fail to compile, andmoonbitlang/asyncchanged its HTTP header and cancellation APIs. This PR updates every third-party dependency to its latest release and adapts the code.Dependency bumps (
modules/*/moon.mod,component/moon.mod.json)mizchi/tempfile,mizchi/libgit2andmizchi/experimental_cryptowere already at their latest release.Code changes
@httpnow keys request/response headers byCaseInsensitiveString. bit keeps plainStringmaps in its transport-neutral interfaces and converts at the boundary (bit_io_native/http_client_native.mbt,cmd/bit/serve_http.mbt).@fs.read_dirreturns anArrayView; the threeRepoFileSystem::readdirimpls materialise it.moonbitlang/core/strconvis empty now;parse_int/parse_int64come from@string. Dead imports removed.@async.is_cancellation_erroris deprecated (it always returnsfalse). The 123err if @async.is_cancellation_error(err) => raise errguards are therefore dead code and were removed; theis_being_cancelled()checks stay.fragile_catch_alllint (new in this compiler, and fatal underpkf run check's--deny-warn): removed the 60 pure re-raisecatch { err => raise err }handlers and moved the three cleanup-in-catch sites (bit cat,bit treetemp dirs, HTTP client close) toerrdefer, which also makes them run on cancellation.importstatements for the#module("node:fs")FFI bindings that moonbitlang/x 0.5 uses, so the JS build ofmodules/bitcan no longer berequired asbit.cjs. It is now copied tonpm/bit.mjs;npm/bit.jsre-exports it andnpm/bin/bit.mjsimports it.package.jsonexports/files,.gitignoreand the pkf task (sync-npm-bit-mjs) follow.tools/verify-lib-js-treeshake.mjs; the minimal/git-ops ratio guards are unchanged and still hold (0.56 raw, 0.54 gzip vs 0.70).setup-moonbitaction now pins0.10.13+cbb11c36f(the old pin cannot compile the new dependency releases).Error: Stack overflow) when buildingmodules/bitin the debug configuration under the default 8 MiB stack. The same step succeeds withulimit -s unlimited, and the release build is unaffected. Thecmd-native-testjob now lifts the limit before building/testing, and AGENTS.md documents it.flake.lockrefreshed for nix-build:moon-registryadvanced to today's mooncakes index (the 2026-08-12 one lackedbobzhang/toml@0.4.3andmoonbitlang/async@0.22.1, failing withattribute '"0.4.3"' missing), andmoonbit-overlayto its current HEAD (86fff168, ships the v0.10.13+cbb11c36f toolchain) together with the nixpkgs/treefmt-nix pins from the overlay's own lock. The overlay entry was hashed withnix flake prefetchover git because the sandbox blocks GitHub tarball downloads; the tree has no export attributes, so it is the hash thegithub:fetcher yields.Verification
moon check --deny-warn --warn-list=-27-20-82(whatpkf run checkruns) passes for native, js and wasm (also green in CI'stestjob).moon build --target native --release modules/bitsucceeds;bit --versionruns.moon build --target native modules/bit(debug) succeeds withulimit -s unlimited; the resulting binary passes a smoke run (init,add, twocommits,status,log) and realgit fsck/git logread the repository cleanly.moon test --target nativefor every non-cmd workspace module plusmizchi/bit/tests: all pass (same loop as the CI full run; also green in CI'stestjob).moon test --target wasmfor bit_runtime, bit_diff3, bit_repo, bit_grep: pass.moon test --target js -p mizchi/bit -p mizchi/bit_lib: 361/363 pass. The two failures are the ssh-ed25519 signing tests, which shell out tossh-keygen; it is not installed in this sandbox (ssh-keygen failed with status null). They should pass on the CI runner.moon build --target js --releasefor bit_lib and bit, bun bundles,node --test tools/js-build.test.mjs tools/npm-lib.test.mjs tools/npm-cli.test.mjs): 5/5 pass; CI's js-build is green.nix flake metadata(with the overlay resolved over git) reports no pending lock changes. A full localnix buildwas not possible: the sandbox blocks the GitHub tarball downloads the other flake inputs need, so CI's nix-build is the check.node tools/check-layers.mjsandtools/check-layer-guards.shpass.Not done / follow-ups
serve_http_wbtest.mbt:41,grep_wbtest.mbt:1481). The same two tests fail identically onmain's last CI run (the Scalable Git server: phases 0–2 (HTTP listener, object store, WAL) #178 merge, old toolchain); they do not touch code this PR changes and are left for a separate fix. See the PR comment.@sys.get_env_var→@env,StringBuilder::new()→StringBuilder(), ~1.5k sites) are warning-only and left as is.🤖 Generated with Claude Code
https://claude.ai/code/session_018UDsHQQ4RZzjsqix2HYGBv