Repository navigation
refactor: share workshop-rs's built-in catalog cache - #592
Merged
Merged
Conversation
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.
Merged
2 tasks done
This was referenced Oct 19, 2026
Merged
Merged
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.
workshop-rs owns the process-wide caches for its built-in data:
Catalog::builtin_ref(wrightkit/workshop-rs#482, 1.17.0) andgameplay::data::builtin_ref(wrightkit/workshop-rs#484, 1.18.0). opy-rs duplicated both.workshop-rsfloor from^1.13.0to1.18.0. The code now requires both accessors.enums::builtin_catalog()and its privateOnceLock; callers useCatalog::builtin_ref(). Error text is still theDisplayofWorkshopError.CompilerContract.catalogborrows the shared&'static Cataloginstead of owning a clone.opy-compatpaths stop cloning the catalog on every run.compiler/settings.rsgameplay_catalog()drops its privateOnceLockand returnsgameplay::data::builtin_ref(), with the sameexpectmessage.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).