Skip to content

refactor: share workshop-rs's built-in catalog cache - #592

Merged
Teakowa merged 2 commits into
mainfrom
refactor/shared-builtin-catalog-cache
Oct 19, 2026
Merged

Teakowa merged 2 commits into
mainfrom
refactor/shared-builtin-catalog-cache

Conversation

@e54-bot

@e54-bot e54-bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

workshop-rs owns the process-wide caches for its built-in data: Catalog::builtin_ref (wrightkit/workshop-rs#482, 1.17.0) and gameplay::data::builtin_ref (wrightkit/workshop-rs#484, 1.18.0). opy-rs duplicated both.

  • Raise the workshop-rs floor from ^1.13.0 to 1.18.0. The code now requires both accessors.
  • Remove enums::builtin_catalog() and its private OnceLock; callers use Catalog::builtin_ref(). Error text is still the Display of WorkshopError.
  • CompilerContract.catalog borrows the shared &'static Catalog instead of owning a clone.
  • Non-test opy-compat paths stop cloning the catalog on every run.
  • compiler/settings.rs gameplay_catalog() drops its private OnceLock and returns gameplay::data::builtin_ref(), with the same expect message.

Compiler output, provider wire output, and diagnostic text are unchanged.

Verification: cargo fmt --check, clippy --workspace --all-targets --all-features -D warnings, cargo test --workspace --all-targets --all-features (13 suites, including differential).

workshop-rs 1.17.0 exposes Catalog::builtin_ref(), which parses and indexes the built-in catalog once per process. Drop opy-rs's private OnceLock wrapper in enums.rs, store a &'static Catalog in CompilerContract, and borrow the shared catalog in the opy-compat binary instead of cloning it per run.
workshop-rs 1.18.0 exposes gameplay::data::builtin_ref(), which loads and validates the checked-in gameplay dataset once per process. Drop opy-rs's private OnceLock in settings.rs and borrow the shared catalog instead of caching a clone.
@Teakowa
Teakowa merged commit c459f69 into main Oct 19, 2026
6 checks passed
@Teakowa
Teakowa deleted the refactor/shared-builtin-catalog-cache branch October 19, 2026 05:12
@e54-bot e54-bot mentioned this pull request Oct 19, 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