Skip to content

Fix quick-xml 0.42 build breakage + ParseKit 1.0 / anydoc plan - #52

Open
cpetersen wants to merge 2 commits into
mainfrom
fix/quick-xml-0.42
Open

cpetersen wants to merge 2 commits into
mainfrom
fix/quick-xml-0.42

Conversation

@cpetersen

Copy link
Copy Markdown
Member

Two independent commits. The first unbreaks main; the second is planning only.

1. main does not compile (e82bc41)

PR #51 (Bump quick-xml from 0.41.0 to 0.42.0) was merged 2026-09-05 with a failing build check. bundle exec rake compile has failed on main ever since, with 5 errors from two quick-xml 0.42 breaking changes:

  • LocalName now implements AsRef<str> rather than AsRef<[u8]>, so the std::str::from_utf8(...) wrapper no longer type-checks.
  • BytesText now holds an already-decoded Cow<'i, str>; decode() is gone, replaced by xml10_content() / xml11_content() / html_content().

7 insertions, 8 deletions. 334 examples, 0 failures.

Behavior is preserved — xml10_content() additionally unescapes entities, but that path is unreachable here (see the entity bug below).

The other seven recent dependabot PRs (#44#50) all merged green, so this looks like an isolated slip rather than a systemic gap. Worth confirming branch protection requires build to pass.

This commit can be fast-tracked ahead of reviewing the docs.

2. Planning docs (478ca8e)

Evaluation of anydoc and the resulting 1.0 plan. No code changes.

Doc What it covers
ANYDOC_EVALUATION.md What anydoc is, measured head-to-head against our own fixtures, and where it has no answer
PARSEKIT_1_0_PLAN.md Target architecture, ParseKit::Document API, 7-phase migration, spec-coverage plan, settled decisions
PARSEKIT_BIN_GEM.md What the parsekit-bin gem on RubyGems actually is

Headline findings

anydoc is materially better on office formats. Measured on spec/fixtures/:

Fixture parsekit today anydoc
sample.docx tables silently dropped full GFM pipe table
sample.xls RuntimeError parses correctly
sample.pptx one run-on line headings + tables per slide

Speed is a wash (~1.4ms vs ~1.0ms per doc), so correctness and structure are the argument, not performance.

Two more pre-existing bugs surfaced while planning:

  1. XML/HTML entities are silently dropped. <a>Tom &amp;amp; Jerry</a> yields "Tom Jerry". quick-xml emits entity references as a separate Event::GeneralRef (in 0.41 and 0.42) and our _ => {} arm swallows them. This matters because parse_xml is code the migration keeps — anydoc has no HTML/XML support.
  2. Two specs are load-bearing on bugs. integration_spec.rb:61 asserts the .xls failure via raise_error(/Failed to parse Excel file/); integration_spec.rb:24 checks for "Table example" (the paragraph label) but never the table's contents, which is exactly how the dropped-table bug stayed green. Both must be inverted during migration, not deleted.

Recommendation

Adopt anydoc as the office/PDF engine; keep Tesseract for images and the text/JSON/XML/HTML handlers. Drops MuPDF, docx-rs, calamine, zip, and regex; deletes ~450 of parser.rs's 630 lines; adds .doc, .rtf, .odt, .ods, .odp, .epub, .xlsb for free.

parsekit-bin

Not ours and not yankable — owned by lucas__domeij, origin ssh://github.com/Teamtailor/parsekit-bin. Verified benign: source is byte-identical to our 0.1.2 except a version string and a calamine bump, extconf.rb is unmodified, and the precompiled binary links only libSystem / libiconv / libc++ with no networking. It exists because they needed precompiled gems in Jan 2026 and we did not ship them until 0.2.0 in June. Decision: no action against them; instead add aarch64-linux to our release matrix, the one platform they ship that we do not.

🤖 Generated with Claude Code

https://claude.ai/code/session_01U2V9AiGqoaLwUQzqJAzE1q

cpetersen and others added 2 commits September 9, 2026 11:21
main has not compiled since PR #51 (Bump quick-xml 0.41.0 -> 0.42.0), which
was merged 2026-09-05 with a failing build check. Five errors from two
breaking changes in quick-xml 0.42:

  - LocalName now implements AsRef<str> rather than AsRef<[u8]>, so the
    std::str::from_utf8(...) wrapper no longer type-checks.
  - BytesText now holds an already-decoded Cow<'i, str>; decode() is gone,
    replaced by xml10_content()/xml11_content()/html_content().

Behavior is preserved. xml10_content() additionally unescapes entities, but
that is unreachable here: quick-xml emits entity references as a separate
Event::GeneralRef in both 0.41 and 0.42, and the untouched `_ => {}` arm
swallows them either way. That entity-dropping bug is pre-existing and is
tracked in docs/PARSEKIT_1_0_PLAN.md for the 1.0 work.

334 examples, 0 failures.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U2V9AiGqoaLwUQzqJAzE1q
Three planning docs ahead of the anydoc conversion:

  ANYDOC_EVALUATION.md  - what anydoc is, measured against our own fixtures,
                          where it beats parsekit and where it has no answer
                          (no OCR, no HTML/XML/JSON/text, scanned PDFs error)
  PARSEKIT_1_0_PLAN.md  - target architecture, ParseKit::Document API, phased
                          migration, spec-coverage plan, settled decisions
  PARSEKIT_BIN_GEM.md   - what the parsekit-bin gem on RubyGems actually is
                          (a benign Teamtailor fork, not ours, not yankable)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U2V9AiGqoaLwUQzqJAzE1q
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