tcdi / plrust

A Rust procedural language handler for PostgreSQL
PostgreSQL License
1.12k stars 32 forks source link

Unable to run plrust from M1 mac due to version mismatch #367

Closed dineshsivaji closed 1 year ago

dineshsivaji commented 1 year ago

I have followed the documentation Getting Started and while running I am getting the version mismatch issue.

dsivaji@Dineshs-MacBook-Pro plrust % cargo pgrx run pg14 --release 
Error: 
   0: `pgrx-0.9.7` shouldn't be used with `cargo-pgrx-0.9.8`, please use `pgrx = "~0.9.8"` in your `Cargo.toml`.

Location:
   /Users/dsivaji/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-pgrx-0.9.8/src/metadata.rs:42

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SPANTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   0: cargo_pgrx::metadata::validate
      at /Users/dsivaji/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-pgrx-0.9.8/src/metadata.rs:27
   1: cargo_pgrx::command::run::execute
      at /Users/dsivaji/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-pgrx-0.9.8/src/command/run.rs:55

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
dsivaji@Dineshs-MacBook-Pro plrust % 
dineshsivaji commented 1 year ago

Changing the version to 0.9.8 led to another issue

dsivaji@Dineshs-MacBook-Pro plrust % cargo pgrx run pg14 --release 
Error: 
   0: couldn't get cargo metadata
   1: `cargo metadata` exited with an error:     Updating crates.io index
      error: failed to select a version for `pgrx`.
          ... required by package `plrust-trusted-pgrx v1.2.3 (/Users/dsivaji/Projects/rust-learnings/plrust_work/plrust/plrust-trusted-pgrx)`
      versions that meet the requirements `=0.9.7` are: 0.9.7

      all possible versions conflict with previously selected packages.

        previously selected package `pgrx v0.9.8`
          ... which satisfies dependency `pgrx = "=0.9.8"` of package `plrust v1.2.3 (/Users/dsivaji/Projects/rust-learnings/plrust_work/plrust/plrust)`

      failed to select a version for `pgrx` which could resolve this conflict

Location:
   /Users/dsivaji/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-pgrx-0.9.8/src/metadata.rs:23

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SPANTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   0: cargo_pgrx::command::run::execute
      at /Users/dsivaji/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-pgrx-0.9.8/src/command/run.rs:55

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
workingjubilee commented 1 year ago

Instead of changing the toml versions, use cargo install cargo-pgrx --version 0.9.7

dineshsivaji commented 1 year ago

It Worked, Thanks!