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

Compile error when cosmwasm-std's backtraces feature is enabled #1623

Closed
CyberHoward opened this issue Mar 7, 2023 · 8 comments
Closed

Compile error when cosmwasm-std's backtraces feature is enabled #1623

CyberHoward opened this issue Mar 7, 2023 · 8 comments

Comments

@CyberHoward
Copy link

CyberHoward commented Mar 7, 2023

Can not compile cosmwasm-std with backtraces feature.
Running MacOS on a M1 Pro.

Steps to reproduce:

  1. Clone this repo
  2. cd packages/std
  3. cargo check --features backtraces

Causing user builds with --all-features flags to fail.

Edit: Running with cargo +nightly check --features backtraces fixes above compile error but still causes other builds to fail.

The following is the output when running cargo check --all-features in our repository using the nightly toolchain.

error[E0658]: use of unstable library feature 'error_generic_member_access'
 --> /Users/robin/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cosmwasm-std-1.2.1/src/errors/recover_pubkey_error.rs:8:10
  |
8 | #[derive(Error, Debug)]
  |          ^^^^^
  |
  = note: see issue #99301 <https://github.com/rust-lang/rust/issues/99301> for more information
  = help: add `#![feature(error_generic_member_access)]` to the crate attributes to enable
  = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: use of unstable library feature 'provide_any'
 --> /Users/robin/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cosmwasm-std-1.2.1/src/errors/recover_pubkey_error.rs:8:10
  |
8 | #[derive(Error, Debug)]
  |          ^^^^^
  |
  = note: see issue #96024 <https://github.com/rust-lang/rust/issues/96024> for more information
  = help: add `#![feature(provide_any)]` to the crate attributes to enable
  = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: use of unstable library feature 'error_generic_member_access'
  --> /Users/robin/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cosmwasm-std-1.2.1/src/errors/std_error.rs:23:10
   |
23 | #[derive(Error, Debug)]
   |          ^^^^^
   |
   = note: see issue #99301 <https://github.com/rust-lang/rust/issues/99301> for more information
   = help: add `#![feature(error_generic_member_access)]` to the crate attributes to enable
   = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: use of unstable library feature 'provide_any'
  --> /Users/robin/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cosmwasm-std-1.2.1/src/errors/std_error.rs:23:10
   |
23 | #[derive(Error, Debug)]
   |          ^^^^^
   |
   = note: see issue #96024 <https://github.com/rust-lang/rust/issues/96024> for more information
   = help: add `#![feature(provide_any)]` to the crate attributes to enable
   = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: use of unstable library feature 'error_generic_member_access'
 --> /Users/robin/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cosmwasm-std-1.2.1/src/errors/verification_error.rs:9:10
  |
9 | #[derive(Error, Debug)]
  |          ^^^^^
  |
  = note: see issue #99301 <https://github.com/rust-lang/rust/issues/99301> for more information
  = help: add `#![feature(error_generic_member_access)]` to the crate attributes to enable
  = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: use of unstable library feature 'provide_any'
 --> /Users/robin/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/cosmwasm-std-1.2.1/src/errors/verification_error.rs:9:10
  |
9 | #[derive(Error, Debug)]
  |          ^^^^^
  |
  = note: see issue #96024 <https://github.com/rust-lang/rust/issues/96024> for more information
  = help: add `#![feature(provide_any)]` to the crate attributes to enable
  = note: this error originates in the derive macro `Error` (in Nightly builds, run with -Z macro-backtrace for more info)


@webmaster128
Copy link
Member

What error do you get?

The backtraces feature requires Rust nighty. Are you aware of that?

@CyberHoward
Copy link
Author

What error do you get?

The backtraces feature requires Rust nighty. Are you aware of that?

Just updated the issue. Also searched the docs for a mention of that nightly requirement but could not find it, might be worth mentioning.

@webmaster128
Copy link
Member

Do you use latest main? There was this change recently: #1613

Which version of nightly do you use? I saw different errors coming and going with different compiler versions.

Since backtraces are not stable, this is no fun to work with unfortunately.

@CyberHoward
Copy link
Author

running the latest published version so that PR isn't included yet. Anyway looks like it got fixed so will wait for it to get published.

As a side question does the backtrace feature actually get used by devs? I haven't ever used it personally.

@webmaster128
Copy link
Member

As a side question does the backtrace feature actually get used by devs? I haven't ever used it personally.

I barely used them but I also did not write too many contracts. @hashedone do you use and tech backtraces in the academy?

@ueco-jb
Copy link
Contributor

ueco-jb commented Mar 8, 2023

As a side question does the backtrace feature actually get used by devs? I haven't ever used it personally.

I use them. Or at least used to use them, in earlier versions they were working just fine.
If I hit some complicated error, callstack from cosmwasm is usually pretty unreadable - either some rust stack like panic, panic_fmt` and so on or general execution of messages. With backtrace I'm able to get down to actual failing code line.

@webmaster128
Copy link
Member

The patch from #1613 is shipped as part of 1.2.2 today

@CyberHoward
Copy link
Author

Awesome, thank you!!

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