Skip to content

Fix cargo pgrx upgrade reading the wrong Cargo index cache directory - #2398

Open
isdaniel wants to merge 1 commit into
pgcentralfoundation:developfrom
isdaniel:fix/upgrade-index-cache-2396
Open

isdaniel wants to merge 1 commit into
pgcentralfoundation:developfrom
isdaniel:fix/upgrade-index-cache-2396

Conversation

@isdaniel

@isdaniel isdaniel commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

For #2396, where cargo pgrx upgrade without --to fails with No such file or directory on Cargo 1.85 and newer. Since 0.19.0 (#2305) the latest version comes from Cargo's local index cache, but crates-index still defaults to the cache directory name Cargo used before 1.85, so the lookup reads a directory that does not exist. The command now opens the current directory with SparseIndex::from_url_with_hash_kind and HashKind::Stable, and only the discover modes carry the index, so --to never reads the cache. A missing Cargo.toml now reports the path and --manifest-path instead of a bare No such file or directory.

The pre-1.85 cache directory is deliberately no longer read, because falling back to it could silently report an outdated latest version. Cargo 1.85 and newer no longer update that directory, and pgrx 0.17 and later use edition 2024 (Rust 1.85 or newer) with 0.19 requiring Rust 1.96, so projects on those versions already use the new one. Only someone upgrading from pgrx 0.16 or older with a Cargo older than 1.85 is affected, and for them --to still works.

Found while testing: with a path-only pgrx dependency, discover mode still needs a cache entry because the lookup runs before the version check; unimplemented!("custom registry") panics on user input; and the tracing span on update_manifest prints the whole manifest in error output.

…error handling

Update crates-index dependency version to 3.6
@isdaniel isdaniel changed the title Enhance upgrade command to utilize crates.io index cache and improveerror handling Fix cargo pgrx upgrade reading the wrong Cargo index cache directory Oct 24, 2026
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

Successfully merging this pull request may close these issues.

1 participant