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

Error: moleculec: not found #16

Open
jordanmack opened this issue Oct 15, 2020 · 2 comments
Open

Error: moleculec: not found #16

jordanmack opened this issue Oct 15, 2020 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@jordanmack
Copy link
Contributor

Describe the bug
A moleculec not found error occurs on c-sharedlib contracts. Molecule is not listed as a prerequisite of Capsule.

Screenshots

username@dev1:~$ capsule new project
New project "project"
Created file "capsule.toml"
Created file "deployment.toml"
Created file "README.md"
Created file "Cargo.toml"
Created file ".gitignore"
Initialized empty Git repository in /home/username/project/.git/
Created "/home/username/project"
Created tests
     Created library `tests` package
New contract "project"
     Created binary (application) `project` package
Rewrite Cargo.toml
Rewrite ckb_capsule.toml
Done
username@dev1:~$ cd project
username@dev1:~/project$ capsule new-contract sharedlib --template c-sharedlib
Setup C environment
Cloning into '/home/username/project/contracts/c/deps/ckb-c-stdlib'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 205 (delta 1), reused 4 (delta 1), pack-reused 196
Receiving objects: 100% (205/205), 108.79 KiB | 2.09 MiB/s, done.
Resolving deltas: 100% (93/93), done.
New contract "sharedlib"
Rewrite Makefile
Rewrite ckb_capsule.toml
Done
username@dev1:~/project$ capsule build
Building contract project
    Updating crates.io index
   Compiling cfg-if v0.1.10
   Compiling cc v1.0.41
   Compiling buddy-alloc v0.3.0
   Compiling molecule v0.6.0
   Compiling ckb-allocator v0.1.1
   Compiling ckb-standalone-types v0.0.1-pre.1
   Compiling ckb-std v0.6.3
   Compiling project v0.1.0 (/code/contracts/project)
    Finished dev [unoptimized + debuginfo] target(s) in 6.29s
Building contract sharedlib
curl -L -o build/blockchain.mol https://raw.githubusercontent.com/nervosnetwork/ckb/d75e4c56ffa40e17fd2fe477da3f98c5578edcd1/util/types/schemas/blockchain.mol
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2357  100  2357    0     0  21623      0 --:--:-- --:--:-- --:--:-- 21824
moleculec --language c --schema-file build/blockchain.mol > build/blockchain.h
/bin/sh: 1: moleculec: not found
make: *** [Makefile:30: build/blockchain.h] Error 127
error: process exit with code Some(2)

Additional context
Please post the following informations:

username@dev1:~/project$ capsule --version
Capsule 0.4.1 303dfcb
username@dev1:~/project$ ckb-cli --version
ckb-cli 0.35.0 (3875086 2020-08-11)username@dev1:~/project$
  • Rerun your command with RUST_BACKTRACE=1 RUST_LOG=capsule=trace environment, then post the output as a file.
username@dev1:~/project$ capsule build
Building contract project
    Updating crates.io index
   Compiling cfg-if v0.1.10
   Compiling cc v1.0.41
   Compiling buddy-alloc v0.3.0
   Compiling molecule v0.6.0
   Compiling ckb-allocator v0.1.1
   Compiling ckb-standalone-types v0.0.1-pre.1
   Compiling ckb-std v0.6.3
   Compiling project v0.1.0 (/code/contracts/project)
    Finished dev [unoptimized + debuginfo] target(s) in 6.29s
Building contract sharedlib
curl -L -o build/blockchain.mol https://raw.githubusercontent.com/nervosnetwork/ckb/d75e4c56ffa40e17fd2fe477da3f98c5578edcd1/util/types/schemas/blockchain.mol
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2357  100  2357    0     0  21623      0 --:--:-- --:--:-- --:--:-- 21824
moleculec --language c --schema-file build/blockchain.mol > build/blockchain.h
/bin/sh: 1: moleculec: not found
make: *** [Makefile:30: build/blockchain.h] Error 127
error: process exit with code Some(2)
username@dev1:~/project$ capsule --version
Capsule 0.4.1 303dfcb
username@dev1:~/project$ ckb-cli --version
ckb-cli 0.35.0 (3875086 2020-08-11)username@dev1:~/project$ cd ..
username@dev1:~$ rm -rf project
username@dev1:~$ RUST_BACKTRACE=1 RUST_LOG=capsule=trace capsule new project
New project "project"
Created file "capsule.toml"
Created file "deployment.toml"
Created file "README.md"
Created file "Cargo.toml"
Created file ".gitignore"
Initialized empty Git repository in /home/username/project/.git/
Created "/home/username/project"
Created tests
     Created library `tests` package
