Pending a correct test of request cancellation
This commit is contained in:
@@ -163,7 +163,7 @@ pub enum Commands {
|
||||
/// Execute effectful Orchid code
|
||||
Exec {
|
||||
/// Entrypoint or startup command
|
||||
#[arg()]
|
||||
#[arg(long)]
|
||||
main: String,
|
||||
},
|
||||
}
|
||||
@@ -288,11 +288,7 @@ impl ox::SystemCtor for StdIoSystem {
|
||||
}
|
||||
impl ox::System for StdIoSystem {
|
||||
type Ctor = Self;
|
||||
async fn request<'a>(
|
||||
&self,
|
||||
_: Box<dyn ReqHandle<'a> + 'a>,
|
||||
req: ox::ReqForSystem<Self>,
|
||||
) -> Receipt<'a> {
|
||||
async fn request(&self, _: Box<dyn ReqHandle>, req: ox::ReqForSystem<Self>) -> Receipt {
|
||||
match req {}
|
||||
}
|
||||
async fn env(&self) -> Vec<ox::tree::GenMember> {
|
||||
@@ -450,20 +446,21 @@ fn main() -> io::Result<ExitCode> {
|
||||
let io_ext_init = ext_inline(io_ext_builder, ctx.clone()).await;
|
||||
let io_ext =
|
||||
Extension::new(io_ext_init, ctx.clone()).await.map_err(|e| e.to_string())?;
|
||||
let io_ctor = (io_ext.system_ctors().find(|ctor| ctor.name() == "orchid::cmd"))
|
||||
.expect("Missing command system ctor");
|
||||
let io_ctor = (io_ext.system_ctors().find(|ctor| ctor.name() == "orcx::stdio"))
|
||||
.expect("Missing io system ctor");
|
||||
let (io_root, io_system) = io_ctor.run(vec![]).await;
|
||||
root = root.merge(&io_root).await.expect("Failed to merge stdio root into tree");
|
||||
systems.push(io_system);
|
||||
extensions.push(io_ext);
|
||||
let mut crun = CmdRunner::new(&mut root, ctx.clone(), []).await;
|
||||
systems.push(crun.sys().clone());
|
||||
load_proj_if_set(&mut root, &args, ctx).await?;
|
||||
add_const_at(&mut root, ctx, &systems[..], path.clone(), is(main).await).await?;
|
||||
let expr = ExprKind::Const(path.clone()).at(SrcRange::zw(path.clone(), 0).pos());
|
||||
let mut crun = CmdRunner::new(root, ctx.clone(), [expr]).await;
|
||||
crun.push(ExprKind::Const(path.clone()).at(SrcRange::zw(path.clone(), 0).pos()));
|
||||
if !args.no_gas {
|
||||
crun.set_gas(args.gas);
|
||||
}
|
||||
match crun.execute().await {
|
||||
match crun.execute(&root).await {
|
||||
CmdEvent::Exit | CmdEvent::Settled => (),
|
||||
CmdEvent::Err(e) => println!("error: {e}"),
|
||||
CmdEvent::Gas => println!("Exceeded gas limit of {}", args.gas),
|
||||
|
||||
Reference in New Issue
Block a user