adding codegen traces

This commit is contained in:
microproofs
2024-01-13 23:21:25 -05:00
committed by KtorZ
parent 81e29539c8
commit 86146ae7f4
8 changed files with 44 additions and 15 deletions

View File

@@ -36,7 +36,7 @@ pub fn exec(
) -> miette::Result<()> {
with_project(directory.as_deref(), false, |p| {
if rebuild {
p.build(false, Tracing::NoTraces)?;
p.build(false, Tracing::NoTraces, Tracing::NoTraces)?;
}
let title = module.as_ref().map(|m| {

View File

@@ -31,7 +31,7 @@ pub fn exec(
) -> miette::Result<()> {
with_project(directory.as_deref(), false, |p| {
if rebuild {
p.build(false, Tracing::NoTraces)?;
p.build(false, Tracing::NoTraces, Tracing::NoTraces)?;
}
let title = module.as_ref().map(|m| {

View File

@@ -31,7 +31,7 @@ pub fn exec(
) -> miette::Result<()> {
with_project(directory.as_deref(), false, |p| {
if rebuild {
p.build(false, Tracing::NoTraces)?;
p.build(false, Tracing::NoTraces, Tracing::NoTraces)?;
}
let title = module.as_ref().map(|m| {

View File

@@ -22,6 +22,10 @@ pub struct Args {
/// Do not remove traces when generating code
#[clap(short, long)]
keep_traces: bool,
/// Add code gen traces when generating code
#[clap(short, long)]
code_gen_traces: bool,
}
pub fn exec(
@@ -31,15 +35,16 @@ pub fn exec(
watch,
uplc,
keep_traces,
code_gen_traces,
}: Args,
) -> miette::Result<()> {
let result = if watch {
watch_project(directory.as_deref(), watch::default_filter, 500, |p| {
p.build(uplc, keep_traces.into())
p.build(uplc, keep_traces.into(), code_gen_traces.into())
})
} else {
with_project(directory.as_deref(), deny, |p| {
p.build(uplc, keep_traces.into())
p.build(uplc, keep_traces.into(), code_gen_traces.into())
})
};

View File

@@ -37,6 +37,10 @@ pub struct Args {
/// Remove traces when generating code (including tests)
#[clap(long)]
no_traces: bool,
/// Remove code gen traces when generating code (including tests)
#[clap(long)]
no_code_gen_traces: bool,
}
pub fn exec(
@@ -48,8 +52,8 @@ pub fn exec(
match_tests,
exact_match,
no_traces,
no_code_gen_traces,
watch,
..
}: Args,
) -> miette::Result<()> {
let result = if watch {
@@ -60,6 +64,7 @@ pub fn exec(
debug,
exact_match,
(!no_traces).into(),
(!no_code_gen_traces).into(),
)
})
} else {
@@ -70,6 +75,7 @@ pub fn exec(
debug,
exact_match,
(!no_traces).into(),
(!no_code_gen_traces).into(),
)
})
};