Skip to content

feat: modular compile-time rule packaging for embeddable MathCAT - #847

Open
salorajan wants to merge 1 commit into
daisy:mainfrom
salorajan:feat/modular-rule-packaging
Open

salorajan wants to merge 1 commit into
daisy:mainfrom
salorajan:feat/modular-rule-packaging

Conversation

@salorajan

@salorajan salorajan commented Oct 5, 2026 •

Copy link
Copy Markdown

Summary

This pull request introduces granular compile-time rule packaging flags (lang-* and braille-*) to MathCAT's build pipeline (build.rs and src/rules_archive.rs). This enables downstream applications to selectively bundle only the languages and braille codes they require when using the include-zip feature.

Benefits

  • Binary Footprint Reduction: Shrinks embedded MathCAT binary size from ~40 MB down to ~5 MB for single-language applications (e.g., English-only assistive tools).
  • 100% Backwards Compatibility: If no specific lang-* or braille-* features are passed (or lang-all / braille-all is specified), the build defaults to embedding all languages and braille codes identically to current behavior.
  • Full Coverage of Supported Languages & Braille: All active languages (de, el, en, es, fi, fr, hu, id, nb, pl, pt, ru, sv, vi, zh) and Braille codes (asciimath, cmu, french, latex, nemeth, russian, swedish, ueb, vietnam) can be enabled individually or combined into custom feature presets.
  • Embedded vs Downloadable Symmetry: package-rules binary and build.rs share identical archive construction semantics.

Changes

  1. Cargo.toml: Added lang-*, braille-*, and preset english-minimal features.
  2. src/rules_archive.rs: Added is_language_enabled() and is_braille_enabled() dynamic filtering in zip_dir().
  3. src/bin/package_rules.rs: Added unit test modular_language_and_braille_filtering verifying feature-scoped packaging.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Linux library size: 0.58 MiB (0.00%)
Revision Release liblibmathcat.so
Base (18f1cf9) 0.58 MiB (605,800 bytes)
PR (06db4a9) 0.58 MiB (605,800 bytes)
Change 0 bytes (0.00%)

Built with default features, Rust 1.96.0, and Ubuntu 24.04. Workflow run.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant