Skip to content

Commit

Permalink
Merge branch 'master' into gd/issue_2015
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
TomAFrench committed Aug 2, 2023
2 parents 355b357 + a07b8a4 commit eb48ebc
Show file tree
Hide file tree
Showing 148 changed files with 2,902 additions and 1,445 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,3 @@ result
**/target
!crates/nargo_cli/tests/test_data/*/target
!crates/nargo_cli/tests/test_data/*/target/witness.tr
!crates/nargo_cli/tests/test_data_ssa_refactor/*/target
!crates/nargo_cli/tests/test_data_ssa_refactor/*/target/witness.tr
4 changes: 3 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions crates/lsp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use lsp_types::{
InitializeParams, InitializeResult, InitializedParams, Position, PublishDiagnosticsParams,
Range, ServerCapabilities, TextDocumentSyncOptions,
};
use noirc_driver::{check_crate, create_local_crate};
use noirc_driver::{check_crate, prepare_crate};
use noirc_errors::{DiagnosticKind, FileDiagnostic};
use noirc_frontend::{
graph::{CrateGraph, CrateType},
Expand Down Expand Up @@ -190,7 +190,7 @@ fn on_code_lens_request(
}
};

let crate_id = create_local_crate(&mut context, file_path, CrateType::Binary);
let crate_id = prepare_crate(&mut context, file_path, CrateType::Binary);

// We ignore the warnings and errors produced by compilation for producing codelenses
// because we can still get the test functions even if compilation fails
Expand Down Expand Up @@ -283,7 +283,7 @@ fn on_did_save_text_document(
}
};

let crate_id = create_local_crate(&mut context, file_path, CrateType::Binary);
let crate_id = prepare_crate(&mut context, file_path, CrateType::Binary);

let mut diagnostics = Vec::new();

Expand Down
7 changes: 3 additions & 4 deletions crates/lsp/src/lib_hacky.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use lsp_types::{
InitializedParams, Position, PublishDiagnosticsParams, Range, ServerCapabilities,
TextDocumentSyncOptions,
};
use noirc_driver::{check_crate, create_local_crate, create_non_local_crate, propagate_dep};
use noirc_driver::{check_crate, prepare_crate, propagate_dep};
use noirc_errors::{DiagnosticKind, FileDiagnostic};
use noirc_frontend::{
graph::{CrateGraph, CrateId, CrateType},
Expand Down Expand Up @@ -286,7 +286,7 @@ fn create_context_at_path(
}
let nargo_toml_path = find_nearest_parent_file(&file_path, &["Nargo.toml"]);

let current_crate_id = create_local_crate(&mut context, &file_path, CrateType::Binary);
let current_crate_id = prepare_crate(&mut context, &file_path, CrateType::Binary);

// TODO(AD): undo hacky dependency resolution
if let Some(nargo_toml_path) = nargo_toml_path {
Expand All @@ -297,8 +297,7 @@ fn create_context_at_path(
.parent()
.unwrap() // TODO
.join(PathBuf::from(&dependency_path).join("src").join("lib.nr"));
let library_crate =
create_non_local_crate(&mut context, &path_to_lib, CrateType::Library);
let library_crate = prepare_crate(&mut context, &path_to_lib, CrateType::Library);
propagate_dep(&mut context, library_crate, &crate_name.parse().unwrap());
}
}
Expand Down
5 changes: 3 additions & 2 deletions crates/nargo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ rustc_version = "0.4.0"
acvm.workspace = true
noirc_abi.workspace = true
noirc_driver.workspace = true
noirc_frontend.workspace = true
iter-extended.workspace = true
toml.workspace = true
serde.workspace = true
serde_json.workspace = true
thiserror.workspace = true
noirc_errors.workspace = true
base64.workspace = true
base64.workspace = true
regex = "1.9.1"
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
// Directories
/// The directory for the `nargo contract` command output
pub(crate) const CONTRACT_DIR: &str = "contract";
pub const CONTRACT_DIR: &str = "contract";
/// The directory to store serialized circuit proofs.
pub(crate) const PROOFS_DIR: &str = "proofs";
pub const PROOFS_DIR: &str = "proofs";
/// The directory to store Noir source files
pub(crate) const SRC_DIR: &str = "src";
pub const SRC_DIR: &str = "src";
/// The directory to store circuits' serialized ACIR representations.
pub(crate) const TARGET_DIR: &str = "target";
pub const TARGET_DIR: &str = "target";

// Files
/// The file from which Nargo pulls prover inputs
pub(crate) const PROVER_INPUT_FILE: &str = "Prover";
pub const PROVER_INPUT_FILE: &str = "Prover";
/// The file from which Nargo pulls verifier inputs
pub(crate) const VERIFIER_INPUT_FILE: &str = "Verifier";
pub const VERIFIER_INPUT_FILE: &str = "Verifier";
/// The package definition file for a Noir project.
pub(crate) const PKG_FILE: &str = "Nargo.toml";
pub const PKG_FILE: &str = "Nargo.toml";

// Extensions
/// The extension for files containing circuit proofs.
pub(crate) const PROOF_EXT: &str = "proof";
pub const PROOF_EXT: &str = "proof";
/// The extension for files containing proof witnesses.
pub(crate) const WITNESS_EXT: &str = "tr";
pub const WITNESS_EXT: &str = "tr";
4 changes: 3 additions & 1 deletion crates/nargo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
//! Noir Package Manager abbreviated is npm, which is already taken.
pub mod artifacts;
pub mod constants;
mod errors;
pub mod manifest;
pub mod ops;
pub mod package;
pub mod workspace;

pub use self::errors::NargoError;
26 changes: 0 additions & 26 deletions crates/nargo/src/manifest/errors.rs

This file was deleted.

147 changes: 0 additions & 147 deletions crates/nargo/src/manifest/mod.rs

This file was deleted.

3 changes: 2 additions & 1 deletion crates/nargo/src/ops/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pub fn execute_circuit<B: BlackBoxFunctionSolver + Default>(
_backend: &B,
circuit: Circuit,
initial_witness: WitnessMap,
show_output: bool,
) -> Result<WitnessMap, NargoError> {
let mut acvm = ACVM::new(B::default(), circuit.opcodes, initial_witness);

Expand All @@ -23,7 +24,7 @@ pub fn execute_circuit<B: BlackBoxFunctionSolver + Default>(
}
ACVMStatus::Failure(error) => return Err(error.into()),
ACVMStatus::RequiresForeignCall(foreign_call) => {
let foreign_call_result = ForeignCall::execute(&foreign_call)?;
let foreign_call_result = ForeignCall::execute(&foreign_call, show_output)?;
acvm.resolve_pending_foreign_call(foreign_call_result);
}
}
Expand Down
Loading

0 comments on commit eb48ebc

Please sign in to comment.