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

[BUG] Kagami fails to generate a validator when runs outside of the repo dir #3473

Closed
0x009922 opened this issue May 12, 2023 · 2 comments
Closed
Assignees
Labels
Bug Something isn't working iroha2-dev The re-implementation of a BFT hyperledger in RUST QA-confirmed This bug is reproduced and needs a fix

Comments

@0x009922
Copy link
Contributor

OS and Environment

macOS 13.2.1 (22D68)

GIT commit hash

d7e054d

Minimum working example / Steps to reproduce

  1. Create a directory:

    mkdir test && cd test
  2. Install kagami binary there:

    cargo install --git https://github.com/hyperledger/iroha.git \
       --rev d7e054d3aca37f1a93383d2318e7b46fa76e0010 \ # or simply `--branch iroha2-dev`
       --root ./cargo-install-root \
       kagami
  3. Run compiled kagami:

    ./cargo-install-root/bin/kagami validator

Actual result

Error:
   0: Failed to construct absolute path for: ../../default_validator
   1: Expected `CARGO_MANIFEST_DIR` environment variable
   2: environment variable not found

Expected result

Expected to get the compiled wasm blob.

Logs in JSON format

N/A

Who can help to reproduce?

No response

Notes

Kagami relies to be always executed in the root of the repo:

pub fn construct_validator() -> color_eyre::Result<Vec<u8>> {
let build_dir = tempfile::tempdir()
.wrap_err("Failed to create temp dir for runtime validator output")?;
let wasm_blob = iroha_wasm_builder::Builder::new("../../default_validator")
.out_dir(build_dir.path())
.build()?
.optimize()?
.into_bytes();
Ok(wasm_blob)
}

I don't think this is correct - Kagami should be a standalone, self-contained binary with "all batteries included". So, the wasm binary should be inlined into the binary itself.

This functionality is essential for #2373, which I am working on now. Thus, I assign this issue to myself.

@0x009922 0x009922 added Bug Something isn't working iroha2-dev The re-implementation of a BFT hyperledger in RUST labels May 12, 2023
@0x009922 0x009922 self-assigned this May 12, 2023
@0x009922 0x009922 changed the title [BUG] Kagami could not generate validator when run outside of the repo dir [BUG] Kagami fails to generate a validator when runs outside of the repo dir May 12, 2023
@ilchu ilchu self-assigned this May 30, 2023
ilchu added a commit to ilchu/iroha that referenced this issue Jun 15, 2023
… `iroha` dir

Signed-off-by: Ilia Churin <churin.ilya@gmail.com>
ilchu added a commit to ilchu/iroha that referenced this issue Jun 15, 2023
… `iroha` dir

Signed-off-by: Ilia Churin <churin.ilya@gmail.com>
ilchu added a commit to ilchu/iroha that referenced this issue Jun 15, 2023
… `iroha` dir

Signed-off-by: Ilia Churin <churin.ilya@gmail.com>
ilchu added a commit to ilchu/iroha that referenced this issue Jun 21, 2023
… `iroha` dir

Signed-off-by: Ilia Churin <churin.ilya@gmail.com>
ilchu added a commit to ilchu/iroha that referenced this issue Jun 21, 2023
… `iroha` dir

Signed-off-by: Ilia Churin <churin.ilya@gmail.com>
ilchu added a commit to ilchu/iroha that referenced this issue Jun 26, 2023
… `iroha` dir

Signed-off-by: Ilia Churin <churin.ilya@gmail.com>
ilchu added a commit to ilchu/iroha that referenced this issue Jun 26, 2023
… `iroha` dir

Signed-off-by: Ilia Churin <churin.ilya@gmail.com>
ilchu added a commit to ilchu/iroha that referenced this issue Jul 7, 2023
… `iroha` dir

Signed-off-by: Ilia Churin <churin.ilya@gmail.com>
ilchu added a commit to ilchu/iroha that referenced this issue Jul 7, 2023
… `iroha` dir

Signed-off-by: Ilia Churin <churin.ilya@gmail.com>
ilchu added a commit to ilchu/iroha that referenced this issue Jul 10, 2023
… `iroha` dir

Signed-off-by: Ilia Churin <churin.ilya@gmail.com>
ilchu added a commit to ilchu/iroha that referenced this issue Jul 12, 2023
… `iroha` dir

Signed-off-by: Ilia Churin <churin.ilya@gmail.com>
appetrosyan pushed a commit to ilchu/iroha that referenced this issue Jul 12, 2023
… `iroha` dir

Signed-off-by: Ilia Churin <churin.ilya@gmail.com>
appetrosyan pushed a commit that referenced this issue Jul 12, 2023
Signed-off-by: Ilia Churin <churin.ilya@gmail.com>
@timofeevmd timofeevmd self-assigned this Jul 24, 2023
@timofeevmd
Copy link
Contributor

mac m1 test

2023-07-27 10.34.39.jpg

test on linux x86 gives the same results

@ilchu
Copy link
Contributor

ilchu commented Jul 27, 2023

mac m1 test
...
test on linux x86 gives the same results

Should be addressed by #3748.

@timofeevmd timofeevmd added the QA-confirmed This bug is reproduced and needs a fix label Aug 23, 2023
mversic pushed a commit that referenced this issue Oct 17, 2023
Signed-off-by: Ilia Churin <churin.ilya@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working iroha2-dev The re-implementation of a BFT hyperledger in RUST QA-confirmed This bug is reproduced and needs a fix
Projects
None yet
Development

No branches or pull requests

3 participants