Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
eef542e
chore: Sync to noir-lang/noir
Feb 15, 2024
46ce217
chore: Sync to noir-lang/noir
Feb 19, 2024
f441322
Merge remote-tracking branch 'origin/aztec-packages-staging' into azt…
Feb 19, 2024
4908138
chore: Sync to noir-lang/noir
Feb 19, 2024
f4f421f
Merge remote-tracking branch 'origin/aztec-packages-staging' into azt…
Feb 19, 2024
dc1d440
chore: Sync to noir-lang/noir
Feb 21, 2024
ce8b08c
Merge remote-tracking branch 'origin/aztec-packages-staging' into azt…
Feb 21, 2024
ce94592
chore: Sync to noir-lang/noir
Feb 22, 2024
e575154
Merge remote-tracking branch 'origin/aztec-packages-staging' into azt…
Feb 22, 2024
38eef18
chore: Sync to noir-lang/noir
Feb 23, 2024
b01686d
Merge remote-tracking branch 'origin/aztec-packages-staging' into azt…
Feb 23, 2024
309e42b
chore: Sync to noir-lang/noir
Feb 23, 2024
92064ec
Merge remote-tracking branch 'origin/aztec-packages-staging' into azt…
Feb 23, 2024
90bef7f
chore: Sync to noir-lang/noir
Feb 26, 2024
b93d45f
Merge remote-tracking branch 'origin/aztec-packages-staging' into azt…
Feb 26, 2024
fac5770
Merge branch 'master' into aztec-packages
TomAFrench Feb 26, 2024
5c66180
chore: replace erroneously(?) removed test case
TomAFrench Feb 26, 2024
9ff5bbc
chore: begging for aztec-packages to enforce clippy
TomAFrench Feb 26, 2024
700db76
chore: more clippy
TomAFrench Feb 26, 2024
c1a7191
chore: more clippy
TomAFrench Feb 26, 2024
be7f15b
chore: fix merge issue
TomAFrench Feb 26, 2024
a4e95c3
chore: ignore `double_verify_nested_proof` for debugger tests
TomAFrench Feb 26, 2024
3990dc5
chore: ignore `double_verify_nested_proof` for gates reports
TomAFrench Feb 26, 2024
e86de30
Update test_programs/gates_report.sh
TomAFrench Feb 26, 2024
b5cbd98
Merge branch 'master' into aztec-packages
TomAFrench Feb 26, 2024
b9ba1fe
chore: Sync to noir-lang/noir
Feb 27, 2024
6c4e1ed
Merge remote-tracking branch 'origin/aztec-packages-staging' into azt…
Feb 27, 2024
e50d06b
Merge branch 'master' into aztec-packages
TomAFrench Feb 27, 2024
93760e6
chore: update globals to be u64s
TomAFrench Feb 27, 2024
7ce73e1
format
sirasistant Feb 27, 2024
34c13f5
format test programs
sirasistant Feb 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions 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 Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM rust:bookworm
FROM rust:bullseye
WORKDIR /usr/src/noir
COPY . .
RUN ./scripts/bootstrap_native.sh

