Skip to content

Commit

Permalink
Merge branch 'master' into tf/remove-source-resolver
Browse files Browse the repository at this point in the history
* master: (25 commits)
  chore!: Make file manager read-only to the compiler (#3760)
  feat: Add some traits to the stdlib (#3796)
  fix: Stop issuing unused variable warnings for variables in trait definitions (#3797)
  fix(lsp): package resolution on save (#3794)
  chore: clippy fix (#3793)
  feat: Remove experimental feature warning for traits (#3783)
  fix: Allow trait method references from the trait name (#3774)
  chore: adds a new option only-acir (#3683)
  feat(lsp): add goto definition for structs (#3718)
  chore: disable code lens feature of lsp (#3789)
  chore: moving ordering to category jsons and frontmatters (#3777)
  chore(ci): use `actions/setup-node` for caching yarn dependencies (#2730)
  fix: remove `noirc_driver/aztec` feature flag in docker (#3784)
  chore: remove aztec compile time feature flag (#3596)
  chore: move debugger tests in submodule (#3780)
  feat: simplify explicit equality assertions to assert equality directly (#3708)
  fix(ssa): Handle array arguments to side effectual constrain statements (#3740)
  feat: add `prelude.nr` (#3693)
  chore: removing old docs (#3778)
  feat: avoid overflow checks on boolean multiplication (#3745)
  ...
  • Loading branch information
TomAFrench committed Dec 14, 2023
2 parents 7b35f07 + e3dcc21 commit c0a43ae
Show file tree
Hide file tree
Showing 375 changed files with 6,800 additions and 17,165 deletions.
12 changes: 6 additions & 6 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ description: Installs the workspace's yarn dependencies and caches them
runs:
using: composite
steps:
- name: Cache
uses: actions/cache@v3
id: cache
- uses: actions/setup-node@v3
id: node
with:
path: "**/node_modules"
key: yarn-v1-${{ hashFiles('**/yarn.lock') }}
node-version: 18.17.1
cache: 'yarn'
cache-dependency-path: 'yarn.lock'

- name: Install
run: yarn --immutable
shell: bash
if: steps.cache.outputs.cache-hit != 'true'
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
45 changes: 43 additions & 2 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
6 changes: 6 additions & 0 deletions compiler/fm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,17 @@ impl FileManager {
&self.file_map
}

/// Adds a source file to the [`FileManager`].
///
/// The `file_name` is expected to be relative to the [`FileManager`]'s root directory.
pub fn add_file_with_source(&mut self, file_name: &Path, source: String) -> Option<FileId> {
let file_name = self.root.join(file_name);
self.add_file_with_source_canonical_path(&file_name, source)
}

/// Adds a source file to the [`FileManager`] using a path which is not appended to the root path.
///
/// This should only be used for the stdlib as these files do not exist on the user's filesystem.
pub fn add_file_with_source_canonical_path(
&mut self,
file_name: &Path,
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 @@ -23,7 +23,4 @@ serde.workspace = true
fxhash.workspace = true
rust-embed = "6.6.0"

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

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

/// Output ACIR gzipped bytecode instead of the JSON artefact

Check warning on line 66 in compiler/noirc_driver/src/lib.rs

View workflow job for this annotation

GitHub Actions / Spellcheck / Spellcheck

Unknown word (gzipped)
#[arg(long, hide = true)]
pub only_acir: 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 @@ -137,11 +145,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 @@ -177,7 +187,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 @@ -210,7 +221,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 c0a43ae

Please sign in to comment.