Skip to content

Build against the mx RAII MusicXml API - #134

Closed
webern wants to merge 1 commit into
openmusx:mainfrom
webern:m/mx-raii-api
Closed

webern wants to merge 1 commit into
openmusx:mainfrom
webern:m/mx-raii-api

Conversation

@webern

@webern webern commented Sep 13, 2026

Copy link
Copy Markdown

HOLD: not ready yet. I'm playing with some agent stuff and it overeagerly opened this before I was ready.

What

Adapts Denigma to the top of the mx stack, e930099 (webern/mx#435 "replace DocumentManager with RAII MusicXml", webern/mx#436 "carry structured location and exception cause in api errors"), and advances the MX_GIT_TAG_OR_BRANCH pin to it.

Why

mx #435 removes mx/api/DocumentManager.h and #436 reshapes ApiError (path becomes location.xmlPath, and mx gains formatError). Neither change is source-compatible, so a fixes-only PR against the current pin cannot build; the pin has to move together with the code.

Changes

  • writeMusicXmlToCallback authors and writes the document through mx::api::fromScore and MusicXml::writeToStream; errors throw std::runtime_error(mx::api::formatError(...)), replacing the file-local mxResultMessage helper.
  • Test helpers: loadScoreData loads with MusicXml::fromFile + getScore; the non-traditional key signature test writes with fromScore + writeToStream.

Verification

  • Full build and the whole suite (465 tests) pass against the local checkout of e930099 via MX_LOCAL_PATH.
  • The pin sha is pushed on webern/mx (m/mxdev-errinfo, PR #436 head), so FetchContent resolves it.

Draft until the mx stack lands

This stays a draft until webern/mx#435 and #436 merge. Once they do, the pin should be re-advanced to the merged mx main tip (this PR's code changes are expected to apply unchanged, since e930099 is the stack tip).

mx 5973bfa8..e930099 replaces DocumentManager with the RAII MusicXml
class (webern/mx#435) and reshapes ApiError to carry a structured
Location and exception cause (webern/mx#436). Neither change is
source-compatible, so the pin advances to the stack tip e930099 and the
DocumentManager call sites move to the new API:

- writeMusicXmlToCallback authors and writes the document through
  mx::api::fromScore and MusicXml::writeToStream, and the file-local
  mxResultMessage gives way to mx::api::formatError now that mx formats
  its own errors.
- the test helpers load fixtures with MusicXml::fromFile + getScore and
  write with fromScore + writeToStream.

Denigma builds clean and all 465 tests pass against the new tip. The pin
points at the unmerged top of the mx stack (m/mxdev-errinfo), so the
change is submitted as a draft until webern/mx#435 and #436 land; the pin
should then be re-advanced to the merged main tip.
@rpatters1

Copy link
Copy Markdown
Collaborator

Am holding until you undraft. Thank you for the contribution!

@webern

webern commented Sep 13, 2026

Copy link
Copy Markdown
Author

Am holding until you undraft. Thank you for the contribution!

For context, I thought I’d start “downsteaming” breaking changes and at the same time I’m trying to increase my productivity with agents. One of them misunderstood my intent of “get ready to open a denigma pr (ie once we merge stuff in mx, the obvious time to do it) with “eagerly open a pr that can’t possibly be merged yet” 😅

I’ll close this and open a new PR once I land a few breaking changes.

@webern webern closed this Sep 13, 2026
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.

2 participants