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

cargo liquid build error #21

Open
jewelzms opened this issue Dec 19, 2022 · 2 comments
Open

cargo liquid build error #21

jewelzms opened this issue Dec 19, 2022 · 2 comments

Comments

@jewelzms
Copy link

jewelzms commented Dec 19, 2022

根据说明文档 https://liquid-doc.readthedocs.io/zh_CN/latest/docs/quickstart/prerequisite.html 配置好环境之后。

尝试编译 HelloWorld 例子合约,开始遇到 proc-macro2 等一些依赖库报错,在修改 HelloWorld 示例合约部分依赖库版本之后继续编译,提示需要 edition2021 特性,编译出现如下错误:

[1/4] 🔍  Collecting crate metadata
[2/4] 🚚  Building cargo project
error: failed to parse manifest at `/tmp/cargo-xbuildqtQwtT/Cargo.toml`

Caused by:
  feature `edition2021` is required

  consider adding `cargo-features = ["edition2021"]` to the manifest
ERROR: Building with xargo

Caused by:
    `"/home/john/.rustup/toolchains/nightly-2021-06-23-x86_64-unknown-linux-gnu/bin/cargo" "rustc" "-p" "alloc" "--release" "--manifest-path" "/tmp/cargo-xbuildqtQwtT/Cargo.toml" "--target" "wasm32-unknown-unknown" "--" "-Z" "force-unstable-if-unmarked"` failed with exit code: Some(101)

根据提示修改 Cargo.toml,在文件顶部增加 cargo-features = ["edition2021"],报错如下:

[1/4] 🔍  Collecting crate metadata
[2/4] 🚚  Building cargo project
   Compiling core v0.0.0 (/home/john/.rustup/toolchains/nightly-2021-06-23-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling compiler_builtins v0.1.45
   Compiling rustc-std-workspace-core v1.99.0 (/home/john/.rustup/toolchains/nightly-2021-06-23-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/tmp/cargo-xbuildLJMsg2)
    Finished release [optimized] target(s) in 19.60s
error[E0463]: can't find crate for `std`
  |
  = note: the `wasm32-unknown-unknown` target may not support the standard library
  = note: `std` is required by `predicates_core` because it does not declare `#![no_std]`
  = help: consider building the standard library from source with `cargo build -Zbuild-std`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `std`
  |
  = note: the `wasm32-unknown-unknown` target may not support the standard library
  = note: `std` is required by `bumpalo` because it does not declare `#![no_std]`
  = help: consider building the standard library from source with `cargo build -Zbuild-std`

error: could not compile `predicates-core`

To learn more, run the command again with --verbose.
error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: build failed
ERROR: xbuild failed with status exit status: 101

目前提供的编译链因为当时使用的版本老旧,很多库已升级(patch不兼容),使得编译链无法正常使用,似乎难以找到整套兼容的依赖。
官方有无好的解决方案,或是当时有无封装可用容器?

@jewelzms jewelzms changed the title 尝试编译 HelloWorld 示例合约失败 cargo liquid build error Dec 28, 2022
@bxq2011hust
Copy link
Collaborator

bxq2011hust commented Jan 6, 2023

WeBankBlockchain/liquid#37

尝试一下这个issue中的操作

@jewelzms
Copy link
Author

已看到最新版本对该问题的解决,非常感谢官方作者的艰苦付出,谢谢!

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

No branches or pull requests

2 participants