build error when cargo build
DreamWuGit opened this issue · 1 comments
DreamWuGit commented
git clone code, do cargo build
on mac machine, first meet error:
dream@Dreams-MacBook-Pro webauthn-halo2 % cargo build
error: package `colored v2.1.0` cannot be built because it requires rustc 1.70 or newer, while the currently active rustc version is 1.68.0-nightly
Either upgrade to rustc 1.70 or newer, or use
cargo update -p colored@2.1.0 --precise ver
where `ver` is the latest version of `colored` supporting rustc 1.68.0-nightly
try to update rustc to rustc 1.81.0-nightly (59e2c01c2 2024-06-17)
then re-do cargo build
, meet new error:
Compiling url v2.5.2
Compiling halo2-ecc v0.2.2 (https://github.com/zkwebauthn/halo2-lib.git?branch=main#7be174c7)
Compiling unicase_serde v0.1.0
error[E0599]: no associated item named `NUM_BITS` found for associated type `<FpChip as FieldChip<F>>::FieldType` in the current scope
--> /Users/dream/.cargo/git/checkouts/halo2-lib-9299fbc4a3c34fae/7be174c/halo2-ecc/src/fields/fp12.rs:107:58
|
107 | const PRIME_FIELD_NUM_BITS: u32 = FpChip::FieldType::NUM_BITS;
| ^^^^^^^^ associated item not found in `<FpChip as FieldChip<F>>::FieldType`
|
= help: items from traits can only be used if the trait is in scope
help: trait `PrimeField` which provides `NUM_BITS` is implemented but not in scope; perhaps you want to import it
|
1 + use ff::PrimeField;
|
error[E0599]: no associated item named `NUM_BITS` found for associated type `<FpChip as FieldChip<F>>::FieldType` in the current scope
--> /Users/dream/.cargo/git/checkouts/halo2-lib-9299fbc4a3c34fae/7be174c/halo2-ecc/src/fields/fp2.rs:105:58
|
105 | const PRIME_FIELD_NUM_BITS: u32 = FpChip::FieldType::NUM_BITS;
| ^^^^^^^^ associated item not found in `<FpChip as FieldChip<F>>::FieldType`
|
= help: items from traits can only be used if the trait is in scope
help: trait `PrimeField` which provides `NUM_BITS` is implemented but not in scope; perhaps you want to import it
|
1 + use ff::PrimeField;
|
For more information about this error, try `rustc --explain E0599`.
error: could not compile `halo2-ecc` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
doutv commented
Try my fork https://github.com/doutv/webauthn-halo2.git
I add Cargo.lock
Specify crates version colored="2.0.0
and ahash=0.8.4