Phase 20.12b: quick green + structural cleanup
- Deprecations: add warn-once for nyash.toml (runtime::deprecations); apply in plugin loader v2 (singletons/method_resolver) - Child env + runner hygiene: unify Stage‑3/quiet/disable-fallback env in test/runner; expand LLVM noise filters - Docs/branding: prefer and hako.toml in README.md/README.ja.md and smokes README - VM: implement Map.clear in MIR interpreter (boxes_map) - Stage‑B: gate bundle/alias/require smokes behind SMOKES_ENABLE_STAGEB; fix include cwd and resolve() call even for require-only cases - Core‑Direct: gate rc boundary canary behind SMOKES_ENABLE_CORE_DIRECT - Smokes: inject Stage‑3 and disable selfhost fallback for LLVM runs; filter using/* logs - Quick profile: 168/168 PASS locally This commit accelerates Phase 20.33 (80/20) by stabilizing quick suite, reducing noise, and gating heavy/experimental paths for speed.
This commit is contained in:
@ -5,7 +5,13 @@ use crate::runtime::plugin_loader_v2::enabled::{errors, host_bridge, types};
|
||||
|
||||
pub(super) fn prebirth_singletons(loader: &PluginLoaderV2) -> BidResult<()> {
|
||||
let config = loader.config.as_ref().ok_or(BidError::PluginError)?;
|
||||
let cfg_path = loader.config_path.as_deref().unwrap_or("nyash.toml");
|
||||
let cfg_path = loader
|
||||
.config_path
|
||||
.as_deref()
|
||||
.unwrap_or_else(|| if std::path::Path::new("hako.toml").exists() { "hako.toml" } else { "nyash.toml" });
|
||||
if cfg_path == "nyash.toml" && !std::path::Path::new("hako.toml").exists() {
|
||||
crate::runtime::deprecations::warn_nyash_toml_used_once();
|
||||
}
|
||||
let toml_content = errors::from_fs(std::fs::read_to_string(cfg_path))?;
|
||||
let toml_value: toml::Value = errors::from_toml(toml::from_str(&toml_content))?;
|
||||
for (lib_name, lib_def) in &config.libraries {
|
||||
@ -33,7 +39,13 @@ pub(super) fn ensure_singleton_handle(
|
||||
{
|
||||
return Ok(());
|
||||
}
|
||||
let cfg_path = loader.config_path.as_deref().unwrap_or("nyash.toml");
|
||||
let cfg_path = loader
|
||||
.config_path
|
||||
.as_deref()
|
||||
.unwrap_or_else(|| if std::path::Path::new("hako.toml").exists() { "hako.toml" } else { "nyash.toml" });
|
||||
if cfg_path == "nyash.toml" && !std::path::Path::new("hako.toml").exists() {
|
||||
crate::runtime::deprecations::warn_nyash_toml_used_once();
|
||||
}
|
||||
let toml_value: toml::Value =
|
||||
toml::from_str(&std::fs::read_to_string(cfg_path).map_err(|_| BidError::PluginError)?)
|
||||
.map_err(|_| BidError::PluginError)?;
|
||||
|
||||
@ -12,7 +12,13 @@ impl PluginLoaderV2 {
|
||||
pub(crate) fn resolve_method_id(&self, box_type: &str, method_name: &str) -> BidResult<u32> {
|
||||
// First try config mapping
|
||||
if let Some(cfg) = self.config.as_ref() {
|
||||
let cfg_path = self.config_path.as_deref().unwrap_or("nyash.toml");
|
||||
let cfg_path = self
|
||||
.config_path
|
||||
.as_deref()
|
||||
.unwrap_or_else(|| if std::path::Path::new("hako.toml").exists() { "hako.toml" } else { "nyash.toml" });
|
||||
if cfg_path == "nyash.toml" && !std::path::Path::new("hako.toml").exists() {
|
||||
crate::runtime::deprecations::warn_nyash_toml_used_once();
|
||||
}
|
||||
|
||||
// Load and parse TOML
|
||||
let toml_content = std::fs::read_to_string(cfg_path).map_err(|_| BidError::PluginError)?;
|
||||
@ -70,7 +76,13 @@ impl PluginLoaderV2 {
|
||||
/// Check if a method returns a Result type
|
||||
pub fn method_returns_result(&self, box_type: &str, method_name: &str) -> bool {
|
||||
if let Some(cfg) = self.config.as_ref() {
|
||||
let cfg_path = self.config_path.as_deref().unwrap_or("nyash.toml");
|
||||
let cfg_path = self
|
||||
.config_path
|
||||
.as_deref()
|
||||
.unwrap_or_else(|| if std::path::Path::new("hako.toml").exists() { "hako.toml" } else { "nyash.toml" });
|
||||
if cfg_path == "nyash.toml" && !std::path::Path::new("hako.toml").exists() {
|
||||
crate::runtime::deprecations::warn_nyash_toml_used_once();
|
||||
}
|
||||
|
||||
if let Ok(toml_content) = std::fs::read_to_string(cfg_path) {
|
||||
if let Ok(toml_value) = toml::from_str::<toml::Value>(&toml_content) {
|
||||
@ -96,7 +108,13 @@ impl PluginLoaderV2 {
|
||||
method_name: &str,
|
||||
) -> BidResult<(u32, u32, bool)> {
|
||||
let cfg = self.config.as_ref().ok_or(BidError::PluginError)?;
|
||||
let cfg_path = self.config_path.as_deref().unwrap_or("nyash.toml");
|
||||
let cfg_path = self
|
||||
.config_path
|
||||
.as_deref()
|
||||
.unwrap_or_else(|| if std::path::Path::new("hako.toml").exists() { "hako.toml" } else { "nyash.toml" });
|
||||
if cfg_path == "nyash.toml" && !std::path::Path::new("hako.toml").exists() {
|
||||
crate::runtime::deprecations::warn_nyash_toml_used_once();
|
||||
}
|
||||
let toml_value: toml::Value =
|
||||
toml::from_str(&std::fs::read_to_string(cfg_path).map_err(|_| BidError::PluginError)?)
|
||||
.map_err(|_| BidError::PluginError)?;
|
||||
@ -124,4 +142,4 @@ pub(super) fn get_special_method_id(method_name: &str) -> Option<u32> {
|
||||
"fini" => Some(999),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user