Selfhost: EXE path switched to Program(JSON v0) → MIR(JSON) → ny-llvmc; BuildBox opts (structured via env/array) and Bridge v1 positive canary

- selfhost_build.sh: EXE now converts Stage‑B Program(JSON v0) to MIR(JSON) via --json-file + --program-json-to-mir, then feeds ny-llvmc
- BuildBox: accept minimal opts via env or simple array parsing (alias_table, require_mods)
- Add positive v1 bridge canary: canonicalize_method_size_on_array_vm.sh (quick)
This commit is contained in:
nyash-codex
2025-11-02 18:54:16 +09:00
parent cd67911dae
commit 9c67343420
6 changed files with 71 additions and 6 deletions

View File

@ -42,6 +42,7 @@ pub fn build_command() -> Command {
.arg(Arg::new("ny-parser-pipe").long("ny-parser-pipe").help("Read Ny JSON IR v0 from stdin and execute via MIR Interpreter").action(clap::ArgAction::SetTrue))
.arg(Arg::new("json-file").long("json-file").value_name("FILE").help("Read Ny JSON IR v0 from a file and execute via MIR Interpreter"))
.arg(Arg::new("emit-mir-json").long("emit-mir-json").value_name("FILE").help("Emit MIR JSON v0 to file and exit"))
.arg(Arg::new("program-json-to-mir").long("program-json-to-mir").value_name("FILE").help("Convert Program(JSON v0) to MIR(JSON) and exit (use with --json-file)"))
.arg(Arg::new("emit-exe").long("emit-exe").value_name("FILE").help("Emit native executable via ny-llvmc and exit"))
.arg(Arg::new("emit-exe-nyrt").long("emit-exe-nyrt").value_name("DIR").help("Directory containing libnyash_kernel.a (used with --emit-exe)"))
.arg(Arg::new("emit-exe-libs").long("emit-exe-libs").value_name("FLAGS").help("Extra linker flags for ny-llvmc when emitting executable"))
@ -147,6 +148,7 @@ pub fn from_matches(matches: &ArgMatches) -> CliConfig {
build_target: matches.get_one::<String>("build-target").cloned(),
cli_usings: matches.get_many::<String>("using").map(|v| v.cloned().collect()).unwrap_or_else(|| Vec::new()),
emit_mir_json: matches.get_one::<String>("emit-mir-json").cloned(),
program_json_to_mir: matches.get_one::<String>("program-json-to-mir").cloned(),
emit_exe: matches.get_one::<String>("emit-exe").cloned(),
emit_exe_nyrt: matches.get_one::<String>("emit-exe-nyrt").cloned(),
emit_exe_libs: matches.get_one::<String>("emit-exe-libs").cloned(),

View File

@ -57,6 +57,7 @@ pub struct BuildConfig {
pub struct EmitConfig {
pub emit_cfg: Option<String>,
pub emit_mir_json: Option<String>,
pub program_json_to_mir: Option<String>,
pub emit_exe: Option<String>,
pub emit_exe_nyrt: Option<String>,
pub emit_exe_libs: Option<String>,
@ -86,4 +87,3 @@ pub struct CliGroups {
pub run_task: Option<String>,
pub load_ny_plugins: bool,
}

View File

@ -59,6 +59,7 @@ pub struct CliConfig {
pub build_target: Option<String>,
pub cli_usings: Vec<String>,
pub emit_mir_json: Option<String>,
pub program_json_to_mir: Option<String>,
pub emit_exe: Option<String>,
pub emit_exe_nyrt: Option<String>,
pub emit_exe_libs: Option<String>,
@ -118,6 +119,7 @@ impl CliConfig {
emit: EmitConfig {
emit_cfg: self.emit_cfg.clone(),
emit_mir_json: self.emit_mir_json.clone(),
program_json_to_mir: self.program_json_to_mir.clone(),
emit_exe: self.emit_exe.clone(),
emit_exe_nyrt: self.emit_exe_nyrt.clone(),
emit_exe_libs: self.emit_exe_libs.clone(),
@ -190,6 +192,7 @@ impl Default for CliConfig {
build_target: None,
cli_usings: Vec::new(),
emit_mir_json: None,
program_json_to_mir: None,
emit_exe: None,
emit_exe_nyrt: None,
emit_exe_libs: None,