-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Use --show-output
flag on execution rather than compilation
#2116
Conversation
Converting back to a draft until I fix why the same program using |
This note in the main PR description is why I requested an update to the docs |
I think it might be confusing to describe it as " Perhaps we should allow debug builds of Noir code which doesn't enforce |
I think this might be worth it so that we don't have inconsistent functionality. I suggested this in the main PR description:
I suggested it for a separate PR though as I thought it might warrant a discussion and I mainly wanted to fix the |
Ah apologies, I didn't see you mentioned this in the PR description. Agree on it being OOS for this PR but could you add an issue for this? I'm a little concerned with users reading that they should use |
Made an issue here: #2128
Do you mean with how we currently have it that if a user has a failing compile-time constraint they will not see prints? |
Yes that's right |
--show-output
flag on execution rather than compilation
Yeah I see. I guess we should just note in the docs then that until we have a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Yeah, no issues with the PR as it stands, just want to avoid incorrect docs.
* master: chore: Use `--show-output` flag on execution rather than compilation (#2116)
* master: chore: rename `ssa_refactor` module to `ssa` (#2129) chore: Use `--show-output` flag on execution rather than compilation (#2116) fix(globals): Accurately filter literals for resolving globals (#2126) feat: Optimize away constant calls to black box functions (#1981) fix: Rename `Option::value` to `Option::_value` (#2127) feat: replace boolean `AND`s with multiplication (#1954) chore: create a `const` to hold the panic message (#2122) feat: Add support for bitshifts by distances known at runtime (#2072) feat: Add additional `BinaryOp` simplifications (#2124) fix: flattening pass no longer overwrites previously mapped condition values (#2117) chore(noirc_driver): Unify crate preparation (#2119) feat!: Support workspaces and package selection on every nargo command (#1992) chore: Make a more clear error for slices passed to std::println (#2113) feat: Implement type aliases (#2112) feat: Add `Option<T>` to noir stdlib (#1781) feat: Format strings for prints (#1952) feat(acir_gen): RecursiveAggregation opcode and updates to black box func call generation (#2097) fix: Mutating a variable no longer mutates its copy (#2057) fix: Implement `.len()` in Acir-Gen (#2077)
* master: chore: rename `ssa_refactor` module to `ssa` (#2129) chore: Use `--show-output` flag on execution rather than compilation (#2116) fix(globals): Accurately filter literals for resolving globals (#2126) feat: Optimize away constant calls to black box functions (#1981) fix: Rename `Option::value` to `Option::_value` (#2127) feat: replace boolean `AND`s with multiplication (#1954) chore: create a `const` to hold the panic message (#2122) feat: Add support for bitshifts by distances known at runtime (#2072) feat: Add additional `BinaryOp` simplifications (#2124) fix: flattening pass no longer overwrites previously mapped condition values (#2117) chore(noirc_driver): Unify crate preparation (#2119) feat!: Support workspaces and package selection on every nargo command (#1992) chore: Make a more clear error for slices passed to std::println (#2113) feat: Implement type aliases (#2112) feat: Add `Option<T>` to noir stdlib (#1781) feat: Format strings for prints (#1952) feat(acir_gen): RecursiveAggregation opcode and updates to black box func call generation (#2097) fix: Mutating a variable no longer mutates its copy (#2057) fix: Implement `.len()` in Acir-Gen (#2077)
* master: chore: rename `ssa_refactor` module to `ssa` (#2129) chore: Use `--show-output` flag on execution rather than compilation (#2116) fix(globals): Accurately filter literals for resolving globals (#2126) feat: Optimize away constant calls to black box functions (#1981) fix: Rename `Option::value` to `Option::_value` (#2127) feat: replace boolean `AND`s with multiplication (#1954) chore: create a `const` to hold the panic message (#2122) feat: Add support for bitshifts by distances known at runtime (#2072) feat: Add additional `BinaryOp` simplifications (#2124) fix: flattening pass no longer overwrites previously mapped condition values (#2117) chore(noirc_driver): Unify crate preparation (#2119)
* master: chore: replace usage of `Directive::Quotient` with brillig opcode (#1766) chore: clippy fix (#2136) feat: Initial work on rewriting closures to regular functions with hi… (#1959) chore: Decouple acir blockid from ssa valueid (#2103) chore: Initialize copy array from previous values in `array_set` (#2106) chore: rename `ssa_refactor` module to `ssa` (#2129) chore: Use `--show-output` flag on execution rather than compilation (#2116) fix(globals): Accurately filter literals for resolving globals (#2126) feat: Optimize away constant calls to black box functions (#1981)
Would this be going into v0.10.0? |
Yes, all PRs being merged currently will be going into the 0.10.0 release. |
* master: (50 commits) chore: update stale comment on `create_circuit` (#2173) chore: Replace `resolve_path` function with a trait that impls normalize (#2157) chore: clippy fix (#2174) feat!: Allow specifying new package name with `--name` flag (#2144) chore!: remove unused flags on LSP command (#2170) chore: Hide the `show_ssa` and `show_brillig` flags (#2171) chore: bump `clap` to 4.3.19 (#2167) chore: Move the long line of `nargo info` to `long_about` (#2151) chore: Refactor `normalize_path` into an API on FileManager (#2156) fix: Implement slices of structs (#2150) chore: Refreshed ACIR artifacts (#2148) chore: Rebuild ACIR test artifacts (#2147) chore: remove short flags for `--show-ssa` and `--deny-warnings` (#2141) chore: replace usage of `Directive::Quotient` with brillig opcode (#1766) chore: clippy fix (#2136) feat: Initial work on rewriting closures to regular functions with hi… (#1959) chore: Decouple acir blockid from ssa valueid (#2103) chore: Initialize copy array from previous values in `array_set` (#2106) chore: rename `ssa_refactor` module to `ssa` (#2129) chore: Use `--show-output` flag on execution rather than compilation (#2116) ...
Description
Problem*
When we moved
println
from being an ACIR opcode to a Brillig foreign call the--show-output
logic changed as we no longer need to thread the flag down to ACIR generation. We can now provide it as an execute options toexecute_circuit
.This fixes the previous logic we had where we do not print during
nargo test
but only print if specified with the--show-output
flag.I also adding reporting for compile errors inside of
run_test
. We previously were not reporting compile errors in tests and would simply fail with:Error: 1 test failed
which provides no information.I have added this test into
strings
:which now reports this:
We should make sure to advise users in the docs to use
nargo execute
if they want to debug failing constraints with println statements. This is due to every input in a test being a constant rather than a witness, so we issue an error during compilation while we only print during execution (which comes after compilation).We could consider not error'ing out on a failed constraint during test compilation, thus leaving print statements to still be executed. This should be done in a separate PR though that threads a "nargo test" compile option into the evaluator.
Summary*
Documentation
This PR requires documentation updates when merged.
Additional Context
PR Checklist*
cargo fmt
on default settings.