Plugin version compatibility check against CORE_VERSION#140
Merged
Conversation
|
@RemmyAcee Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Author
|
Done, Close: #140 |
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.
Close: #118
Changes made
interface.rs
Added is_core_version_compatible(plugin_version: &str) -> bool — extracts the major version from both the plugin's declared core_version and the running CORE_VERSION, and returns true only when they match. This is the single source of truth for the compatibility rule.
Added unit tests covering: same version, different major (incompatible), same major different minor (compatible).
loader.rs
Replaced the silent println! warning with a hard anyhow::bail! that includes the plugin path, what version it was built for, what version is running, and a pointer to the docs.
The rustc ABI error message was also improved to include the plugin path and a concrete fix hint.
PluginManager::plugins now stores (Box, String) — the second field is the core_version the plugin declared, so it can be surfaced in the UI.
list_plugins() returns Vec<(&str, &str, &str)> — name, description, and built-for version.
plugin.rs
list now prints the running StarForge core version at the top.
load now prints "Built for StarForge X.Y.Z" under each loaded plugin, and also shows the core version header — so authors can immediately see whether a plugin's declared version matches what's running.
DEVELOPER_GUIDE.md
Added a new top-level section "Plugin Version Compatibility" (item 1 in the ToC) covering: how the check works, the compatibility rule table, example error messages, and a step-by-step guide for plugin authors (pin the version, use export_plugin!, rebuild on major bumps, match the toolchain).