Skip to content

merman: migrate to merman alpha.6 - #98

Merged
llimllib merged 1 commit into
mainfrom
fix-merman
Sep 13, 2026
Merged

llimllib merged 1 commit into
mainfrom
fix-merman

Conversation

@llimllib

Copy link
Copy Markdown
Owner

What broke

CI failed to compile src/lib.rs with cannot find HeadlessRenderer in svg and
cannot find HeadlessAsciiRenderer in ascii, on a branch that touched neither.

Cargo.toml asked for merman = "0.8.0-alpha.5". A caret requirement on a
pre-release matches the whole 0.8.0-alpha.* series, and Cargo.lock is
gitignored, so CI resolved fresh and picked up 0.8.0-alpha.6 (published
2026-09-02). That release "replaced HeadlessRenderer, HeadlessAsciiRenderer,
root render_svg* helpers, public SVG preparation stages, and CPU-bound render
async fn wrappers with one operation-scoped Renderer, typed RenderRequest /
RenderTarget values, format-neutral SemanticArtifact, and cloneable
OperationControl". Local builds kept passing because they had a lockfile
pinning alpha.5.

Changes

src/lib.rs — both mermaid call sites move to the new facade:

  • try_render_mermaid uses RenderRequest::svg with
    SvgRequest { pipeline: Some(SvgPipeline::resvg_safe()), .. }. The ResvgSafe
    preset is what now carries the ForeignObjectFallback and StripForeignObject
    stages that render_resvg_compatible_svg_sync used to provide, so labels still
    reach resvg as native <text> instead of being silently dropped. The
    OperationControl also gets .with_deadline(MERMAID_RENDER_TIMEOUT), so a slow
    diagram now actually cancels rather than leaving an orphan thread running after
    recv_timeout gives up on it.
  • try_render_mermaid_ascii uses RenderRequest::ascii with
    AsciiRenderOptions::unicode() (replacing .with_charset(AsciiCharset::Unicode))
    and reads AsciiOutput.text. Behavior is unchanged, including the distinct
    fallback-to-code-block log messages.

tests/unit.rs — test_mermaid_svg_has_no_foreign_objects called the removed
HeadlessRenderer directly; migrated the same way.

Cargo.toml — bumped to alpha.6 and pinned exactly (=0.8.0-alpha.6) with a
comment explaining why. Without a committed lockfile, a caret requirement means the
next alpha breaks CI in exactly this way again. Happy to drop the = if you'd
rather keep tracking alphas automatically.

Verification

cargo fmt, cargo build, cargo build --release, and
cargo clippy --all-targets --all-features -- -D warnings are all clean.
cargo test passes 179 tests after deleting Cargo.lock and re-resolving,
including the guards that would catch a silently degraded pipeline:
test_mermaid_svg_has_no_foreign_objects,
test_mermaid_flowchart_labels_are_rasterized, and
test_mermaid_class_diagram_labels_are_rasterized.

Also checked by hand: a flowchart renders as unicode box-drawing without
--images, and as a kitty image with --images kitty.

Note on signing

The commit is unsigned — the sandbox cannot read ~/.ssh, so git commit failed
outright with signing on. To re-sign:

git commit --amend -S --no-edit && git push --force-with-lease

Session transcript

Session transcript

merman 0.8.0-alpha.6 replaced HeadlessRenderer, HeadlessAsciiRenderer, and
the root render_svg* helpers with a single operation-scoped Renderer, typed
RenderRequest/RenderTarget values, and cloneable OperationControl. Cargo.lock
is not committed and the requirement was a caret on a pre-release, so CI
resolved alpha.6 and failed to compile against the removed types.

Migrate both mermaid call sites:

- SVG rendering goes through RenderRequest::svg with the resvg-safe pipeline
  preset, which now carries the ForeignObjectFallback and StripForeignObject
  stages that render_resvg_compatible_svg_sync used to provide. The
  OperationControl also gets a deadline, so a slow diagram cancels instead of
  leaving an orphan thread behind after recv_timeout gives up on it.
- ASCII rendering goes through RenderRequest::ascii with
  AsciiRenderOptions::unicode(), reading AsciiOutput.text. Behavior is
  unchanged, including the distinct fallback log messages.

Pin merman exactly. Its alpha releases make breaking API changes, and without
a committed lockfile a caret requirement lets the next alpha break CI the same
way.
@llimllib llimllib changed the title merman: migrate to the alpha.6 operation-scoped API merman: migrate to merman alpha.6 Sep 13, 2026
@llimllib
llimllib merged commit 6897f5e into main Sep 13, 2026
3 checks passed
@llimllib
llimllib deleted the fix-merman branch September 13, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant