Skip to content

Commit

Permalink
Merge branch 'master' into phated/acvm-0.12.0
Browse files Browse the repository at this point in the history
* master:
  chore(ssa refactor): Add loop unrolling pass (#1364)
  chore: Add terms added in ssa refactor to `cspell` (#1385)
  chore(ssa refactor): Optimize constant `jmpif`s into `jmp`s (#1374)
  feat: Allow warnings by default (#1383)
  chore(github): Update GitHub Pull Request Template (#1370)
  chore(github): Update GitHub Bug Report Template (#1368)
  chore(ssa refactor): Update mem2reg pass to work with multiple functions and blocks (#1375)
  chore(ssa refactor): Add pass to simplify the control flow graph (#1373)
  chore(github): Update GitHub Feature Request Template (#1369)
  • Loading branch information
TomAFrench committed May 24, 2023
2 parents e93de26 + a21b251 commit 09db55c
Show file tree
Hide file tree
Showing 20 changed files with 1,478 additions and 266 deletions.
71 changes: 36 additions & 35 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Bug Report
description: File a bug report to help us improve.
description: Report an unexpected behavior.
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
## Description
Thanks for taking the time to fill out this bug report to help us improve Noir!
# Description
Thanks for taking the time to create the Issue, and welcome to the Noirot family!
- type: textarea
id: aim
attributes:
Expand All @@ -17,7 +17,7 @@ body:
- type: textarea
id: expected
attributes:
label: Expected behavior
label: Expected Behavior
description: Describe what you expected to happen.
validations:
required: true
Expand All @@ -31,7 +31,7 @@ body:
- type: textarea
id: reproduction
attributes:
label: To reproduce
label: To Reproduce
description: Describe the steps to reproduce the behavior.
value: |
1.
Expand All @@ -41,16 +41,16 @@ body:
- type: markdown
attributes:
value: |
## Environment
# Environment
Specify your versions of Noir releases used.
- type: markdown
attributes:
value: |
### Using Nargo?
## Using Nargo?
- type: dropdown
id: nargo-install
attributes:
label: Installation method
label: Installation Method
description: How did you install Nargo?
multiple: false
options:
Expand All @@ -59,40 +59,41 @@ body:
- type: input
id: nargo-version
attributes:
label: Nargo version
label: Nargo Version
description: What is the output of the `nargo --version` command?
placeholder: "nargo 0.2.0 (git version hash: e927a39dc3d6517f233509b8349dfd9c7f79471d, is dirty: false)"
placeholder: "nargo 0.6.0 (git version hash: 0181813203a9e3e46c6d8c3169ad5d25971d4282, is dirty: false)"
- type: markdown
attributes:
value: |
### Using TypeScript?
- type: input
id: noir_wasm-version
attributes:
label: "@noir-lang/noir_wasm version"
description: What is the version number? e.g. version in yarn.lock
placeholder: "0.2.0-ca986a4"
- type: input
id: barretenberg-version
attributes:
label: "@noir-lang/barretenberg version"
description: What is the version number? e.g. version in yarn.lock
placeholder: "2.19.0"
- type: input
id: aztec_backend-version
## Using TypeScript?
Please await for our new set of packages.
You can find our target release timeframe on the [Noir Roadmap](https://github.com/orgs/noir-lang/projects/1/views/16).
- type: markdown
attributes:
label: "@noir-lang/aztec_backend version"
description: What is the version number? e.g. version in yarn.lock
placeholder: "0.12.0"
value: |
# Misc
- type: textarea
id: additional
attributes:
label: Additional context
description: Please provide any additional context that may be applicable.
- type: checkboxes
id: checklist
label: Additional Context
description: Supplement further information if applicable.
- type: markdown
attributes:
label: Submission Checklist
description: For core contributors.
value: |
# Pull Request
- type: dropdown
id: pr_preference
attributes:
label: Would you like to submit a PR for this Issue?
description: Fellow contributors are happy to provide support where applicable.
options:
- label: Once I hit submit, I will assign this issue to the Project Board with the appropriate tags.
- "No"
- "Maybe"
- "Yes"
validations:
required: true
- type: textarea
id: pr_support
attributes:
label: Support Needs
description: Support from other contributors you are looking for to create a PR for this Issue.
44 changes: 29 additions & 15 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,54 @@
name: Feature request
description: Suggest an idea for this project.
name: Feature Request
description: Suggest an idea.
labels: [enhancement]
body:
- type: markdown
attributes:
value: |
## Description
Thanks for taking the time to fill out this feature request to help us improve Noir!
Thanks for taking the time to create the Issue, and welcome to the Noirot family!
- type: textarea
id: problem
attributes:
label: Problem
description: Describe the problem your suggestion sets out to solve.
description: Describe what you feel lacking. Supply code / step-by-step examples if applicable.
validations:
required: true
- type: textarea
id: solution
attributes:
label: Proposed solution
description: Describe your proposed solution.
label: Happy Case
description: Describe how you think it should work. Supply pseudocode / step-by-step examples if applicable.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives considered
description: Describe any alternative solutions you have considered.
label: Alternatives Considered
description: Describe less-happy cases you have considered, if any.
- type: textarea
id: additional
attributes:
label: Additional context
description: Please provide any additional context that may be applicable.
- type: checkboxes
id: checklist
label: Additional Context
description: Supplement further information if applicable.
- type: markdown
attributes:
value: |
## Pull Request
- type: dropdown
id: pr-preference
attributes:
label: Submission Checklist
description: For core contributors.
label: Would you like to submit a PR for this Issue?
description: Fellow contributors are happy to provide support where applicable.
multiple: false
options:
- label: Once I hit submit, I will assign this issue to the Project Board with the appropriate tags.
- "No"
- "Maybe"
- "Yes"
validations:
required: true
- type: textarea
id: pr-support
attributes:
label: Support Needs
description: Support from other contributors you are looking for to create a PR for this Issue.
60 changes: 40 additions & 20 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,56 @@
# Related issue(s)
# Description

<!-- If it does not already exist, first create a GitHub issue that describes the problem this Pull Request (PR) solves before creating the PR and link it here. -->
<!-- Thanks for taking the time to improve Noir! -->
<!-- Please fill out all fields marked with an asterisk (*). -->

Resolves # <!-- link to issue -->
## Problem\*

# Description
<!-- Describe the problem this Pull Request (PR) resolves / link to the GitHub Issue that describes the problem. -->

## Summary of changes
Resolves <!-- Link to GitHub Issue -->

<!-- Describe the changes in this PR. Point out breaking changes if any. -->
## Summary\*

## Dependency additions / changes
<!-- Describe the changes in this PR, particularly breaking changes if any. -->

<!-- If applicable. -->
This PR sets out to

## Test additions / changes
### Example

<!-- If applicable. -->
<!-- Code / step-by-step example(s) to demonstrate the effect of this PR. -->

# Checklist
Before:

- [ ] I have tested the changes locally.
- [ ] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` with default settings.
- [ ] I have [linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) this PR to the issue(s) that it resolves.
- [ ] I have reviewed the changes on GitHub, line by line.
- [ ] I have ensured all changes are covered in the description.
```
```

After:

```
```

## Documentation

## Documentation needs
- [ ] This PR requires documentation updates when merged.

<!-- If checked, list / describe what needs to be documented. -->
<!-- If checked, check one of the following: -->

# Additional context
- [ ] I will submit a noir-lang/docs PR.

<!-- If applicable. -->
<!-- Submit a PR on https://github.com/noir-lang/docs. Thank you! -->

- [ ] I will request for and support Dev Rel's help in documenting this PR.

<!-- List / highlight what should be documented. -->
<!-- Dev Rel will reach out for clarifications when needed. Thank you! -->

## Additional Context

<!-- Supplement further information if applicable. -->

# PR Checklist\*

- [ ] I have tested the changes locally.
- [ ] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
2 changes: 1 addition & 1 deletion crates/nargo_cli/src/cli/check_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ d2 = ["", "", ""]
.join(format!("{TEST_DATA_DIR}/pass_dev_mode"));

let backend = crate::backends::ConcreteBackend::default();
let config = CompileOptions { allow_warnings: true, ..Default::default() };
let config = CompileOptions { deny_warnings: false, ..Default::default() };

let paths = std::fs::read_dir(pass_dir).unwrap();
for path in paths.flatten() {
Expand Down
2 changes: 1 addition & 1 deletion crates/nargo_cli/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub fn prove_and_verify(proof_name: &str, program_dir: &Path) -> bool {
let compile_options = CompileOptions {
show_ssa: false,
print_acir: false,
allow_warnings: false,
deny_warnings: false,
show_output: false,
experimental_ssa: false,
};
Expand Down
10 changes: 5 additions & 5 deletions crates/noirc_driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ pub struct CompileOptions {
#[arg(short, long)]
pub print_acir: bool,

/// Issue a warning for each unused variable instead of an error
/// Treat all warnings as errors
#[arg(short, long)]
pub allow_warnings: bool,
pub deny_warnings: bool,

/// Display output of `println` statements
#[arg(long)]
Expand All @@ -59,7 +59,7 @@ impl Default for CompileOptions {
Self {
show_ssa: false,
print_acir: false,
allow_warnings: false,
deny_warnings: false,
show_output: true,
experimental_ssa: false,
}
Expand Down Expand Up @@ -171,7 +171,7 @@ impl Driver {
let mut errs = vec![];
CrateDefMap::collect_defs(LOCAL_CRATE, &mut self.context, &mut errs);
let error_count =
reporter::report_all(&self.context.file_manager, &errs, options.allow_warnings);
reporter::report_all(&self.context.file_manager, &errs, options.deny_warnings);
reporter::finish_report(error_count)
}

Expand Down Expand Up @@ -310,7 +310,7 @@ impl Driver {
// Errors will be shown at the call site without a stacktrace
let file = err.location.map(|loc| loc.file);
let files = &self.context.file_manager;
let error = reporter::report(files, &err.into(), file, options.allow_warnings);
let error = reporter::report(files, &err.into(), file, options.deny_warnings);
reporter::finish_report(error as u32)?;
Err(ReportedError)
}
Expand Down
16 changes: 8 additions & 8 deletions crates/noirc_errors/src/reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ impl CustomLabel {
pub fn report_all(
files: &fm::FileManager,
diagnostics: &[FileDiagnostic],
allow_warnings: bool,
deny_warnings: bool,
) -> u32 {
diagnostics
.iter()
.map(|error| report(files, &error.diagnostic, Some(error.file_id), allow_warnings) as u32)
.map(|error| report(files, &error.diagnostic, Some(error.file_id), deny_warnings) as u32)
.sum()
}

Expand All @@ -119,24 +119,24 @@ pub fn report(
files: &fm::FileManager,
custom_diagnostic: &CustomDiagnostic,
file: Option<fm::FileId>,
allow_warnings: bool,
deny_warnings: bool,
) -> bool {
let writer = StandardStream::stderr(ColorChoice::Always);
let config = codespan_reporting::term::Config::default();

let diagnostic = convert_diagnostic(custom_diagnostic, file, allow_warnings);
let diagnostic = convert_diagnostic(custom_diagnostic, file, deny_warnings);
term::emit(&mut writer.lock(), &config, files.as_simple_files(), &diagnostic).unwrap();

!allow_warnings || custom_diagnostic.is_error()
deny_warnings || custom_diagnostic.is_error()
}

fn convert_diagnostic(
cd: &CustomDiagnostic,
file: Option<fm::FileId>,
allow_warnings: bool,
deny_warnings: bool,
) -> Diagnostic<usize> {
let diagnostic = match (cd.kind, allow_warnings) {
(DiagnosticKind::Warning, true) => Diagnostic::warning(),
let diagnostic = match (cd.kind, deny_warnings) {
(DiagnosticKind::Warning, false) => Diagnostic::warning(),
_ => Diagnostic::error(),
};

Expand Down
Loading

0 comments on commit 09db55c

Please sign in to comment.