# When running the container, mount the users home directory to same location.
FROM ubuntu:lunar
FROM ubuntu:focal
# Install Tini as nargo doesn't handle signals properly.
# Install git as nargo needs it to clone.
RUN apt-get update && apt-get install -y git tini && rm -rf /var/lib/apt/lists/* && apt-get clean
COPY --from=0 /usr/src/noir/target/release/nargo /usr/src/noir/target/release/nargo
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/src/noir/target/release/nargo"]
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/src/noir/target/release/nargo"]
1 change: 1 addition & 0 deletions aztec_macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ repository.workspace = true

[dependencies]
noirc_frontend.workspace = true
noirc_errors.workspace = true
iter-extended.workspace = true
convert_case = "0.6.0"
269 changes: 237 additions & 32 deletions aztec_macros/src/lib.rs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ if [ -n "$CMD" ]; then
fi
fi

# Attempt to just pull artefacts from CI and exit on success.
./bootstrap_cache.sh && exit

./scripts/bootstrap_native.sh
./scripts/bootstrap_packages.sh
4 changes: 4 additions & 0 deletions bootstrap_cache.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -eu

[ -z "${NO_CACHE:-}" ] && type docker &> /dev/null && [ -f ~/.aws/credentials ] || exit 1

cd "$(dirname "$0")"
source ../build-system/scripts/setup_env '' '' mainframe_$USER > /dev/null

Expand All @@ -9,3 +11,5 @@ extract_repo noir-packages /usr/src/noir/packages ./
echo -e "\033[1mRetrieving nargo from remote cache...\033[0m"
extract_repo noir /usr/src/noir/target/release ./target/

remove_old_images noir-packages
remove_old_images noir
14 changes: 14 additions & 0 deletions compiler/noirc_frontend/src/hir/def_collector/dc_crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,20 @@ impl DefCollector {
// Add the current crate to the collection of DefMaps
context.def_maps.insert(crate_id, def_collector.def_map);

// TODO(#4653): generalize this function
for macro_processor in &macro_processors {
macro_processor
.process_unresolved_traits_impls(
&crate_id,
context,
&def_collector.collected_traits_impls,
&mut def_collector.collected_functions,
)
.unwrap_or_else(|(macro_err, file_id)| {
errors.push((macro_err.into(), file_id));
});
}

inject_prelude(crate_id, context, crate_root, &mut def_collector.collected_imports);
for submodule in submodules {
inject_prelude(
Expand Down
5 changes: 5 additions & 0 deletions compiler/noirc_frontend/src/hir/def_map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ impl CrateDefMap {
pub fn modules(&self) -> &Arena<ModuleData> {
&self.modules
}

pub fn modules_mut(&mut self) -> &mut Arena<ModuleData> {
&mut self.modules
}

pub fn krate(&self) -> CrateId {
self.krate
}
Expand Down
4 changes: 4 additions & 0 deletions compiler/noirc_frontend/src/hir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ impl Context<'_, '_> {
self.def_maps.get(crate_id)
}

pub fn def_map_mut(&mut self, crate_id: &CrateId) -> Option<&mut CrateDefMap> {
self.def_maps.get_mut(crate_id)
}

/// Return the CrateId for each crate that has been compiled
/// successfully
pub fn crates(&self) -> impl Iterator<Item = CrateId> + '_ {
Expand Down
11 changes: 11 additions & 0 deletions compiler/noirc_frontend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub mod macros_api {
pub use noirc_errors::Span;

pub use crate::graph::CrateId;
use crate::hir::def_collector::dc_crate::{UnresolvedFunctions, UnresolvedTraitImpl};
pub use crate::hir::def_collector::errors::MacroError;
pub use crate::hir_def::expr::{HirExpression, HirLiteral};
pub use crate::hir_def::stmt::HirStatement;
Expand Down Expand Up @@ -74,6 +75,16 @@ pub mod macros_api {
crate_id: &CrateId,
context: &HirContext,
) -> Result<SortedModule, (MacroError, FileId)>;

// TODO(#4653): generalize this function
fn process_unresolved_traits_impls(
&self,
_crate_id: &CrateId,
_context: &mut HirContext,
_unresolved_traits_impls: &[UnresolvedTraitImpl],
_collected_functions: &mut Vec<UnresolvedFunctions>,
) -> Result<(), (MacroError, FileId)>;

/// Function to manipulate the AST after type checking has been completed.
/// The AST after type checking has been done is called the HIR.
fn process_typed_ast(
Expand Down
2 changes: 1 addition & 1 deletion compiler/noirc_frontend/src/node_interner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ impl TraitId {
}

#[derive(Debug, Eq, PartialEq, Hash, Clone, Copy)]
pub struct TraitImplId(usize);
pub struct TraitImplId(pub usize);

#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct TraitMethodId {
Expand Down
Loading