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

Add a Rust version check to cargo-pgx #873

Merged
merged 4 commits into from
Nov 16, 2022

Conversation

thomcc
Copy link
Contributor

@thomcc thomcc commented Nov 16, 2022

I had done part of this a while ago, and it came up recently, so I cleaned it off.

Fixes #774, although in the future I would like to relax this requirement and remove this check.

It does not detect mismatches between 1.x.0 and 1.x.1 (which should be fine), or between different betas/nightlies (which is probably strictly required, but would be personally pretty annoying for me).

It tends to ignore errors rather than failing, in case something in the output of one of the tools changes (unlikely, given how much of the ecosystem uses checks like this). There's also an escape-hatch environment variable called PGX_IGNORE_RUST_VERSIONS to disable the check.

I only check in the schema generation code, since that's the only code that needs to care about this.

@eeeebbbbrrrr eeeebbbbrrrr changed the base branch from master to develop November 16, 2022 18:42
Copy link
Contributor

@eeeebbbbrrrr eeeebbbbrrrr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a little note in cargo-pgx/README.md about this general change is also necessary. When an issue gets reported about this (and it will), I'd like to be able to point that person to our docs that says, "see, this check is on purpose".

cargo-pgx/src/command/schema.rs Show resolved Hide resolved
Copy link
Contributor

@eeeebbbbrrrr eeeebbbbrrrr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the README words. Perfect!

cargo-pgx/README.md Outdated Show resolved Hide resolved
@thomcc thomcc merged commit c29d0ae into pgcentralfoundation:develop Nov 16, 2022
@thomcc thomcc deleted the rust-version-check branch November 16, 2022 20:07
@eeeebbbbrrrr eeeebbbbrrrr mentioned this pull request Nov 18, 2022
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.

cargo-pgx should verify compiler parity requirement
3 participants