Skip to content

Conversation

@BradyBonnette
Copy link
Contributor

Addresses: #377

When plrust goes through a release cycle, occasionally (read: pretty much "almost" every time) we forget to update the hard-coded pgrx version in the plrust/build script due to the fact that our automated release tooling does not consider nor modify the script file. With the changes in this PR, we programmatically get the pgrx version using cargo tree and some unix utils magic so that nobody has to think about updating that value ever again upon release.

plrust/build Outdated
--version "0.10.0" \
--locked # use the Cargo.lock in the pgrx repo
# Attempt to get pgrx version from cargo tree. Looking for a pattern such as "pgrx v0.10.0"
PGRX_VERSION=$(cargo tree | grep -E "\s*pgrx\s+v[0-9]+\.[0-9]+\.[0-9]+" | head -n 1 | cut -f2- -dv)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just realized that this should maybe be cargo tree --package plrust. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, probably. I think the thing I send you on Discord assumed being in the plrust/ crate directory. Testing manually it doesn't seem to matter tho.

Could also add --depth 1

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.

My comment aside, I think this is fine. If you're done done done, feel free to merge it.

plrust/build Outdated
--version "0.10.0" \
--locked # use the Cargo.lock in the pgrx repo
# Attempt to get pgrx version from cargo tree. Looking for a pattern such as "pgrx v0.10.0"
PGRX_VERSION=$(cargo tree | grep -E "\s*pgrx\s+v[0-9]+\.[0-9]+\.[0-9]+" | head -n 1 | cut -f2- -dv)
Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, probably. I think the thing I send you on Discord assumed being in the plrust/ crate directory. Testing manually it doesn't seem to matter tho.

Could also add --depth 1

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.

3 participants