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

【Fix】 Cargo.toml file ([dependencies]) #52

Merged
merged 1 commit into from
Jan 27, 2024

Conversation

mashharuki
Copy link
Contributor

【summary】

I ran the yarn command to use zk-regex and got an error and could not compile.

After investigating the cause and modifying the dependencies in the Cargo.toml file, the compilation went through, so I proposed a pull request.

【Detials of changes】

I ChangedCargo.toml file.

I added ahash to the [dependencies] section.

  • Before

    [dependencies]
    tabbycat = { version = "0.1", features = ["attributes"], optional = true }
    fancy-regex = "0.11.0"
    petgraph = "0.6.3"
    graph-cycles = "0.1.0"
    thiserror = "1.0.40"
    serde_json = "1.0.95"
    serde = { version = "1.0.159", features = ["derive"] }
    js-sandbox = { version = "0.2.0-rc.2", git = "https://github.com/Bromeon/js-sandbox.git", tag = "0.2.0-rc.2" }
    itertools = "0.10.3"
    clap = { version = "=4.2.1", features = ["derive"] }
  • After

    [dependencies]
    tabbycat = { version = "0.1", features = ["attributes"], optional = true }
    fancy-regex = "0.11.0"
    petgraph = "0.6.3"
    graph-cycles = "0.1.0"
    thiserror = "1.0.40"
    serde_json = "1.0.95"
    serde = { version = "1.0.159", features = ["derive"] }
    js-sandbox = { version = "0.2.0-rc.2", git = "https://github.com/Bromeon/js-sandbox.git", tag = "0.2.0-rc.2" }
    itertools = "0.10.3"
    clap = { version = "=4.2.1", features = ["derive"] }
    ahash = "=0.8.4"

【Errors encountered during installation】

error[E0658]: use of unstable library feature 'build_hasher_simple_hash_one'
   --> /Users/harukikondo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ahash-0.8.7/src/random_state.rs:463:5
    |
463 | /     fn hash_one<T: Hash>(&self, x: T) -> u64 {
464 | |         RandomState::hash_one(self, x)
465 | |     }
    | |_____^
    |
    = note: see issue #86161 <https://github.com/rust-lang/rust/issues/86161> for more information
    = help: add `#![feature(build_hasher_simple_hash_one)]` to the crate attributes to enable

For more information about this error, try `rustc --explain E0658`.
error: could not compile `ahash` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `zk-regex-compiler v1.0.8 (/Users/harukikondo/git/ZKRepo/zkemail/zk-regex/packages/compiler)`, intermediate artifacts can be found at `/Users/harukikondo/git/ZKRepo/zkemail/zk-regex/target`
error Command failed with exit code 101.

Related Error is below.

rust-lang/rust#86161

【After modification】
スクリーンショット 2024-01-27 15 20 57

@Divide-By-0
Copy link
Member

Thanks for the pr and extensive documentation!

@Divide-By-0 Divide-By-0 merged commit a25646e into zkemail:main Jan 27, 2024
3 checks passed
@Divide-By-0
Copy link
Member

Divide-By-0 commented Jan 27, 2024

Wait why do tests pass in this pr but not on main branch after merging?

@mashharuki
Copy link
Contributor Author

@Divide-By-0
Copy link
Member

https://github.com/zkemail/zk-regex/actions/runs/7678245954/job/20927905346 ↑ hmm..

Do you mind fixing that?

@mashharuki
Copy link
Contributor Author

apis looks no problems..

yarn workspace v1.22.19
yarn run v1.22.19
$ cargo test
    Finished test [unoptimized + debuginfo] target(s) in 3.56s
     Running unittests src/lib.rs (/Users/harukikondo/git/ZKRepo/zk-regex/target/debug/deps/zk_regex_apis-7b4cfdfb8e84b538)

running 10 tests
test extract_substrs::test::test_email_domain_valid ... ok
test extract_substrs::test::test_email_addr_in_subject_valid ... ok
test extract_substrs::test::test_email_addr_with_name_valid2 ... ok
test extract_substrs::test::test_code_in_email_address_valid ... ok
test extract_substrs::test::test_email_addr_with_name_valid1 ... ok
test extract_substrs::test::test_email_from_all_valid ... ok
test extract_substrs::test::test_message_id_valid ... ok
test extract_substrs::test::test_body_hash_valid ... ok
test extract_substrs::test::test_email_from_addr_valid ... ok
test extract_substrs::test::test_timestamp_valid ... ok

test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s

   Doc-tests zk-regex-apis

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

✨  Done in 7.87s.
✨  Done in 8.18s.

@mashharuki
Copy link
Contributor Author

error ocurred compiler's test .

failures:

---- tests::test_gen_from_decomposed stdout ----
thread 'tests::test_gen_from_decomposed' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', packages/compiler/src/lib.rs:362:67
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    tests::test_gen_from_decomposed

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

error: test failed, to rerun pass `--lib`
error Command failed with exit code 101.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 101

But I tried run test command with RUST_BACKTRACE=1 options & test is successed

yarn workspace v1.22.19
yarn run v1.22.19
$ npx tsc && cargo test RUST_BACKTRACE=1
   Compiling zk-regex-compiler v1.0.8 (/Users/harukikondo/git/ZKRepo/zk-regex/packages/compiler)
warning: unused variable: `result`
   --> packages/compiler/src/lib.rs:550:13
    |
550 |         let result = gen_from_decomposed(
    |             ^^^^^^ help: if this is intentional, prefix it with an underscore: `_result`
    |
    = note: `#[warn(unused_variables)]` on by default

warning: `zk-regex-compiler` (lib test) generated 1 warning (run `cargo fix --lib -p zk-regex-compiler --tests` to apply 1 suggestion)
    Finished test [unoptimized + debuginfo] target(s) in 8.90s
     Running unittests src/lib.rs (/Users/harukikondo/git/ZKRepo/zk-regex/target/debug/deps/zk_regex_compiler-dec1ca4d94e16f18)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out; finished in 0.00s

     Running unittests src/bin/compiler.rs (/Users/harukikondo/git/ZKRepo/zk-regex/target/debug/deps/zk_regex-721a2069ad9e1c98)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

✨  Done in 13.16s.
✨  Done in 13.43s.

The command I ran is below

yarn workspace @zk-email/zk-regex-compiler test RUST_BACKTRACE=1

@mashharuki
Copy link
Contributor Author

I think test command is also need to fix.

@mashharuki
Copy link
Contributor Author

hmm ...

many error ocurred while executing circuit' test code.

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

Successfully merging this pull request may close these issues.

2 participants