Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 28 additions & 33 deletions src/v1/05_emit_rust.dag
Original file line number Diff line number Diff line change
Expand Up @@ -17066,7 +17066,9 @@ fn emit_native_cli_driver_main_rs(crate_name: String, pipeline_module: String) -
// the reason and the trigger; this carries the geography. It divides into two parts, and only the
// first is irreducible.
//
// HOST BOUNDARY, retained by cause and not by schedule: argv (`main`, the mode dispatch's input),
// HOST BOUNDARY, retained by cause and not by schedule: argv (`main` reads it and hands it to
// v2.compiler.compile `native_driver_parse`, which decides the verb, every argv refusal and its
// status; the literal mode comparisons this main used to render are deleted),
// the source-root walk and byte reads (`collect_dag_paths`, the read into DagSourceReadWitness),
// the monotonic clock (`Instant::now`, `Instant::elapsed`), the `/proc` memory reading
// (`proc_status_kib`), the stdout/stderr writes and the exit status. Nothing in `.dag` can perform
Expand Down Expand Up @@ -17114,9 +17116,11 @@ fn emit_source_root_eval_driver_main_rs(crate_name: String, pipeline_module: Str
" native_lane_module_resolution,", "\n",
" native_lane_closure_ingest, native_lane_closure_modules, native_lane_closure_round_budget,", "\n",
" native_lane_ingest_matches_closure, native_lane_ingest_receipt, native_lane_receipt,", "\n",
" native_lane_source_facts, native_lane_universe, native_test_context_absorb,", "\n",
" native_lane_source_facts, native_lane_universe_selected, native_test_context_absorb,", "\n",
" native_test_context_finish, native_test_context_from_ingest, native_test_context_state_empty,", "\n",
" native_test_front_end_prepare,", "\n",
" native_driver_parse, native_driver_plan_exit, native_driver_plan_source_roots,", "\n",
" NativeDriverPlan, NativeDriverVerb,", "\n",
" NativeCensusModuleOutcome,", "\n",
" NativeLaneHostFacts, NativeLaneModulePreparation, NativeLaneModuleResolution,", "\n",
" NativeRouteMemberRow,", "\n",
Expand All @@ -17135,6 +17139,8 @@ fn emit_source_root_eval_driver_main_rs(crate_name: String, pipeline_module: Str
"use ", crate_name, "::v2_compiler_source_authority::\{source_root_for_storage_path, DagSourceReadWitness\};", "\n",
"use ", crate_name, "::v2_std_artifact::\{Artifact, ArtifactKind\};", "\n",
"use ", crate_name, "::v2_std_diagnostic::Outcome;", "\n",
"use ", crate_name, "::std_process::ProcessExit;", "\n",
"use ", crate_name, "::extdeps_bazel_target_pattern::TargetPattern;", "\n",
"use ", crate_name, "::std_compiler_entry::\{", "\n",
" native_driver_cost_account, native_driver_cost_remainder_tolerance_nanos,", "\n",
" native_driver_exclusive_sum, NativeDriverCostAccounting,", "\n",
Expand Down Expand Up @@ -17479,7 +17485,7 @@ fn emit_source_root_eval_driver_main_rs(crate_name: String, pipeline_module: Str
"// impossible. The pre-epoch refusal that guarded the old wall-clock read is DELETED with it,", "\n",
"// because the hazard it named cannot arise on this clock -- production handling dissolves on", "\n",
"// the climb (DESIGN section 4b(4)); no evidence is retired here, since that arm had none.", "\n",
"fn run_adjudication(facts_path: &str, source_roots: &[String]) \{", "\n",
"fn run_adjudication(facts_path: &str, pattern: Rc<TargetPattern>, source_roots: &[String]) \{", "\n",
" let driver_start = Instant::now();", "\n",
" // A MISSING GITHUB_SHA IS ABSENT, NOT \"local\" (review 64181). The receipt line carries this", "\n",
" // as the tree the measurement describes; the literal \"local\" is a plausible identity that", "\n",
Expand All @@ -17504,7 +17510,7 @@ fn emit_source_root_eval_driver_main_rs(crate_name: String, pipeline_module: Str
" // import closure of the universe's modules, which is all the front end is given.", "\n",
" let universe_started = Instant::now();", "\n",
" let source_facts = native_lane_source_facts(ingest.clone());", "\n",
" let universe = match &*native_lane_universe(ingest.clone()) \{", "\n",
" let universe = match &*native_lane_universe_selected(ingest.clone(), pattern.clone()) \{", "\n",
" Outcome::Accepted \{ value, .. \} => value.clone(),", "\n",
" Outcome::Rejected \{ diagnostics \} => \{", "\n",
" eprintln!(\"DERIVATION-REFUSED: \{diagnostics:#?\}\");", "\n",
Expand Down Expand Up @@ -17978,38 +17984,27 @@ fn emit_source_root_eval_driver_main_rs(crate_name: String, pipeline_module: Str
"\}", "\n",
"", "\n",
"fn main() \{", "\n",
" let mut args = std::env::args().skip(1);", "\n",
" let mode = match args.next() \{", "\n",
" Some(mode) => mode,", "\n",
" None => \{", "\n",
" eprintln!(\"REFUSED: no mode given -- usage: ", crate_name, " adjudicate <host-facts.tsv> <source-root>... | ", crate_name, " census <source-root>... | ", crate_name, " census-resolve <source-root>...\");", "\n",
" std::process::exit(2);", "\n",
" \}", "\n",
" \};", "\n",
" if mode == \"census\" \{", "\n",
" let source_roots: Vec<String> = args.collect();", "\n",
" run_census(&source_roots);", "\n",
" return;", "\n",
" \}", "\n",
" if mode == \"census-resolve\" \{", "\n",
" let source_roots: Vec<String> = args.collect();", "\n",
" run_census_resolve(&source_roots);", "\n",
" return;", "\n",
" let argv: Vec<String> = std::env::args().skip(1).collect();", "\n",
" let plan = native_driver_parse(Rc::new(argv.into()));", "\n",
" if let ProcessExit::ExitFailure \{ code, reason \} = &*native_driver_plan_exit(plan.clone()) \{", "\n",
" eprintln!(\"\{reason\}\");", "\n",
" std::process::exit(*code as i32);", "\n",
" \}", "\n",
" if mode == \"adjudicate\" \{", "\n",
" let facts_path = match args.next() \{", "\n",
" Some(path) => path,", "\n",
" None => \{", "\n",
" eprintln!(\"REFUSED: adjudicate takes a host facts file before the source roots\");", "\n",
" std::process::exit(2);", "\n",
" let source_roots: Vec<String> = native_driver_plan_source_roots(plan.clone()).iter().cloned().collect();", "\n",
" match &*plan \{", "\n",
" NativeDriverPlan::NativeDriverPlanRefused \{ reason, detail \} => \{", "\n",
" eprintln!(\"REFUSED: native driver plan refused (\{reason:?\}) but its exit was success -- \{detail\}\");", "\n",
" std::process::exit(70);", "\n",
" \}", "\n",
" NativeDriverPlan::NativeDriverPlanned \{ verb \} => \{", "\n",
" let verb: &NativeDriverVerb = verb;", "\n",
" match verb \{", "\n",
" NativeDriverVerb::NativeDriverCensus \{ .. \} => run_census(&source_roots),", "\n",
" NativeDriverVerb::NativeDriverCensusResolve \{ .. \} => run_census_resolve(&source_roots),", "\n",
" NativeDriverVerb::NativeDriverAdjudicate \{ facts_path, pattern, .. \} => run_adjudication(facts_path, Rc::new(TargetPattern::clone(pattern)), &source_roots),", "\n",
" \}", "\n",
" \};", "\n",
" let source_roots: Vec<String> = args.collect();", "\n",
" run_adjudication(&facts_path, &source_roots);", "\n",
" return;", "\n",
" \}", "\n",
" \}", "\n",
" eprintln!(\"REFUSED: unknown mode \{mode\} -- expected adjudicate, census or census-resolve\");", "\n",
" std::process::exit(2);", "\n",
"\}", "\n",
"\n")
}
Expand Down
10 changes: 9 additions & 1 deletion src/v1/stage0/src/cli_run/native_lane_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,15 @@ pub fn run_required_v2_native(source_roots: &[String]) -> Result<(), String> {
// 5. THE LANE RUN. The emitted binary, by explicit path, over the real source roots: it
// derives the universe, executes it, mints the receipt and judges it.
eprintln!("v2-native-route: adjudicating through the emitted compiler");
let mut args = vec!["adjudicate".to_string(), facts_file.display().to_string()];
// THE LANE ADJUDICATES ITS WHOLE UNIVERSE, so it passes the default pattern: this literal is the
// seed's mirror of `gunbc.witness_v2_native_route` `native_route_default_pattern`
// (`//v2/test/...`, which narrows nothing within the floor's universe). A narrower pattern is an
// operator's argument to the emitted binary, never this runner's.
let mut args = vec![
"adjudicate".to_string(),
facts_file.display().to_string(),
"//v2/test/...".to_string(),
];
args.extend(source_roots.iter().cloned());
let rows_file = workspace
.join("target")
Expand Down
2 changes: 1 addition & 1 deletion src/v1/stage0/src/v1_compiler_emit_rust.rs

Large diffs are not rendered by default.

Loading