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

Compatibility Issue: proc-macro server's api version (5) is newer than rust-analyzer's (2) #211

Open
EarthMessenger opened this issue Nov 6, 2024 · 1 comment

Comments

@EarthMessenger
Copy link

I encountered an error when using cargo-equip with my project. Below are the details:

  1. My code structure:

    • src/main.rs

      use proconio::{input};
      
      fn main() {
          input! {
              a: u32,
          }
          println!("{}", a);
      }
    • Cargo.toml

      [package]
      name = "library_checker"
      version = "0.1.0"
      edition = "2021"
      
      [dependencies]
      proconio = { version = "0.4.3", features = ["derive"] }
  2. After running cargo equip, I received the following output and error message:

    warning: Currently cargo-equip only supports Feature Resolver v1, and may search more crates than the real Cargo does. Please watch https://github.com/qryxip/cargo-equip/issues/94
    ...
    error: could not bundle the code
    
    - `registry+https://github.com/rust-lang/crates.io-index#proconio-derive@0.2.1` as `crate::__cargo_equip::crates::__proconio_derive_0_2_1`
    - `registry+https://github.com/rust-lang/crates.io-index#proconio@0.4.5` as `crate::__cargo_equip::crates::proconio`
    
    Caused by:
      proc-macro server's api version (5) is newer than rust-analyzer's (2)
    

I expected cargo equip to bundle my project code successfully, but it fails due to a version incompatibility between proc-macro's API and rust-analyzer.

  • Cargo version: cargo 1.84.0-nightly (031049782 2024-11-01)
  • cargo-equip version: latest
  • Operating system: Arch Linux

Is there a recommended workaround or an update planned to resolve this compatibility issue?

@LumaKernel
Copy link

Try this: --toolchain-for-proc-macro-srv nightly-2023-07-28-<arch>

To install:

rustup toolchain install nightly-2023-07-28
rustup toolchain list  # to check the one fully qualified with <arch>

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