New contract "project"
     Created binary (application) `project` package
Rewrite Cargo.toml
Rewrite ckb_capsule.toml
Done
username@dev1:~$ cd project/
username@dev1:~/project$ RUST_BACKTRACE=1 RUST_LOG=capsule=trace capsule new-contract sharedlib --template c-sharedlib
Setup C environment
Cloning into '/home/username/project/contracts/c/deps/ckb-c-stdlib'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 205 (delta 1), reused 4 (delta 1), pack-reused 196
Receiving objects: 100% (205/205), 108.79 KiB | 1.29 MiB/s, done.
Resolving deltas: 100% (93/93), done.
New contract "sharedlib"
Rewrite Makefile
Rewrite ckb_capsule.toml
Done
username@dev1:~/project$ RUST_BACKTRACE=1 RUST_LOG=capsule=trace capsule build
Building contract project
    Updating crates.io index
   Compiling cfg-if v0.1.10
   Compiling cc v1.0.41
   Compiling buddy-alloc v0.3.0
   Compiling molecule v0.6.0
   Compiling ckb-allocator v0.1.1
   Compiling ckb-standalone-types v0.0.1-pre.1
   Compiling ckb-std v0.6.3
   Compiling project v0.1.0 (/code/contracts/project)
    Finished dev [unoptimized + debuginfo] target(s) in 6.72s
Building contract sharedlib
curl -L -o build/blockchain.mol https://raw.githubusercontent.com/nervosnetwork/ckb/d75e4c56ffa40e17fd2fe477da3f98c5578edcd1/util/types/schemas/blockchain.mol
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2357  100  2357    0     0   5572      0 --:--:-- --:--:-- --:--:--  5558
moleculec --language c --schema-file build/blockchain.mol > build/blockchain.h
/bin/sh: 1: moleculec: not found
make: *** [Makefile:30: build/blockchain.h] Error 127
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: process exit with code Some(2)

Stack backtrace:
   0: ckb_capsule::util::cli::run
   1: <ckb_capsule::recipe::c::C<R> as ckb_capsule::recipe::Recipe>::run_build
   2: capsule::run_cli
   3: capsule::main
   4: std::sys_common::backtrace::__rust_begin_short_backtrace
   5: std::rt::lang_start::{{closure}}
   6: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/7f7a1cbfd3b55daee191247770627afab09eece2/library/core/src/ops/function.rs:259
      std::panicking::try::do_call
             at /rustc/7f7a1cbfd3b55daee191247770627afab09eece2/library/std/src/panicking.rs:381
      std::panicking::try
             at /rustc/7f7a1cbfd3b55daee191247770627afab09eece2/library/std/src/panicking.rs:345
      std::panic::catch_unwind
             at /rustc/7f7a1cbfd3b55daee191247770627afab09eece2/library/std/src/panic.rs:382
      std::rt::lang_start_internal
             at /rustc/7f7a1cbfd3b55daee191247770627afab09eece2/library/std/src/rt.rs:51
   7: main
   8: __libc_start_main
   9: _start', src/bin/capsule.rs:404:17
stack backtrace:
   0: rust_begin_unwind
             at /rustc/7f7a1cbfd3b55daee191247770627afab09eece2/library/std/src/panicking.rs:483
   1: core::panicking::panic_fmt
             at /rustc/7f7a1cbfd3b55daee191247770627afab09eece2/library/core/src/panicking.rs:85
   2: core::option::expect_none_failed
             at /rustc/7f7a1cbfd3b55daee191247770627afab09eece2/library/core/src/option.rs:1234
   3: capsule::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@jjyr
Copy link
Collaborator

jjyr commented Oct 15, 2020

You can execute the following command to install moleculec:
cd contracts/c && make install-tools

Would you like to contribute a document about setup C contracts?

@jordanmack
Copy link
Contributor Author

Would you like to contribute a document about setup C contracts?

Sure, whatever I can do to help.

@blckngm blckngm added the documentation Improvements or additions to documentation label Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants