Skip to content

Commit

Permalink
Merge branch 'master' into tf/use-setup-node
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray authored Dec 12, 2023
2 parents 2b43f5d + a48d562 commit fc35c2d
Show file tree
Hide file tree
Showing 357 changed files with 5,566 additions and 16,810 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/build-aztec-feature-flag.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .github/workflows/publish-es-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ jobs:
nix-cache-name: "noir"
cachix-auth-token: ${{ secrets.CACHIXAUTHTOKEN }}

- name: Enable aztec features
if: ${{ inputs.npm-tag == 'aztec' }}
run: |
echo $'\n'"default = [\"aztec\"]"$'\n' >> compiler/noirc_driver/Cargo.toml
- name: Build wasm package
run: |
nix build -L .#noir_wasm
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/test-cargo.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
name: Test cargo

on:
pull_request:
merge_group:
push:
branches:
- 'master'
- master

# This will cancel previous runs when a branch or PR is updated
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/test-js.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
name: Test JS packages

on:
pull_request:
merge_group:
push:
branches:
- 'master'
- master

# This will cancel previous runs when a branch or PR is updated
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true


jobs:
build:
Expand Down
46 changes: 43 additions & 3 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ getrandom = "0.2"


cfg-if = "1.0.0"
clap = { version = "4.3.19", features = ["derive"] }
clap = { version = "4.3.19", features = ["derive", "env"] }
codespan = { version = "0.11.1", features = ["serialization"] }
codespan-lsp = "0.11.1"
codespan-reporting = "0.11.1"
Expand All @@ -120,6 +120,7 @@ const_format = "0.2.30"
num-bigint = "0.4"
num-traits = "0.2"
similar-asserts = "1.5.0"
log = "0.4.17"

[profile.dev]
# This is required to be able to run `cargo test` in acvm_js due to the `locals exceeds maximum` error.
Expand Down
2 changes: 1 addition & 1 deletion acvm-repo/acvm_js/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ wasm-bindgen-futures.workspace = true
console_error_panic_hook.workspace = true
gloo-utils.workspace = true
js-sys.workspace = true
log.workspace = true

serde = { version = "1.0.136", features = ["derive"] }
log = "0.4.17"
wasm-logger = "0.2.0"
const-str = "0.5.5"

Expand Down
4 changes: 4 additions & 0 deletions compiler/fm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ mod file_map;
mod file_reader;

pub use file_map::{File, FileId, FileMap, PathString};

// Re-export for the lsp
pub use codespan_reporting::files as codespan_files;

use file_reader::is_stdlib_asset;
pub use file_reader::FileReader;

Expand Down
5 changes: 1 addition & 4 deletions compiler/noirc_driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,4 @@ fm.workspace = true
serde.workspace = true
fxhash.workspace = true

aztec_macros ={path = "../../aztec_macros", optional = true}

[features]
aztec = ["aztec_macros"]
aztec_macros = { path = "../../aztec_macros" }
20 changes: 14 additions & 6 deletions compiler/noirc_driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ pub struct CompileOptions {
/// Suppress warnings
#[arg(long, conflicts_with = "deny_warnings")]
pub silence_warnings: bool,

/// Disables the builtin macros being used in the compiler
#[arg(long, hide = true)]
pub disable_macros: bool,
}

/// Helper type used to signify where only warnings are expected in file diagnostics
Expand Down Expand Up @@ -121,11 +125,13 @@ pub fn check_crate(
context: &mut Context,
crate_id: CrateId,
deny_warnings: bool,
disable_macros: bool,
) -> CompilationResult<()> {
#[cfg(not(feature = "aztec"))]
let macros: Vec<&dyn MacroProcessor> = Vec::new();
#[cfg(feature = "aztec")]
let macros = vec![&aztec_macros::AztecMacro as &dyn MacroProcessor];
let macros: Vec<&dyn MacroProcessor> = if disable_macros {
vec![]
} else {
vec![&aztec_macros::AztecMacro as &dyn MacroProcessor]
};

let mut errors = vec![];
let diagnostics = CrateDefMap::collect_defs(crate_id, context, macros);
Expand Down Expand Up @@ -161,7 +167,8 @@ pub fn compile_main(
cached_program: Option<CompiledProgram>,
force_compile: bool,
) -> CompilationResult<CompiledProgram> {
let (_, mut warnings) = check_crate(context, crate_id, options.deny_warnings)?;
let (_, mut warnings) =
check_crate(context, crate_id, options.deny_warnings, options.disable_macros)?;

let main = context.get_main_function(&crate_id).ok_or_else(|| {
// TODO(#2155): This error might be a better to exist in Nargo
Expand Down Expand Up @@ -194,7 +201,8 @@ pub fn compile_contract(
crate_id: CrateId,
options: &CompileOptions,
) -> CompilationResult<CompiledContract> {
let (_, warnings) = check_crate(context, crate_id, options.deny_warnings)?;
let (_, warnings) =
check_crate(context, crate_id, options.deny_warnings, options.disable_macros)?;

// TODO: We probably want to error if contracts is empty
let contracts = context.get_all_contracts(&crate_id);
Expand Down
Loading

0 comments on commit fc35c2d

Please sign in to comment.