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 出错 #42

Closed
2473o opened this issue Feb 6, 2024 · 8 comments
Closed

cargo liquid build 出错 #42

2473o opened this issue Feb 6, 2024 · 8 comments

Comments

@2473o
Copy link

2473o commented Feb 6, 2024

如下所示:

root@119bcf939882:~/hello_world# cargo liquid build
[1/4] d(・ω・d) Collecting crate metadata
[2/4] (∫・ω・)∫ Building cargo project
[3/4] ∇(・ω・∇) Optimizing Wasm bytecode
ERROR: Loading original wasm file '/root/hello_world/target/wasm32-unknown-unknown/release/deps/hello_world.wasm'

Caused by:
    Unknown opcode 192

修改内容:

注释 
liquid-efa081b34c5597c9/c678d95/primitives/src/types/fixed_size_bytes.rs
218 | | seq!(N in 1..=32 {
219 | |     impl_bytes_from_bytes!(
220 | |         #(Bytes#N as Bytes{+1#N => 32},)*
221 | |     );
222 | | });

版本

rustc 1.70.0-nightly (84dd17b56 2023-04-14)
cargo 1.70.0-nightly (84b7041fd 2023-04-13)

toolchain

nightly-2023-04-15-x86_64-unknown-linux-gnu (default)
@2473o
Copy link
Author

2473o commented Feb 6, 2024

注释是因为测试不通过

root@119bcf939882:~/hello_world# cargo test
……
error: proc macro panicked
   --> /root/.cargo/git/checkouts/liquid-efa081b34c5597c9/c678d95/primitives/src/types/fixed_size_bytes.rs:218:2
    |
218 | /  seq!(N in 1..=32 {
219 | |      impl_bytes_from_bytes!(
220 | |          #(Bytes#N as Bytes{+1#N => 32},)*
221 | |     );
222 | | });
    | |__^
    |
    = help: message: called `Option::unwrap()` on a `None` value

error: could not compile `liquid_primitives` (lib) due to previous error

@miao1108
Copy link

请问您解决这个问题了嘛,如果解决啦是怎么解决的呢

@2473o
Copy link
Author

2473o commented Mar 20, 2024

请问您解决这个问题了嘛,如果解决啦是怎么解决的呢

没,建议你去官方群里问问小助手

@miao1108
Copy link

请问您解决这个问题了嘛,如果解决啦是怎么解决的呢

没,建议你去官方群里问问小助手

好滴,谢谢你哇

@2473o
Copy link
Author

2473o commented Mar 31, 2024

关联问题 WeBankBlockchain/cargo-liquid#28 (comment)

@2473o 2473o changed the title cargo liquid build 报错 cargo liquid build 出错 Mar 31, 2024
@bxq2011hust
Copy link
Collaborator

rust-lang/rust#109807
CosmWasm/cosmwasm#1727
应该是1.70+的工具链生成的wasm二进制带了mvp以外的opcode

@bxq2011hust
Copy link
Collaborator

rust-lang/rust#109807 CosmWasm/cosmwasm#1727 应该是1.70+的工具链生成的wasm二进制带了mvp以外的opcode

可以尝试按装下面我修改后的cargo-liquid工具,然后再cargo liquid build试试

cargo install --git https://github.com/bxq2011hust/cargo-liquid --branch main --force

@2473o
Copy link
Author

2473o commented Jun 11, 2024

我的环境是 ubuntu 22.04 server LTS,这个仓库的Binaryen wasm-opt 不带--signext-lowering, 可以从binaryen下载
还有就是修改下template下的rust-toolchain.toml ,内容还是channel = "nightly-2023-01-03"🙂

rust-lang/rust#109807 CosmWasm/cosmwasm#1727 应该是1.70+的工具链生成的wasm二进制带了mvp以外的opcode

可以尝试按装下面我修改后的cargo-liquid工具,然后再cargo liquid build试试

cargo install --git https://github.com/bxq2011hust/cargo-liquid --branch main --force

@2473o 2473o closed this as completed Jun 11, 2024
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

3 participants