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

IntelliJ Rust plugin can't build runtime #6247

Open
2 tasks done
nazar-pc opened this issue Oct 26, 2024 · 11 comments
Open
2 tasks done

IntelliJ Rust plugin can't build runtime #6247

nazar-pc opened this issue Oct 26, 2024 · 11 comments
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.

Comments

@nazar-pc
Copy link
Contributor

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

I'm getting the following confusing error:

error: failed to run custom build command for `pallet-revive-fixtures v0.1.0 (/web/subspace/polkadot-sdk/substrate/frame/revive/fixtures)`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.
Caused by:
  process didn't exit successfully: `/home/nazar-pc/.cache/cargo/target/debug/build/pallet-revive-fixtures-aff745ce5f9ef36b/build-script-build` (exit status: 1)
  --- stdout
  cargo::rerun-if-changed=/web/subspace/polkadot-sdk/substrate/frame/revive/fixtures
  cargo::rerun-if-changed=/web/subspace/polkadot-sdk/substrate/frame/revive/uapi
  --- stderr
      Updating crates.io index
       Locking 13 packages to latest compatible versions
        Adding bitflags v1.3.2 (latest: v2.6.0)
    Downloaded polkavm-derive v0.13.0
    Downloaded polkavm-derive-impl-macro v0.13.0
    Downloaded polkavm-derive-impl v0.13.0
  error: "/home/nazar-pc/.rustup/toolchains/rve-nightly/lib/rustlib/src/rust/library/Cargo.lock" does not exist, unable to build with the standard library, try:
          rustup component add rust-src --toolchain rve-nightly
  Error: Failed to build contracts
  Stack backtrace:
     0: anyhow::error::<impl anyhow::Error>::msg
     1: anyhow::__private::format_err
     2: build_script_build::build::invoke_build
     3: build_script_build::build::run
     4: build_script_build::main
     5: core::ops::function::FnOnce::call_once
     6: std::sys::backtrace::__rust_begin_short_backtrace
     7: std::rt::lang_start::{{closure}}
     8: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ops/function.rs:284:13
     9: std::panicking::try::do_call
               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:554:40
    10: std::panicking::try
               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:518:19
    11: std::panic::catch_unwind
               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panic.rs:345:14
    12: std::rt::lang_start_internal::{{closure}}
               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/rt.rs:143:48
    13: std::panicking::try::do_call
               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:554:40
    14: std::panicking::try
               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:518:19
    15: std::panic::catch_unwind
               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panic.rs:345:14
    16: std::rt::lang_start_internal
               at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/rt.rs:143:20
    17: std::rt::lang_start
    18: main
    19: __libc_start_call_main
               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    20: __libc_start_main_impl
               at ./csu/../csu/libc-start.c:360:3
    21: _start

The lock file exists for me, but at /home/nazar-pc/.rustup/toolchains/rve-nightly/lib/rustlib/src/rust/Cargo.lock instead. Not sure why it is searching for lock file at the wrong location.

I have rve-nightly 1.1.0 installed.

Steps to reproduce

No response

@nazar-pc nazar-pc added I10-unconfirmed Issue might be valid, but it's not yet known. I2-bug The node fails to follow expected behavior. labels Oct 26, 2024
@acatangiu
Copy link
Contributor

cc @pgherveou @xermicus

@JuaniRios
Copy link
Contributor

Have the same problem

@ggwpez
Copy link
Member

ggwpez commented Oct 29, 2024

Is that enabling all features by any chance? Enabling the RISCV feature will cause it to fail compiling, since you probably dont have that toolchain.

@nazar-pc
Copy link
Contributor Author

I do have the toolchain though, see rve-nightly in the original message, is that not it?

@pgherveou
Copy link
Contributor

which runtime are you trying to build, this should only build if you specify riscv?
Is that just intellij or building from the command line fails for you as well?

This should merge soon, does it fix your error #6266

@nazar-pc
Copy link
Contributor Author

Just opening project in IDE, it tries to build and analyze everything and fails. Have not tried the mentioned PR and working on something else at the moment.

@xermicus
Copy link
Member

#6266 will fix this.

What exactly are you trying to do? The custom toolchain is only required for developing the revive pallet. A correct configuration shouldn't pass the riscv feature around.

@nazar-pc
Copy link
Contributor Author

As said above, I try to open a project in IDE. During this IDE will build and expand macros in the whole codebase to build whatever information it needs about the project to enable various IDE features like refactoring, etc.

So revive is nothing special, it'll be built just like everything else.

@xermicus
Copy link
Member

Ah okay, my web UI didn't reload above comments 😅

Yeah this used to work but broke for some reason. I can repro locally, but #6266 will fix it.

@athei
Copy link
Member

athei commented Oct 29, 2024

Did intellij worked for you properly before? In my experience it never worked really well on that repo. Not saying we should not resolve this issue. But probably something else will pop up after fixing it.

@nazar-pc
Copy link
Contributor Author

It worked in the past and other than this still works.

At the same time there are some annoying things about how this repo is maintained, so I have to use environment variables to set one toolchain version for checking the code and another for formatting purposes. And #5317 that would fix at least one half of that is yet to be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I2-bug The node fails to follow expected behavior. I10-unconfirmed Issue might be valid, but it's not yet known.
Projects
None yet
Development

No branches or pull requests

7 participants