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] make build-vm2-contracts-rs failed when tried to compile a VM2 contract #5053

Open
devendran-m opened this issue Jan 7, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@devendran-m
Copy link
Contributor

Bug reported by @Jiu-hong

Bug/Issue:
When tried to run make build-vm2-contract-rs, following error occurred;

casper-node commit hash - 91fbb870e76760980c8025e1ab9b552532444e1e

Error:

.PHONY: build-vm2-contracts-rs
build-vm2-contracts-rs: $(patsubst %, build-contract-rs/%, $(VM2_CONTRACTS))

VM2_CONTRACTS    = $(shell find ./smart_contracts/contracts/vm2 -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
Running `/home/ubuntu/.rustup/toolchains/nightly-2024-07-31-x86_64-unknown-linux-gnu/bin/rustc --crate-name vm2_test_contract --edition=2021 smart_contracts/contracts/vm2/vm2-test-contract/src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=114 --crate-type bin --emit=dep-info,link -C opt-level=3 -C lto -C codegen-units=1 --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values())' -C metadata=b19c3f1a9819d7b6 -C extra-filename=-b19c3f1a9819d7b6 --out-dir /home/ubuntu/casper-node/target/wasm32-unknown-unknown/release/deps --target wasm32-unknown-unknown -C strip=debuginfo -L dependency=/home/ubuntu/casper-node/target/wasm32-unknown-unknown/release/deps -L dependency=/home/ubuntu/casper-node/target/release/deps --extern borsh=/home/ubuntu/casper-node/target/wasm32-unknown-unknown/release/deps/libborsh-335e206d018c3b6e.rlib --extern casper_macros=/home/ubuntu/casper-node/target/release/deps/libcasper_macros-709d178851f3da80.so --extern casper_sdk=/home/ubuntu/casper-node/target/wasm32-unknown-unknown/release/deps/libcasper_sdk-65cf34bf246c09e5.rlib --remap-path-prefix=/home/ubuntu/.cargo=/home/cargo --remap-path-prefix=/home/ubuntu/casper-node/smart_contracts/contracts=/dir -C link-arg=--import-memory -C link-arg=--export-table`
error[E0433]: failed to resolve: use of undeclared crate or module `vm_common`
  --> smart_contracts/contracts/vm2/vm2-test-contract/src/main.rs:20:9
   |
20 |     use vm_common::{flags::EntryPointFlags, keyspace::Keyspace, selector::Selector};
   |         ^^^^^^^^^ use of undeclared crate or module `vm_common`

error[E0425]: cannot find function `start` in module `host`
  --> smart_contracts/contracts/vm2/vm2-test-contract/src/main.rs:77:19
   |
77 |             host::start(|(name, value): (String, u32)| {
   |                   ^^^^^ not found in `host`

warning: unused import: `Contract`
 --> smart_contracts/contracts/vm2/vm2-test-contract/src/main.rs:7:29
  |
7 | use casper_macros::{casper, Contract};
  |                             ^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `casper_sdk::log`
 --> smart_contracts/contracts/vm2/vm2-test-contract/src/main.rs:8:5
  |
8 | use casper_sdk::log;
  |     ^^^^^^^^^^^^^^^

warning: unused import: `core::ptr::NonNull`
  --> smart_contracts/contracts/vm2/vm2-test-contract/src/main.rs:19:9
   |
19 |     use core::ptr::NonNull;
   |         ^^^^^^^^^^^^^^^^^^

error[E0308]: arguments to this function are incorrect
   --> smart_contracts/contracts/vm2/vm2-test-contract/src/main.rs:138:19
    |
138 |         let res = host::casper_create(None, &manifest, 0, None, None);
    |                   ^^^^^^^^^^^^^^^^^^^       ---------  - argument #3 of type `Option<&str>` is missing
    |                                             |
    |                                             unexpected argument #2 of type `&Manifest`
    |
note: function defined here
   --> /home/ubuntu/casper-node/smart_contracts/sdk/src/host.rs:173:8
@devendran-m devendran-m added the bug Something isn't working label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants