Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Failed to compile circuit" and no errors shown when compiling code with any errors or warnings #1645

Closed
jfecher opened this issue Jun 12, 2023 · 2 comments · Fixed by #1694
Labels
bug Something isn't working

Comments

@jfecher
Copy link
Contributor

jfecher commented Jun 12, 2023

Aim

Tried to run nargo prove --experimental-ssa on the code

fn main() -> pub u32 {
    let x = foo();
    bar(x).1
}

fn foo(){}

fn bar<T>(x: T, y: u32, z: (u32, T)) -> (T, u32) {
    (x, y + z.0)
}

Expected Behavior

Expected the code to compile and prove

Bug

The compiler errors with the only output being

Error: Failed to compile circuit

Location:
    crates/nargo_cli/src/cli/mod.rs:72:5
exit 1
@jfecher jfecher added the bug Something isn't working label Jun 12, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Jun 12, 2023
@jfecher
Copy link
Contributor Author

jfecher commented Jun 13, 2023

I've also encountered this error when compiling code that contains only warnings:

fn main() {
    assert true;
}

Here, the warning for the deprecated keyword constrain causes the check function to return the warning in the error list, and when nargo_cli sees this it maps all errors to CompilationError and discards them without reporting them.

@jfecher
Copy link
Contributor Author

jfecher commented Jun 14, 2023

After some more testing, it seems this is triggered for all errors or warnings and prevents them from being reported.

@jfecher jfecher changed the title "Failed to compile circuit" when compiling code with unit values "Failed to compile circuit" and no errors shown when compiling code with any errors or warnings Jun 14, 2023
jfecher added a commit that referenced this issue Jun 14, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant