Repository navigation
merman: migrate to merman alpha.6 - #98
Merged
Merged
Conversation
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.
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.
What broke
CI failed to compile
src/lib.rswithcannot find HeadlessRenderer in svgandcannot find HeadlessAsciiRenderer in ascii, on a branch that touched neither.Cargo.tomlasked formerman = "0.8.0-alpha.5". A caret requirement on apre-release matches the whole
0.8.0-alpha.*series, andCargo.lockisgitignored, so CI resolved fresh and picked up
0.8.0-alpha.6(published2026-09-02). That release "replaced
HeadlessRenderer,HeadlessAsciiRenderer,root
render_svg*helpers, public SVG preparation stages, and CPU-bound renderasync fnwrappers with one operation-scopedRenderer, typedRenderRequest/RenderTargetvalues, format-neutralSemanticArtifact, and cloneableOperationControl". Local builds kept passing because they had a lockfilepinning alpha.5.
Changes
src/lib.rs— both mermaid call sites move to the new facade:try_render_mermaidusesRenderRequest::svgwithSvgRequest { pipeline: Some(SvgPipeline::resvg_safe()), .. }. TheResvgSafepreset is what now carries the
ForeignObjectFallbackandStripForeignObjectstages that
render_resvg_compatible_svg_syncused to provide, so labels stillreach resvg as native
<text>instead of being silently dropped. TheOperationControlalso gets.with_deadline(MERMAID_RENDER_TIMEOUT), so a slowdiagram now actually cancels rather than leaving an orphan thread running after
recv_timeoutgives up on it.try_render_mermaid_asciiusesRenderRequest::asciiwithAsciiRenderOptions::unicode()(replacing.with_charset(AsciiCharset::Unicode))and reads
AsciiOutput.text. Behavior is unchanged, including the distinctfallback-to-code-block log messages.
tests/unit.rs—test_mermaid_svg_has_no_foreign_objectscalled the removedHeadlessRendererdirectly; migrated the same way.Cargo.toml— bumped to alpha.6 and pinned exactly (=0.8.0-alpha.6) with acomment 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'drather keep tracking alphas automatically.
Verification
cargo fmt,cargo build,cargo build --release, andcargo clippy --all-targets --all-features -- -D warningsare all clean.cargo testpasses 179 tests after deletingCargo.lockand 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, andtest_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, sogit commitfailedoutright with signing on. To re-sign:
git commit --amend -S --no-edit && git push --force-with-leaseSession transcript
Session transcript