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

Build scripts are failing #11

Open
guy-ingo opened this issue Jun 22, 2022 · 5 comments
Open

Build scripts are failing #11

guy-ingo opened this issue Jun 22, 2022 · 5 comments

Comments

@guy-ingo
Copy link

Hi,

I'm trying to build the optimalate and verify (using yarn build:optimalate in the main folder) and I'm get a problem (the example above is for optimalate):

****COMPILING CIRCUIT****
invalid output path
previous errors were found
DONE (0s)
****COMPILING C++ WITNESS GENERATION CODE****
build_optimalate.sh: 30: cd: can't cd to ../../build/optimalate/optimalate_cpp
make: *** No targets specified and no makefile found.  Stop.
DONE (0s)
****VERIFYING WITNESS****
build_optimalate.sh: 37: ./optimalate: not found
DONE (0s)
[ERROR] snarkJS: [Error: ENOENT: no such file or directory, open 'witness.wtns'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'witness.wtns'
}

I saw that there's no witness file, so I tried compiling the circuit separately. But then another problem appears when trying to run circom directly (using circom optimalate.circom --O1 --r1cs --sym --c at circom-pairing/scripts/optimalate):

thread 'main' panicked at 'Method call in file type_analysis/src/analyzers/unknown_known_analysis.rs line 216', /home/ubuntu/circom/program_structure/src/utils/environment.rs:192:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Do you know what causes this issue? (I'm using circom 2.0.4. Downgrading it to 2.0.3 did nothing)

@yi-sun
Copy link
Owner

yi-sun commented Jun 22, 2022

You may have to create a /build directory at the top level of the repo. Let me know if that resolves the issue.

@guy-ingo
Copy link
Author

Didn't work unfortunately, I get the same error that I get when I'm running circom compilation directly using circom optimalate.circom --O1 --r1cs --sym --c:

****COMPILING CIRCUIT****
thread 'main' panicked at 'Method call in file type_analysis/src/analyzers/unknown_known_analysis.rs line 216', /home/ubuntu/circom/program_structure/src/utils/environment.rs:192:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@nalinbhardwaj
Copy link
Contributor

@guy-ingo your new error is due to a circom compiler bug, see iden3/circom#57. For now, I'd recommend rolling back to an old version of circom by running git checkout 47883d9 && cargo build --release && cargo install --path circom in the circom git repo on your local

@Dimo99
Copy link

Dimo99 commented Aug 10, 2022

@nalinbhardwaj
I have tried using the iden3/circom#57 patch. But I get the following errors.

******COMPILING CIRCUIT****
error[T20460]: Typing error found
    ┌─ "/home/dimo/code/repos/circom-exercises/circom-pairing/circuits/final_exp.circom":319:20
    │
319 │     component pow2[BITLENGTH]; // pow2[i] = C(in^{2^i})
    │                    ^^^^^^^^^ The length of every array must known during the constraint generation phase**

@nalinbhardwaj
Copy link
Contributor

@Dimo99 Yeah it is intended for the static analysis code iden3 introduced to fail the circuit - I asked about fixing this behaviour in the iden3 Telegram but have yet to hear back about a response/fix (note the iden3/circom#57 patch only fixes the compiler panic, not the actual behaviour). To fix the compilation you should use a version of circom before the static analysis patch applied (by using git checkout 47883d9 && cargo build --release && cargo install --path circom on your circom repo in particular)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants