forked from 1b-agent/opencadstudio-upstream
feat(plugins): include rustc version in plugin compatibility gate
OpenCADStudio/plugins#901 - Record the host's rustc --version output in the embedded version_info.json. - Add rustc_version/rustc_declared/rustc_compatible to plugin manifests and release metadata, mirroring the existing acadrust gate. - Reject API v4+ plugins whose declared rustc differs from the host, with a clear one-line error message. - Propagate the rustc gate through the marketplace, install flow, and UI. - Update plugin architecture docs to describe the new ABI metadata.
This commit is contained in:
1 parent
3024869de0
commit
ed3e064a47
7 files changed
+344
-7
No files matched your search
@@ -2,6 +2,7 @@ use std::collections::BTreeMap;
|
||||
use std::env;
|
||||
use std::fs;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::Command;
|
||||
use std::time::SystemTime;
|
||||
|
||||
use cargo_lock::Lockfile;
|
||||
@@ -383,11 +384,25 @@ fn generate_version_info(out_dir: &Path) {
|
||||
.find(|p| p.name.as_str() == "acadrust")
|
||||
.expect("acadrust package in Cargo.lock");
|
||||
|
||||
let rustc_version = Command::new("rustc")
|
||||
.arg("--version")
|
||||
.output()
|
||||
.ok()
|
||||
.and_then(|o| {
|
||||
if o.status.success() {
|
||||
Some(String::from_utf8_lossy(&o.stdout).trim().to_string())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.unwrap_or_default();
|
||||
|
||||
let info = serde_json::json!({
|
||||
"ocs_version": ocs.version.to_string(),
|
||||
"ocs_plugin_api_version": env!("CARGO_PKG_VERSION"),
|
||||
"acadrust_version": acadrust.version.to_string(),
|
||||
"acadrust_source": acadrust.source.as_ref().map(|s| s.to_string()),
|
||||
"rustc_version": rustc_version,
|
||||
"api_version": 4,
|
||||
"api_version_min_supported": 2,
|
||||
"build_timestamp": build_timestamp,
|
||||
|
||||
Reference in new issue
Block a user