tcdi / plrust

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

Problem with clap v4.5.4 #410

Closed yrashk closed 4 months ago

yrashk commented 4 months ago

Trying to build plrust 1.2.6 through 1.2.8 results in this error:

error: failed to compile `cargo-pgrx v0.11.4`, intermediate artifacts can be found at `/tmp/cargo-installpit9R4`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Caused by:
package `clap v4.5.4` cannot be built because it requires rustc 1.74 or newer, while the currently active rustc version is 1.72.0

I wonder if anybody ran into this yet?

eeeebbbbrrrr commented 4 months ago

What’s the command that caused this error?

yrashk commented 4 months ago

I am extracting from my (previously working) Dockerfile:

cd plrust/plrust && cargo install cargo-pgrx --locked  
eeeebbbbrrrr commented 4 months ago

You'd need to install the exact version of cargo-pgrx that plrust uses.

What we end up doing in CI, which runs nightly (and works) is:

$ cargo install cargo-pgrx --version 0.11.0 --locked

How's that work for you?

We have it on our radar to update plrust & postgrestd to the latest rust version, but aren't quite ready to do that yet.

yrashk commented 4 months ago

Thank you, this worked!

eeeebbbbrrrr commented 4 months ago

If you can pluck the version out of plrust/Cargo.toml, that might future-proof you, depending on how you do configure your docker images. This is what we do in CI for all our pgrx-based projects.

(Probably the thing I dislike most about the crates.io ecosystem is this exact problem -- crates tend to bitrot when combined with cargo's semver rules and such. I dunno if we're doing something wrong with our dependencies or if upstream crates don't exactly follow semver or what.)