Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Unable to build when importing crate through git #183

Closed
lonerapier opened this issue Oct 5, 2023 · 2 comments
Closed

Unable to build when importing crate through git #183

lonerapier opened this issue Oct 5, 2023 · 2 comments

Comments

@lonerapier
Copy link

Summary of Bug

Want to use grumpkin crate as it's not published yet but not able to build when importing through git, able to build from cargo package.

Get following errors:

Compiling ark-bn254 v0.4.0 (https://github.com/arkworks-rs/curves#0a64024e)
error[E0432]: unresolved import `ark_ff::AdditiveGroup`
 --> /Users/sambhav.dusad/.cargo/git/checkouts/curves-a0d652819d10cde2/0a64024/bn254/src/curves/g1.rs:7:14
  |
7 | use ark_ff::{AdditiveGroup, BigInt, Field, MontFp, PrimeField, Zero};
  |              ^^^^^^^^^^^^^ no `AdditiveGroup` in the root

error[E0432]: unresolved import `ark_ff::AdditiveGroup`
 --> /Users/sambhav.dusad/.cargo/git/checkouts/curves-a0d652819d10cde2/0a64024/bn254/src/curves/g2.rs:6:14
  |
6 | use ark_ff::{AdditiveGroup, BigInt, MontFp, PrimeField, Zero};
  |              ^^^^^^^^^^^^^ no `AdditiveGroup` in the root

error[E0438]: const `ENDO_COEFFS` is not a member of trait `GLVConfig`
  --> /Users/sambhav.dusad/.cargo/git/checkouts/curves-a0d652819d10cde2/0a64024/bn254/src/curves/g1.rs:53:5
   |
53 | /     const ENDO_COEFFS: &'static [Self::BaseField] = &[MontFp!(
54 | |         "21888242871839275220042445260109153167277707414472061641714758635765020556616"
55 | |     )];
   | |_______^ not a member of trait `GLVConfig`

error[E0438]: const `LAMBDA` is not a member of trait `GLVConfig`
  --> /Users/sambhav.dusad/.cargo/git/checkouts/curves-a0d652819d10cde2/0a64024/bn254/src/curves/g1.rs:57:5
   |
57 | /     const LAMBDA: Self::ScalarField =
58 | |         MontFp!("21888242871839275217838484774961031246154997185409878258781734729429964517155");
   | |_________________________________________________________________________________________________^ not a member of trait `GLVConfig`

error[E0438]: const `SCALAR_DECOMP_COEFFS` is not a member of trait `GLVConfig`
  --> /Users/sambhav.dusad/.cargo/git/checkouts/curves-a0d652819d10cde2/0a64024/bn254/src/curves/g1.rs:60:5
   |
60 | /     const SCALAR_DECOMP_COEFFS: [(bool, <Self::ScalarField as PrimeField>::BigInt); 4] = [
61 | |         (false, BigInt!("147946756881789319000765030803803410728")),
62 | |         (true, BigInt!("9931322734385697763")),
63 | |         (false, BigInt!("9931322734385697763")),
64 | |         (false, BigInt!("147946756881789319010696353538189108491")),
65 | |     ];
   | |______^ not a member of trait `GLVConfig`

error[E0407]: method `endomorphism_affine` is not a member of trait `GLVConfig`
  --> /Users/sambhav.dusad/.cargo/git/checkouts/curves-a0d652819d10cde2/0a64024/bn254/src/curves/g1.rs:72:5
   |
72 | /     fn endomorphism_affine(p: &Affine<Self>) -> Affine<Self> {
73 | |         let mut res = (*p).clone();
74 | |         res.x *= Self::ENDO_COEFFS[0];
75 | |         res
76 | |     }
   | |_____^ not a member of trait `GLVConfig`

Version

Latest git commit

Steps to Reproduce

tried reproducing in a minimal repo.

@slumber
Copy link
Contributor

slumber commented Oct 5, 2023

Don't forget to add patches from the repo

curves/Cargo.toml

Lines 71 to 78 in 0a64024

[patch.crates-io]
ark-ff = { git = "https://github.com/arkworks-rs/algebra/" }
ark-ec = { git = "https://github.com/arkworks-rs/algebra/" }
ark-poly = { git = "https://github.com/arkworks-rs/algebra/" }
ark-serialize = { git = "https://github.com/arkworks-rs/algebra/" }
ark-algebra-test-templates = { git = "https://github.com/arkworks-rs/algebra/" }
ark-algebra-bench-templates = { git = "https://github.com/arkworks-rs/algebra/" }
ark-r1cs-std = { git = "https://github.com/arkworks-rs/r1cs-std/" }

@lonerapier
Copy link
Author

Thanks, should've looked a little bit harder.

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

No branches or pull requests

2 participants