Open jyn514 opened 7 months ago
alternatively it could suggest to update the dependencies in Cargo.toml, which is what i'm about to do now, but that's hard to make copy/pasteable unless they already have cargo-edit installed.
huh. apparently cargo pgrx new
does not error if there's already a directory there. so that's another (albeit destructive) option.
:sweat_smile: uhh maybe we should fix that...
@jyn514 does it nuke the entire directory or does it just rewrite the relevant files?
nukes the entire directory, including src/lib.rs
. it does seem to keep new files, but any file it knows about is completely overwritten.
Wait, keeps new files? Hm.
Interpreting this as a feature request for cargo pgrx update
, which is now https://github.com/pgcentralfoundation/pgrx/issues/1647
Retaining this issue because cargo pgrx new $EXISTING_DIR
should not clobber your lib.rs! Not without using a --force
flag or similar, anyways.
both of those make sense to me, but do note there's a third issue, which is that the error message has mismatches
swapped with cargo_pgrx_version
, so it suggests a cargo install
command with invalid syntax.
oh right, giving a coherent suggestion in that case was a much more trivial change, lemme fix.
https://github.com/pgcentralfoundation/pgrx/pull/1659 for that part.
i just did the following things:
cargo pgrx new
with pgrx 0.11.3.cargo pgrx run
with pgrx 0.11.3. that gave an error that i installed pgrx with 1.76, but the current toolchain is 1.79-nightly. i remembered @workingjubilee saying that restriction was removed ondevelop
, so icargo install --git https://github.com/pgcentralfoundation/pgrx --locked cargo-pgrx
cargo pgrx run
with the new binary. that gives the following error:now the error makes some amount of sense to me, but the
help:
suggestion does not look right. those are dependency versions, not the version of cargo-pgrx itself. maybe https://github.com/pgcentralfoundation/pgrx/blob/82fe8b1ae32cb474a9e1819493725b1efb695d4b/cargo-pgrx/src/metadata.rs#L72 should be usingcargo_pgrx_version
instead ofmismatches
?